Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: relative POST player/volume seems to be broken #141

Closed
2opremio opened this issue Nov 12, 2024 · 5 comments · Fixed by #144
Closed

API: relative POST player/volume seems to be broken #141

2opremio opened this issue Nov 12, 2024 · 5 comments · Fixed by #144
Labels
bug Something isn't working

Comments

@2opremio
Copy link
Contributor

I am using the Alsa mixer with the following configuration:

audio_device: default # ALSA audio device to use for playback
mixer_device: default # ALSA mixer device for volume synchronization 
mixer_control_name: Speaker # ALSA mixer control name for volume synchronization
volume_steps: 100 # Volume steps count
initial_volume: 100 # Initial volume in steps (not applied to the mixer device)
external_volume: false # Whether volume is controlled externally 

I am also using the POST player/volume endpoint to increase/decrease the volume in a relative manner:

To increase:

{
	"volume": 1,
	"relative": true
}

To decrease:

{
	"volume": -1,
	"relative": true
}

However, the volume only increases 1 step up or down (it doesn't continue increasing or decreasing upon multiple API calls).

Also, I get lots of this spurious (and seemly incorrect) warnings:

WARN[0015] error while handling alsa mixer events. (Success) 
WARN[0015] error while handling alsa mixer events. (Success) 
WARN[0015] error while handling alsa mixer events. (Success) 
WARN[0015] error while handling alsa mixer events. (Success) 
@2opremio
Copy link
Contributor Author

BTW, setting the volume from an external Spotify client does seem to change the Alsa mixer volume correctly.

@2opremio
Copy link
Contributor Author

Also, this is on 0.1.2 (I haven't checked other versions)

@devgianlu devgianlu added the bug Something isn't working label Nov 12, 2024
@2opremio
Copy link
Contributor Author

2opremio commented Nov 12, 2024

If you turn down the volume very slowly (approx one change for second) then it works. This makes it unusable though.

I bet is that 4ad9ae1 caused this (CC @aykevl )

It's worth noting that if you you request volume changes faster than 1 per second, the volume doesn't update at all.

I think that the mixer update frequency should be independent of the frequency we send updates back to Spotify.

@aykevl
Copy link
Contributor

aykevl commented Nov 13, 2024

I can confirm this issue with the PulseAudio output so it's not related to the ALSA mixer.

@aykevl
Copy link
Contributor

aykevl commented Nov 13, 2024

Wrote a fix: #144
This fix actually simplifies the code because there's no real reason why the volume needs to be kept outside the player state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants