Moode Forum
[PROBLEM] Qobuz streaming song skipping - Printable Version

+- Moode Forum (
+-- Forum: moOde audio player (
+--- Forum: Support (
+--- Thread: [PROBLEM] Qobuz streaming song skipping (/showthread.php?tid=1588)

Qobuz streaming song skipping - gilnoh - 08-10-2019

Maybe starting from a few weeks ago (or even older), I realized that my Qobuz songs played by the Moode audio seem to skip every 2nd songs. I have investigated this problem and made a small work-around. I was wondering if anyone else is having this problem too. If it is so, I would investigate further and submit a patch to upmpdcli, or something.

Problem observed:
- On play-list: when one song ends, instead of playing next song, it skips that song and play next-next song.
- Once it plays, the song plays till the end without problem.
- But at the end of the song (especially if the song is longer than, say, 3 minutes), it skips another song and play next one.

Direct cause of the problem:
- POST request to Qobuz server drops first POST call, but works correctly on second call.
- (In my environment) this is reliably reproduced, for every first POST call to Qobuz server, after 3 or more minutes of pause.
- This causes /track/getFilUrl POST call (Gets actual stream source from Qobuz server) to fail.
- If the play of the single track fails, it (MPD? upmpdcli?) tries to play next song.
- Next post call proceed without problem, and plays next song.
- Thus it looks like only every other song is being played and every second song is skipped.

Root cause of the problem? -- I don't know.
I wasn't able to determine why this connection error happens. ConnectionError exception from python Rest library (requests), could have been caused by connection reject from Qobuz side. But maybe it is related to my internet provider.

This was a bad thing for me (Moode + Qobuz is my main audio system player), so I've implemented a simple "retry" logic on the upmpdcli-qobuz plug-in to make sure it works correctly on my side. I don't know the root cause, nor if this problem occurs on others or not (e.g. if this is a common problem of the plug-in users.) If this is a more common problem, I would like to investigate further and produce a more root-cause level patch for this. But well, if no one see this problem... I am happy enough since it works for me.

So, let me know if you have any similar problem on your Moode + Qobuz. :-) I will share my simple patch for quick work around, and also will investigate further.

RE: Qobuz streaming song skipping - gilnoh - 08-11-2019

Solved! -- I debugged a bit further and get to the root of the problem.

Unitymedia BW (a local internet provider here in Germany) drops idle sockets rather aggressively: any socket open for more than 2 min without any activity, will be dropped. Qobuz plug-in (upmpdcli) uses Python "requests" library, which should handle keep alive automatically (e.g. reopen closed connection etc). However, it seems that the library fails to detect the socket has been closed by internet provider side. Thus when it tries to use this "seemingly open" socket after some idle time, the action always fails.

So basically, this is a (hidden) bug of Python requests library. (Or maybe rather the local internet provider cuts idle sockets in a non-standard way.) On my Moode audio instance, I changed the source code to not to reuse sockets (by explicitly sending Connection: close on request header to Qobuz server), so this problem no longer happenes. I guess this is rather rare combination, and probably not worth a patch. So I am closing my case here. Well, it works nicely, and while doing so, I found out how to config Qobuz plug-in to support 192khz streaming ... so, I am happy.

Having the source code available is so... nice. If something broken, I can fix it. I couldn't do this with my closed-source streamer devices.

RE: Qobuz streaming song skipping - TheOldPresbyope - 08-11-2019


Very nice job of diagnosis and recovery! Thanks for sharing.

As well, the librespot repo on which moOde depends has had a long-standing bug not detecting dropped service. I wonder if your ISP triggers problems with it too.

Fortunately, I live only about 30km as the crow flies from the mid-Atlantic hub of Internet activity in the USA (think Amazon East, etc.; the ever-growing number of data warehouses make the overhead powerlines glow in the dark!). As an lucky byproduct of all the optical-fiber "pipes" in the area, my Internet service is first rate. I still remember, though, the bad-old days when getting any Internet service at all was a hard-won battle and getting good service impossible.