spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

Delayed interactions since librespot 0.4

Open honza opened this issue 1 year ago • 11 comments

I'm using Fedora 41. Stable rust to compile myself.

My config is simple:

[global]
device_name = "..."
device = "front:CARD=Generic_1,DEV=0"
zeroconf_port = 1234

Since https://github.com/Spotifyd/spotifyd/commit/f53deb9b877126b956a5e233fb743b639232232b, starting/stopping playback, changing songs, and changing volume takes a long time. Volume especially (I change the volume on my phone and it takes 10s to react on the server where before it's instant).

I tried updating librespot to 0.4.2 and even trying @davidgauch librespot 0.5 PR https://github.com/Spotifyd/spotifyd/pull/1309 and those are unchanged.

What can I do to debug this?

honza avatar Oct 31 '24 13:10 honza

Maybe you can retry with the branch in #1317? I assume you're talking about controlling playback via one of the official apps?

eladyn avatar Dec 29 '24 12:12 eladyn

Unfortunately, it doesn't resolve my problem.

honza avatar Dec 30 '24 21:12 honza

That's unfortunate. Just to make sure, you're controlling spotifyd from an official app? If you run spotifyd with the --verbose flag, it's probably going to dump out a lot of things, but maybe you can try that and see, when the command to play/pause arrives on the device by waiting for new logs after pressing the button?

eladyn avatar Dec 30 '24 21:12 eladyn

That's unfortunate. Just to make sure, you're controlling spotifyd from an official app?

Yes, iOS client.

I'll have another look at the logs.

honza avatar Dec 30 '24 21:12 honza

There don't seem to be any errors in the logs that I can see. :(

honza avatar Jan 06 '25 19:01 honza

I didn't expect errors to appear but just general log messages. So when spotifyd receives the command it will print things to the console and you can maybe examine how long it takes from pressing the button to new logs appearing.

eladyn avatar Jan 06 '25 20:01 eladyn

The output is extremely busy so it's impossible to correlate. I'll have to hack around and decrease the amount of stuff logged.

honza avatar Jan 07 '25 19:01 honza

Removing the --verbose flag, I see that tracks are found and loaded immediately but take several seconds to actually start playing:

Jan 07 15:34:16 yoda spotifyd[8139]: Loading <All These People> with Spotify URI <spotify:track:5gKEJxGeBpyztwPAWp3mRd>
Jan 07 15:34:17 yoda spotifyd[8139]: <All These People> (232466 ms) loaded

Volume changes aren't logged.

honza avatar Jan 07 '25 19:01 honza

Thank you for looking into this. That behaviour indeed sounds strange. My next guess would be that it might be related to playback things? I'm assuming you're using the alsa backend and softvol as volume control?

eladyn avatar Jan 18 '25 23:01 eladyn

This issue is still present on latest master.

honza avatar Jun 02 '25 22:06 honza

I'm assuming you're using the alsa backend and softvol as volume control?

The only settings I have changed are above.

honza avatar Jun 02 '25 22:06 honza