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.07k stars 236 forks source link

Airport Express connection problems with version 27.1 #986

Closed 26tajeen closed 2 years ago

26tajeen commented 4 years ago

This is really vague but I'm not sure what version of Forked-Daapd I was running before ? Possibly just version 27??

Anyway since having to reformat my Pi's SD card I've found that the new version of Forked-Daapd is sometimes unavailable via the web GUI (prompting me to reboot the Pi to restore it) and fairly often I've annoyed family and neighbours by telling Forked-Daapd to play to my selected Airplay speakers and it randomly decides to include the other Airplay speakers in the house that I don't use with Forked-Daapd. The old version never did this.

Anyone else experiencing these issues with this otherwise great sw?

Cheers!

ejurgensen commented 4 years ago

As you say this is somewhat vague and thus impossible to do anything about. It is not so important that you add details about the previous version, I need either ways of reproducing or some log output, probably where the log level is set to debug. Without that I will have to close this issue.

randomly decides to include the other Airplay speakers in the house that I don't use with Forked-Daapd. The old version never did this.

You can switch this off by setting speaker_autoselect to no in the config. This option is not new or changed, but it only comes in effect when forked-daapd can't start a speaker. So maybe an issue has appeared that causes that?

cdlenfert commented 4 years ago

@lancelon Another tip is that you can set your config file to exclude certain speakers so that they never show up in the speaker list at all. I do this with my instance of Shairport-Sync running on the same server. Forked-Daapd never needs to stream to it so I exclude it permanently. My iPhone on the other hand can see the Shairport-Sync speaker just fine.

26tajeen commented 4 years ago

Thanks for the tip @cdlenfert and for the nice response @ejurgensen.

I've had a gander at my log and this is the recent stuff

[2020-05-05 12:10:03] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:10:03] [  LOG]  artwork: Source 'Spotify search web api (streams)' returned an error for 'BBC 6 Music'
[2020-05-05 12:10:07] [  LOG]     raop: Send error for 'AirPort Express': Connection refused
[2020-05-05 12:10:07] [  LOG]   player: The AirPlay device 'AirPort Express' FAILED
[2020-05-05 12:11:58] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:11:58] [  LOG]  artwork: Source 'Spotify search web api (streams)' returned an error for 'BBC 6 Music'
[2020-05-05 12:12:33] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:12:36] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:12:43] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:12:46] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:13:04] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:13:14] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:13:23] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:14:09] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:14:09] [  LOG]  artwork: Source 'Spotify search web api (streams)' returned an error for 'Radio 3HD'
[2020-05-05 12:14:13] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:14:14] [  LOG]  artwork: Source 'Spotify search web api (streams)' returned an error for 'BBC Radio 2'
[2020-05-05 12:14:17] [  LOG]     raop: Send error for 'AirPort Express': Connection refused
[2020-05-05 12:14:17] [  LOG]   player: The AirPlay device 'AirPort Express' FAILED
[2020-05-05 12:23:31] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:23:31] [  LOG]  artwork: Source 'Spotify search web api (streams)' returned an error for 'BBC 6 Music'
[2020-05-05 12:23:48] [  LOG]  spotify: No spotify refresh token found
[2020-05-05 12:23:51] [  LOG]     raop: No response from 'AirPort Express' (192.168.0.122) to OPTIONS request
[2020-05-05 12:25:08] [  LOG]     raop: Send error for 'AirPort Express': Connection refused
[2020-05-05 12:25:08] [  LOG]   player: The AirPlay device 'AirPort Express' FAILED
[2020-05-05 13:13:48] [  LOG]  spotify: No spotify refresh token found

the frequent references to spotify are confusing because I'm not using, or trying to use, spotify. Indeed, on the web GUI it says "forked-daapd was either built without support for Spotify or libspotify is not installed."

I'm selecting playlists using the following command, called from another server, which worked flawlessly on the previous version:

curl -X PUT "http://192.168.0.124:3689/api/queue/clear" && curl -X POST "http://192.168.0.124:3689/api/queue/items/add?uris=library:playlist:7" && curl -X PUT "http://192.168.0.124:3689/api/player/play"

ejurgensen commented 4 years ago

You can disregard the Spotify/artwork messages, they are "false" error messages, and don't relate to your issue. Still good to know about them, so I can get them removed.

The actual issue clearly comes from severe connection problems with your Airport Express. Can you try installing one of these builds and setting the log level to debug? Then please report back with your results.

26tajeen commented 4 years ago

Thanks - here's a log file. The only thing that could possibly have changed with my WiFi set up here is maybe a neighbour has changed router/AP and they are now channel sharing with me? Otherwise everything is unchanged from when I was successfully running the previous version. :-)

ejurgensen commented 4 years ago

Here is the interesting part of the log:

[2020-05-05 14:14:24] [DEBUG]   player: Start sync packet sent to 'Kitchen Speakers': cur_pos=1916292660, cur_ts=60236.934168429, clock=60236.985090196, rtptime=1916380860
[2020-05-05 14:14:24] [ WARN]   player: Output delay detected: player is 3 ticks behind, catching up
[2020-05-05 14:14:26] [  LOG]     raop: Send error for 'Kitchen Speakers': Connection refused
[2020-05-05 14:14:26] [  LOG]   player: The AirPlay device 'Kitchen Speakers' failed - attempting reconnect in 5 sec
...
[2020-05-05 14:14:31] [DEBUG]   player: Speaker resurrect: 'Kitchen Speakers' (id=160172454464)
[2020-05-05 14:14:31] [DEBUG]     raop: device_start: Sending OPTIONS to 'Kitchen Speakers'
[2020-05-05 14:14:31] [  LOG]     raop: No response from 'Kitchen Speakers' (192.168.0.122) to OPTIONS request
[2020-05-05 14:14:31] [  LOG]   player: The AirPlay device 'Kitchen Speakers' failed to activate

So what's happening is that the APE starts ok, but shortly after the stream starts it disconnects. Then forked-daapd attempts to reconnect, but this time the APE doesn't respond at all.

I have no idea what is causing that. I do have two Airport Expresses myself, and they work, so there must be an extra factor here.

It might be worth trying an old version to see if it makes a difference. You could try 26.5: Stretch: http://gyfgafguf.dk/raspbian/forked-daapd/pool/contrib/f/forked-daapd/forked-daapd_26.5.84.git547222e-2_armhf.deb Buster: http://gyfgafguf.dk/raspbian/forked-daapd/pool/contrib/f/forked-daapd/forked-daapd_26.5.84.git547222e-3_armhf.deb

The database that 27.1 uses is not backwards compatible with 26.5. So I recommend you stop forked-daapd, make a backup of /var/cache/forked-daapd/songs3.db, delete it, and then install the old version.

ejurgensen commented 2 years ago

Closing, no feedback