Wednesday, May 29, 2013

Raspbmc and iTunes revisited

One thing I didn't get to work with iTunes was the Android remote app to switch from local speakers my AirPlay-enabled speakers, so I gave this another go. Meanwhile, a friendly dev named baal had pushed forked-daapd further to support Remote 3.0: see here. So I downloaded his code and followed his description.

BTW, the Hyperfine Remote, the Android app I want to use, appears as "Remote for iTunes" when turned on to look for iTunes and queried on Raspbmc or some other Linux with

avahi-browse -r -k _touch-remote._tcp

After putting the name and the code in the .remote file as described all over the 'net, the Remote app was picked up, and started showing my music library. However, no sound. And no switching. All I got was

[2013-05-29 02:16:31] player: Could not open local audio

[2013-05-29 02:16:31] player: Could not activate local audio output

[2013-05-29 02:16:31] dacp: Speakers de/activation failed!

[2013-05-29 02:17:30] laudio: cannot find card '0'[2013-05-29 02:17:30]   laudio: function snd_func_card_driver returned error: No such file or directory[2013-05-29 02:17:30]   laudio: error evaluating strings[2013-05-29 02:17:30]   laudio: function snd_func_concat returned error: No such file or directory[2013-05-29 02:17:30]   laudio: error evaluating name[2013-05-29 02:17:30]   laudio: function snd_func_refer returned error: No such file or directory[2013-05-29 02:17:30]   laudio: Evaluate error: No such file or directory[2013-05-29 02:17:30]   laudio: Unknown PCM default[2013-05-29 02:17:30]   laudio: Could not open playback device: No such file or directory

in the forked-daapd log.

Turns out Raspbmc doesn't have local sound support with ALSA and installed. I found and followed the good man Jeff Skinner and his instructions here.  And edited /etc/asound.conf to read

pi@raspbmc:~$ more /etc/asound.conf

pcm.!default {
 type hw
 card 0
}

ctl.!default {
  type hw
  card 0
}

And: Local sound works!! No drops, so that part's great. But even though I see the AirPlay speakers registered with forked-daapd in its log (on debug level), and I do see them in the remote app as a choice in the app's volume settings. Clicking it briefly flashes a "Switching [...]" message, but it reverts back to the local speakers' choice.  I do see this message in the log:

[2013-05-29 09:07:03] dacp: DACP request: /ctrl-int/1/getspeakers?session-id=100

but no other error message, so not probably not too bad (call me a hopeless optimist!). Perhaps I need to add the Airplay speaker to the DB. Suggestions welcome!