LMS-Community / slimserver

Server for Squeezebox and compatible players. This server is also called Lyrion Music Server.
https://lyrion.org
Other
1.14k stars 287 forks source link

LMS 7.9 randomly skips to the next song without finishing the one playing #130

Open madattack opened 7 years ago

madattack commented 7 years ago

Hi there,

out of nowhere since a couple of day I experience this same issue when using google music plug in. Random songs are not played until the end. LMS skips to the next track approx. 10 to 20 secs. before the end of the current song. I already tried a couple of things which did not help at all:

I'm using a Raspberry Pi 3 as a server and squeezelite clients on Raspberry Pi B.

Any ideas what could be the reason?

Wapall commented 4 years ago

I just noticed that the problem I have is limited to my Squeezebox Touch, while my Radio plays the same song fine. Re-installing the firmware on the Touch didn't solve it.

Update: I have replaced the power supply on the SBT, which didn't fix it, then replaced the SBT. The new SBT doesn't have the issue.

Update 2: actually the new SBT does have the issue, too. Still suddenly skips to the next song. When it occurs the error is repeatable, playing the song again skips at the very same place. The issue is not Google Music-related, it happens when playing my music library. There are no issues when streaming with Spotty.

Update 3: Here is a video of an instance where it just stops playing. There is no longer sound, and the track timer moves in a loop from 0:31 to 0:36. This and the skipping to the next song are the two symptoms I observe. Before falling into the loop, it had already skipped to the next song in the middle of playing another song. So far the skipping and soundless loop have only occurred on .m4a files that were ripped from CDs with iTunes in 2011. The weird thing is, the same files, server and SBT have worked for years and suddenly I have these issues that make it practically unuseable.

mandoonandy commented 4 years ago

@huubbouma Your solution sounds a like a good interim fix. My family are about to force me to junk my current setup. Would you be able to share your python proxy in a gist (or a repo)?

huubbouma commented 4 years ago

@mandoonandy sure, I mentioned it above, but this thread is becoming long.. https://github.com/Logitech/slimserver/issues/130#issuecomment-465507833 it has a small proxy python file + a small change in the ProtocolHandler.pm file so it uses this proxy.

Wapall commented 4 years ago

I just noticed that the problem I have is limited to my Squeezebox Touch, while my Radio plays the same song fine. Re-installing the firmware on the Touch didn't solve it.

Update: I have replaced the power supply on the SBT, which didn't fix it, then replaced the SBT. The new SBT doesn't have the issue.

Update 2: actually the new SBT does have the issue, too. Still suddenly skips to the next song. When it occurs the error is repeatable, playing the song again skips at the very same place. The issue is not Google Music-related, it happens when playing my music library. There are no issues when streaming with Spotty.

Update 3: Here is a video of an instance where it just stops playing. There is no longer sound, and the track timer moves in a loop from 0:31 to 0:36. This and the skipping to the next song are the two symptoms I observe. Before falling into the loop, it had already skipped to the next song in the middle of playing another song. So far the skipping and soundless loop have only occurred on .m4a files that were ripped from CDs with iTunes in 2011. The weird thing is, the same files, server and SBT have worked for years and suddenly I have these issues that make it practically unuseable.

It seems to me that I have been able to fix this by changing the File Format Conversion Setup for AAC - AAC and for Apple Lossless - Apple Lossless to Disabled:

Screenshot 2020-01-06 at 10 15 39

I am not sure what this does and whether it affects sound quality, but the skipping seems to have stopped.

kstunger commented 4 years ago

The proxy that @huubbouma created has been working perfectly for me.

I attempted to create a fix in a fork, but it appears to be causing an OutputUnderrun error when the player reaches the end of the song. There are several SMTt stat calls and then finally an SMTo:

[20-01-23 11:20:30.0055] Slim::Networking::Slimproto::_stat_handler (784) b8:27:eb:b9:90:f3: STAT-STMo: fullness=1086, output_fullness=-1, elapsed=87.519 [20-01-23 11:20:30.0057] Slim::Networking::Slimproto::_stat_handler (811) b8:27:eb:b9:90:f3 Squeezebox stream status: event_code: STMo bytes_rec_H 0 bytes_rec_L 3505631 fullness: 1086 (0%) bufferSize 2097152 fullness 1086 bytes_received 3505631 signal_strength: 65535 jiffies: 9617337 voltage: 0 [20-01-23 11:20:30.0058] Slim::Networking::Slimproto::_stat_handler (823) output size: 3528000 output fullness: 0 elapsed seconds: 87 [20-01-23 11:20:30.0059] Slim::Networking::Slimproto::_stat_handler (835) elapsed milliseconds: 87519 server timestamp: 0

The basic concept is to spawn a thread to pull down the chunks into a queue to cache the song. If anyone wants to take a look, please feel free. The song finishes playing and the next in the queue does eventually start after about 5 seconds of delay. I'm not sure if where to go from here or if this is even a good solution. https://github.com/kstunger/slimserver/tree/BufferingHTTP(s)

See https://github.com/kstunger/slimserver/blob/8447e7f220156b636ae88c36b23d71c5f251ee1c/Slim/Player/Source.pm#L279

animymous commented 4 years ago

I just noticed that the problem I have is limited to my Squeezebox Touch, while my Radio plays the same song fine. Re-installing the firmware on the Touch didn't solve it. Update: I have replaced the power supply on the SBT, which didn't fix it, then replaced the SBT. The new SBT doesn't have the issue. Update 2: actually the new SBT does have the issue, too. Still suddenly skips to the next song. When it occurs the error is repeatable, playing the song again skips at the very same place. The issue is not Google Music-related, it happens when playing my music library. There are no issues when streaming with Spotty. Update 3: Here is a video of an instance where it just stops playing. There is no longer sound, and the track timer moves in a loop from 0:31 to 0:36. This and the skipping to the next song are the two symptoms I observe. Before falling into the loop, it had already skipped to the next song in the middle of playing another song. So far the skipping and soundless loop have only occurred on .m4a files that were ripped from CDs with iTunes in 2011. The weird thing is, the same files, server and SBT have worked for years and suddenly I have these issues that make it practically unuseable.

It seems to me that I have been able to fix this by changing the File Format Conversion Setup for AAC - AAC and for Apple Lossless - Apple Lossless to Disabled:

Screenshot 2020-01-06 at 10 15 39

I am not sure what this does and whether it affects sound quality, but the skipping seems to have stopped.

Thanks a lot Wapall I'm using LMS 8 and was having horrible skipping problems with Tidal (recently signed up), was pulling my hair out. We have multiple hardware players (Boom, Radio) and software (SqueezePlay), multiple Wifi APs and everything was working well for years synced whole building music.... except with Tidal. Disabling AAC seems to have worked ! Thanks!

asche77 commented 3 years ago

Keeping this thread alive, as I am suffering from this as well -- but (I think) mostly on SqueezePlayer on Android and (newest) SqueezePlay on Windows 10. FLAC only. Newest LMS 8.1.1 on Debian.

d5c0d3 commented 2 years ago

After searching for a long time I found this thread. I am using Deezer plugin for streaming and songs stopped before their end.

I can confirm that disabling AAC format (seems) to work (for now). I will report back if things change.

LMS Version: 8.2.0 - 1627922070 @ Tue Aug 3 11:43:55 CEST 2021 Operating system: Debian (Docker) - EN - utf8 Platform Architecture: x86_64-linux Perl Version: 5.32.1 - x86_64-linux-gnu-thread-multi

baerengraben commented 2 years ago

It took me some time to find this thread too :) I also use deezer plugin and was struggling with the problem that the playback of a track stopped around 50s before the end and jumped to the next track instead. Disabling Fileformat AAC => Streamformat AAC seems to have fixed the problem for me as well.


LMS Version: 8.1.2 OS: Armbian 21.02.3 Focal with Linux 4.14.222-odroidxu4 Perl Version: 5.30.0 built for arm-linux-gnueabihf-thread-multi-64int

baerengraben commented 1 year ago

After a few months of testing, I'm sorry to say that the problem persists. This is also the case with an adapted file format.

The more curious the problem, the more curious the attempts to solve it: I use a VPN gateway (VPN client on Opensense Firewall to ProtonVPN) for communication to the Internet. Now I have adjusted the routing on my OpnSense firewall so that the LMS server does not use the VPN gateway and communicates directly with the ISP WAN gateway. All Squeeze players are set to "Proxy" so that the players receive the streams via the LMS.

=> Lo and behold, so far it works. I was also able to reproduce it. As soon as I enabled VPN again, the skipping at the end of a song also started again.


LMS Version: 8.1.2 Player: 10 x Seqeezeplayer (Max2Play) OS: Armbian 21.02.3 Focal with Linux 4.14.222-odroidxu4 Perl Version: 5.30.0 built for arm-linux-gnueabihf-thread-multi-64int