owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.1k stars 237 forks source link

Set standard airplay device? #350

Closed lixee closed 7 years ago

lixee commented 7 years ago

Hey there,

I just installed forked-daapd on my new unRAID system. It is working fine so far (using Apple Remote App). Of course there is no local audio output, so daapd will select the first (alphabetically) airplay device. Is there any way to change this behavior? Or better, deactivate autoplay, so that I can select the output before playing begins?

ejurgensen commented 7 years ago

When you have selected a device it gets marked as "selected" and should then become selected the next time around. I think there are some situations where the "selected" mark can become unset, which sounds like it is happening to you. I don't remember the exact rules around that, possibly it can happen if the device gets switched of during playback.

There is no direct way of disabling alphabetic autoselect (which is the fallback when no device is marked as selected), but a few alternate things that might help:

  1. Configure local audio to the "dummy" output (doesn't require alsa/pulse) and then have that selected as a default.
  2. Select the device you prefer, start/stop playback and then restart forked-daapd. This means that the select mark gets written to the db, so perhaps it will work more consistently afterwards.
lixee commented 7 years ago

Thx for the quick reply! I guess audio { type = "dummy" } will do that? If I also set speaker_autoselect to no, I will get:

[ LOG] player: Cannot start playback: no output started [ LOG] dacp: Could not start playback

Is there something else I should do?

ejurgensen commented 7 years ago

I had completely forgotten about the speaker_autoselect option, I guess that actually aims at doing what you want. Of course, this option really does as it says, so when you disable it, you must make sure to manually select a valid output before starting playback, otherwise you get the error above. In Remote for iPhone this gives a bit of catch 22, since you cannot select output without starting playback.

To get around that you can try running "mpc outputs" and then select the dummy output. I think it has id 1, so "mpc enable 1" should do it.

lixee commented 7 years ago

That's exactly my problem, can't select the output until I've started playback ;)

Ok, so I will try mpc outputs and mpc enable 1. But where exactly in the conf do I put it? General?

ejurgensen commented 7 years ago

They are commands, not configuration lør. 4. feb. 2017 kl. 23.40 skrev lixee notifications@github.com:

That's exactly my problem, can't select the output until I've started playback ;)

Ok, so I will try mpc outputs and mpc enable 1. But where exactly in the conf do I put it? General?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ejurgensen/forked-daapd/issues/350#issuecomment-277483397, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGmTgG3prmwuVWuj-mtbvY8yU6cCDmlks5rZP5BgaJpZM4L3LkV .

lixee commented 7 years ago

Since I'm running daapd on my unraid server, I guess I should work with a curl command?

curl "http://IP_UNRAID:3689/...

Can you tell me what I have to enter to send over the command, tried google, but wasn't able to find it.

ejurgensen commented 7 years ago

You can do that, but daap commands over curl are a bit of work to decipher. It is easier to use mpc, which also works over the network (just specify the host name with "-h").

However, I guess it would be a better solution for this problem if forked-daapd just allowed starting playback without outputs. I think that should actually be able to work. Are you building yourself? In that case you can give this branch a try, where I have removed the checks against output-less playback: https://github.com/ejurgensen/forked-daapd/tree/no_output

lixee commented 7 years ago

I don't know yet how to build myself, but I'm eager to find out! ;) will try it next weekend and let you know if it worked, thx so far!

ejurgensen commented 7 years ago

Closing, fixed in master