Are the iPhone and iPad on the SAME WiFi network as the ATV and iMac?
A simple test you can do on the iOS device is... go into the Musi app
Tap on More
Tap on Shared
Do you see your iMac's iTunes library listed?
If yes - can you tap on it and load that library onto the iOS decvice?
if no - Home Sharing isn't working correctly either on the iOS device or in iTunes