[GH-ISSUE #948] Alsa mixer sets raw alsa volume to 0 for very high volume ranges #461

Closed
opened 2026-02-27 19:30:45 +03:00 by kerem · 8 comments
Owner

Originally created by @fpicot on GitHub (Jan 26, 2022).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/948

Originally assigned to: @roderickvd on GitHub.

I have recently updated librespot to version 0.3.1 c6e97a7 (installed through raspotify), and after porting the configuration I'm facing an issue where any volume change via spotify is setting alsa volume to 0.

Hardware : Raspberry Pi 3 with HifiBerry Amp.

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713.1-001b-0 [HifiBerry AMP HiFi tas5713.1-001b-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

librespot logs :

Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z INFO  librespot] librespot 0.3.1 c6e97a7 (Built on 2022-01-18, Build ID: ZBF0gGFJ, Profile: release)
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] Environment variable(s):
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_NAME="raspotify (spotipy)"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_CACHE="/var/cache/raspotify"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_SYSTEM_CACHE="/var/lib/raspotify"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_AUTOPLAY=
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DISABLE_AUDIO_CACHE=
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DISABLE_CREDENTIAL_CACHE=
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_ENABLE_VOLUME_NORMALISATION=
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VERBOSE=
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_BITRATE="320"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VOLUME_RANGE="100.0"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DEVICE="sysdefault:CARD=sndrpihifiberry"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_BACKEND="alsa"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_MIXER="alsa"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_ALSA_MIXER_CONTROL="Master"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VOLUME_CTRL="linear"
Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:36237
Jan 26 16:53:09 spotipy librespot[4971]: [2022-01-26T15:53:09Z DEBUG librespot_discovery::server] POST "/" {}
Jan 26 16:53:09 spotipy librespot[4971]: [2022-01-26T15:53:09Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO  librespot_core::session] Authenticated as "XXXX" !
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_core::session] new Session[0]
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO  librespot_playback::mixer::alsamixer] Mixing with Alsa and volume control: Linear for device: hw:CARD=sndrpihifiberry with mixer control: Master,0
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN  librespot_playback::mixer::alsamixer] Alsa mixer reported maximum dB != 0, which is suspect
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN  librespot_playback::mixer::alsamixer] Please manually set with `--volume-ctrl` if this is incorrect
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa mixer control is softvol: true
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa support for playback (mute) switch: false
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa raw volume range: [0..248] (248)
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa dB volume range: [-99999.99..24.00] (100023.99)
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa forcing linear dB mapping: false
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Type: Auto
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Pregain: 0.0 dB
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Threshold: -2.0 dBFS
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Method: Dynamic
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Attack: 5 ms
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Release: 100 ms
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Knee: 5 dB
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_connect::spirc] new Spirc[0]
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_connect::spirc] canonical_username: XXXXX
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_core::mercury] new MercuryManager
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] new Player[0]
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO  librespot_playback::audio_backend::alsa] Using AlsaSink with format: S16
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] command=AddEventSender
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Setting Alsa raw volume to 0
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] command=VolumeSet(0)

Any volume change via spotify yields:

Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_connect::spirc] kMessageTypeVolume "XXXX" 39a51b714048d4ea951be139318f16b9fb152395 388889874 1643213879656 kPlayStatusStop
Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::mixer::mappings] Input volume 31710 mapped to: 48.39%
Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::mixer::alsamixer] Setting Alsa raw volume to 0
Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::player] command=VolumeSet(31710)

I'm guessing this is related to the following warnings, however I don't see how to set the dB range using --volume-ctrl

Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN  librespot_playback::mixer::alsamixer] Alsa mixer reported maximum dB != 0, which is suspect
Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN  librespot_playback::mixer::alsamixer] Please manually set with `--volume-ctrl` if this is incorrect
Originally created by @fpicot on GitHub (Jan 26, 2022). Original GitHub issue: https://github.com/librespot-org/librespot/issues/948 Originally assigned to: @roderickvd on GitHub. I have recently updated librespot to version 0.3.1 c6e97a7 (installed through raspotify), and after porting the configuration I'm facing an issue where any volume change via spotify is setting alsa volume to 0. Hardware : Raspberry Pi 3 with HifiBerry Amp. ``` # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713.1-001b-0 [HifiBerry AMP HiFi tas5713.1-001b-0] Subdevices: 0/1 Subdevice #0: subdevice #0 ``` librespot logs : ``` Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z INFO librespot] librespot 0.3.1 c6e97a7 (Built on 2022-01-18, Build ID: ZBF0gGFJ, Profile: release) Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] Environment variable(s): Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_NAME="raspotify (spotipy)" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_CACHE="/var/cache/raspotify" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_SYSTEM_CACHE="/var/lib/raspotify" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_AUTOPLAY= Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DISABLE_AUDIO_CACHE= Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DISABLE_CREDENTIAL_CACHE= Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_ENABLE_VOLUME_NORMALISATION= Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VERBOSE= Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_BITRATE="320" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VOLUME_RANGE="100.0" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_DEVICE="sysdefault:CARD=sndrpihifiberry" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_BACKEND="alsa" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_MIXER="alsa" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_ALSA_MIXER_CONTROL="Master" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z TRACE librespot] #011#011LIBRESPOT_VOLUME_CTRL="linear" Jan 26 16:53:06 spotipy librespot[4971]: [2022-01-26T15:53:06Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:36237 Jan 26 16:53:09 spotipy librespot[4971]: [2022-01-26T15:53:09Z DEBUG librespot_discovery::server] POST "/" {} Jan 26 16:53:09 spotipy librespot[4971]: [2022-01-26T15:53:09Z INFO librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070" Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO librespot_core::session] Authenticated as "XXXX" ! Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_core::session] new Session[0] Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO librespot_playback::mixer::alsamixer] Mixing with Alsa and volume control: Linear for device: hw:CARD=sndrpihifiberry with mixer control: Master,0 Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN librespot_playback::mixer::alsamixer] Alsa mixer reported maximum dB != 0, which is suspect Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN librespot_playback::mixer::alsamixer] Please manually set with `--volume-ctrl` if this is incorrect Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa mixer control is softvol: true Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa support for playback (mute) switch: false Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa raw volume range: [0..248] (248) Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa dB volume range: [-99999.99..24.00] (100023.99) Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Alsa forcing linear dB mapping: false Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Type: Auto Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Pregain: 0.0 dB Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Threshold: -2.0 dBFS Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Method: Dynamic Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Attack: 5 ms Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Release: 100 ms Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] Normalisation Knee: 5 dB Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_connect::spirc] new Spirc[0] Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_connect::spirc] canonical_username: XXXXX Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_core::mercury] new MercuryManager Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] new Player[0] Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO librespot_playback::convert] Converting with ditherer: tpdf Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z INFO librespot_playback::audio_backend::alsa] Using AlsaSink with format: S16 Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] command=AddEventSender Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::mixer::alsamixer] Setting Alsa raw volume to 0 Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z DEBUG librespot_playback::player] command=VolumeSet(0) ``` Any volume change via spotify yields: ``` Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_connect::spirc] kMessageTypeVolume "XXXX" 39a51b714048d4ea951be139318f16b9fb152395 388889874 1643213879656 kPlayStatusStop Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::mixer::mappings] Input volume 31710 mapped to: 48.39% Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::mixer::alsamixer] Setting Alsa raw volume to 0 Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay] Jan 26 17:17:59 spotipy librespot[4985]: [2022-01-26T16:17:59Z DEBUG librespot_playback::player] command=VolumeSet(31710) ``` I'm guessing this is related to the following warnings, however I don't see how to set the dB range using --volume-ctrl ``` Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN librespot_playback::mixer::alsamixer] Alsa mixer reported maximum dB != 0, which is suspect Jan 26 16:53:10 spotipy librespot[4971]: [2022-01-26T15:53:10Z WARN librespot_playback::mixer::alsamixer] Please manually set with `--volume-ctrl` if this is incorrect ```
kerem 2026-02-27 19:30:45 +03:00
Author
Owner

@roderickvd commented on GitHub (Jan 26, 2022):

That message probably mentions the wrong command-line option. Please try with --volume-range and set it to 60.

I see that your Alsa mixer is softvol. Do you have any particular reason to use that instead of our own softvol? Ours is of higher quality.

Anyway please let me know if that fixes it and we should change the message.

<!-- gh-comment-id:1022418334 --> @roderickvd commented on GitHub (Jan 26, 2022): That message probably mentions the wrong command-line option. Please try with `--volume-range` and set it to 60. I see that your Alsa mixer is softvol. Do you have any particular reason to use that instead of our own softvol? Ours is of higher quality. Anyway please let me know if that fixes it and we should change the message.
Author
Owner

@roderickvd commented on GitHub (Jan 26, 2022):

Scrap that and please test #950 if that compiles (I only have a Mac around now).

<!-- gh-comment-id:1022674334 --> @roderickvd commented on GitHub (Jan 26, 2022): Scrap that and please test #950 if that compiles (I only have a Mac around now).
Author
Owner

@fpicot commented on GitHub (Jan 27, 2022):

This seems to be fixing the issue, but there are some weird behaviors.
With volume-control=linear and volum-range not set I'm seeing the log "DEBUG librespot_playback::mixer::alsamixer] Alsa dB volume range was detected as 100023.9921875 but overridden as 60", and changing the volume in spotify changes the volume in alsa
With volume-control=cubic or log, I have to explicitly set volume-range, or I still get the raw alsa volume forced to 0 (with log, the volume gets mapped to NaN)

I'm not sure I understand the volume-range settings. The doc says "For the alsa mixer: what the control supports." , and amixer reports :

Simple mixer control 'Master',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 248
  Mono: 136 [55%]
Simple mixer control 'Channels',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 248
  Front Left: 248 [100%]
  Front Right: 248 [100%]

I would expect to set volume-range to 248 to have the best granularity, is this correct ? It's not possible as volume-range is limited to 100.

Regarding your question about softvol, I wonder if there isn't another bug somewhere. I'm passing this conf via env variables :

LIBRESPOT_MIXER="alsa"
LIBRESPOT_ALSA_MIXER_CONTROL="Master"

But the logs show "DEBUG librespot_playback::mixer::alsamixer] Alsa mixer control is softvol: true"

With the previous version of librespot that I was running (0.24 I believe), I could not get the softvol mixer to a correct setting. Either I had fine control over volume but no possibility to get high volumes, or I could reach high volumes but the smallest change in spotify would cause a big change in audio volume. It also allowed me to used the equalizer plugin of alsa.

<!-- gh-comment-id:1023041460 --> @fpicot commented on GitHub (Jan 27, 2022): This seems to be fixing the issue, but there are some weird behaviors. With volume-control=linear and volum-range not set I'm seeing the log "DEBUG librespot_playback::mixer::alsamixer] Alsa dB volume range was detected as 100023.9921875 but overridden as 60", and changing the volume in spotify changes the volume in alsa With volume-control=cubic or log, I have to explicitly set volume-range, or I still get the raw alsa volume forced to 0 (with log, the volume gets mapped to NaN) I'm not sure I understand the volume-range settings. The doc says "For the alsa mixer: what the control supports." , and amixer reports : ```# amixer --device "hw:0" --card "0" Simple mixer control 'Master',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 248 Mono: 136 [55%] Simple mixer control 'Channels',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 248 Front Left: 248 [100%] Front Right: 248 [100%] ``` I would expect to set volume-range to 248 to have the best granularity, is this correct ? It's not possible as volume-range is limited to 100. Regarding your question about softvol, I wonder if there isn't another bug somewhere. I'm passing this conf via env variables : ``` LIBRESPOT_MIXER="alsa" LIBRESPOT_ALSA_MIXER_CONTROL="Master" ``` But the logs show "DEBUG librespot_playback::mixer::alsamixer] Alsa mixer control is softvol: true" With the previous version of librespot that I was running (0.24 I believe), I could not get the softvol mixer to a correct setting. Either I had fine control over volume but no possibility to get high volumes, or I could reach high volumes but the smallest change in spotify would cause a big change in audio volume. It also allowed me to used the equalizer plugin of alsa.
Author
Owner

@fpicot commented on GitHub (Jan 27, 2022):

I was able to confirm the alsa-mixer-control issue, #953 opened to track it separately;

<!-- gh-comment-id:1023098153 --> @fpicot commented on GitHub (Jan 27, 2022): I was able to confirm the alsa-mixer-control issue, #953 opened to track it separately;
Author
Owner

@roderickvd commented on GitHub (Jan 27, 2022):

The weird behavior is caused by your hardware or its Alsa driver that reports an insane range of over 10000 dB. That makes no sense and then the volume controls don’t work as expected. This is what the warning is about to set it manually.

The 248 steps are taken over correctly. So you have 10000 dB / 248 steps = non-sensical step size.

It also detects that your Master mixer is not done in hardware, but in software. Is this not correct?

I think my PR fixes the issue and the rest is explained by your configuration.

<!-- gh-comment-id:1023140125 --> @roderickvd commented on GitHub (Jan 27, 2022): The weird behavior is caused by your hardware or its Alsa driver that reports an insane range of over 10000 dB. That makes no sense and then the volume controls don’t work as expected. This is what the warning is about to set it manually. The 248 steps are taken over correctly. So you have 10000 dB / 248 steps = non-sensical step size. It also detects that your `Master` mixer is not done in hardware, but in software. Is this not correct? I think my PR fixes the issue and the rest is explained by your configuration.
Author
Owner

@roderickvd commented on GitHub (Jan 27, 2022):

I think the docs also say that the volume range is specified in dB or did we omit that?

<!-- gh-comment-id:1023141407 --> @roderickvd commented on GitHub (Jan 27, 2022): I think the docs also say that the volume range is specified in dB or did we omit that?
Author
Owner

@fpicot commented on GitHub (Jan 27, 2022):

The weird behavior is caused by your hardware or its Alsa driver that reports an insane range of over 10000 dB. That makes no sense and then the volume controls don’t work as expected. This is what the warning is about to set it manually.

What I meant is that when setting volume-ctrl to linear, the default value of 60 for volume-range is used (while the doc seems says it should only be when using mixer=softvol), but when setting volume-ctrl to cubic or log, I must explicitly set the volume-range parameter.
But indeed, a bad driver is the root of the issue.

The 248 steps are taken over correctly. So you have 10000 dB / 248 steps = non-sensical step size.

OK, got it! And indeed the doc states that volume-range is in dB.

It also detects that your Master mixer is not done in hardware, but in software. Is this not correct?

Yes, there is no volume button on the hifiberry board, I did not understand this log correctly.

Thanks a lot for your patience and your explanations!

<!-- gh-comment-id:1023221883 --> @fpicot commented on GitHub (Jan 27, 2022): > The weird behavior is caused by your hardware or its Alsa driver that reports an insane range of over 10000 dB. That makes no sense and then the volume controls don’t work as expected. This is what the warning is about to set it manually. What I meant is that when setting volume-ctrl to linear, the default value of 60 for volume-range is used (while the doc seems says it should only be when using mixer=softvol), but when setting volume-ctrl to cubic or log, I must explicitly set the volume-range parameter. But indeed, a bad driver is the root of the issue. > The 248 steps are taken over correctly. So you have 10000 dB / 248 steps = non-sensical step size. OK, got it! And indeed the doc states that volume-range is in dB. > It also detects that your `Master` mixer is not done in hardware, but in software. Is this not correct? Yes, there is no volume button on the hifiberry board, I did not understand this log correctly. Thanks a lot for your patience and your explanations!
Author
Owner

@roderickvd commented on GitHub (Jan 27, 2022):

What I meant is that when setting volume-ctrl to linear, the default value of 60 for volume-range is used (while the doc seems says it should only be when using mixer=softvol), but when setting volume-ctrl to cubic or log, I must explicitly set the volume-range parameter.

Which doc are you referring to?

It also detects that your Master mixer is not done in hardware, but in software. Is this not correct?

Yes, there is no volume button on the hifiberry board, I did not understand this log correctly.

That's not the same. Some DACs do volume control in their own chip, so to speak. I think your HiFiBerry Amp can do that (but not with software plugins), but that's a configuration issue and not something that belongs here.

Thanks a lot for your patience and your explanations!

Sure. We weeded out one bug, after all 👍

<!-- gh-comment-id:1023475855 --> @roderickvd commented on GitHub (Jan 27, 2022): > What I meant is that when setting volume-ctrl to linear, the default value of 60 for volume-range is used (while the doc seems says it should only be when using mixer=softvol), but when setting volume-ctrl to cubic or log, I must explicitly set the volume-range parameter. Which doc are you referring to? > > It also detects that your `Master` mixer is not done in hardware, but in software. Is this not correct? > > Yes, there is no volume button on the hifiberry board, I did not understand this log correctly. That's not the same. Some DACs do volume control in their own chip, so to speak. I think your HiFiBerry Amp can do that (but not with software plugins), but that's a configuration issue and not something that belongs here. > Thanks a lot for your patience and your explanations! Sure. We weeded out one bug, after all :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#461
No description provided.