[GH-ISSUE #695] There should be a "none" option for "--mixer" switch. #391

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

Originally created by @ghost on GitHub (Apr 14, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/695

Originally assigned to: @JasonLG1979 on GitHub.

When using librespot with a DAC which has no volume control, --mixer alsa does not work. Also, some people prefer to set their volume only the amplifier to achieve the highest transparency possible and not allow the player to change the volume whatsoever.

For example, mpd allows this by setting in /etc/mpd.conf:

audio_output {
        type        "alsa"
        name        "DAC"
        device      "hw:1,0"
        mixer_type  "none"
}

Librespot should allow something similar too, i.e. adding another option, for example, --mixer none, which would simply ignore any volume change request from spotify client, and just always send the track at 100% volume into the selected backend.

I reckon this should be extremely easy to implement to the current code, wouldn't break any other features, and would suit many audiophiles.

Originally created by @ghost on GitHub (Apr 14, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/695 Originally assigned to: @JasonLG1979 on GitHub. When using librespot with a DAC which has no volume control, ``--mixer alsa`` does not work. Also, some people prefer to set their volume only the amplifier to achieve the highest transparency possible and not allow the player to change the volume whatsoever. For example, mpd allows this by setting in ``/etc/mpd.conf``: ``` audio_output { type "alsa" name "DAC" device "hw:1,0" mixer_type "none" } ``` Librespot should allow something similar too, i.e. adding another option, for example, ``--mixer none``, which would simply ignore any volume change request from spotify client, and just always send the track at 100% volume into the selected backend. I reckon this should be extremely easy to implement to the current code, wouldn't break any other features, and would suit many audiophiles.
kerem 2026-02-27 19:30:22 +03:00
  • closed this issue
  • added the
    audio
    wiki
    labels
Author
Owner

@ashthespy commented on GitHub (Apr 14, 2021):

There should be a fixed option for --volume-ctrl does that not work for you?

<!-- gh-comment-id:819779003 --> @ashthespy commented on GitHub (Apr 14, 2021): There should be a `fixed` option for `--volume-ctrl` does that not work for you?
Author
Owner

@ghost commented on GitHub (Apr 14, 2021):

There should be a fixed option for --volume-ctrl does that not work for you?

That is quite a good idea. It should be a valid workaround, but the solution still could be cleaner.

<!-- gh-comment-id:819811841 --> @ghost commented on GitHub (Apr 14, 2021): > There should be a `fixed` option for `--volume-ctrl` does that not work for you? That is quite a good idea. It should be a valid workaround, but the solution still could be cleaner.
Author
Owner

@roderickvd commented on GitHub (Apr 14, 2021):

There should be a fixed option for --volume-ctrl does that not work for you?

That is quite a good idea. It should be a valid workaround, but the solution still could be cleaner.

I think @ashthespy means to say: --volume-ctrl fixed is already there. Combined with --initial-volume 100 --mixer softvol this leaves samples untouched. Yes it'd be easy to map this to --mixer none. Good opportunity to learn some Rust? 😉

<!-- gh-comment-id:819835308 --> @roderickvd commented on GitHub (Apr 14, 2021): > > There should be a `fixed` option for `--volume-ctrl` does that not work for you? > > That is quite a good idea. It should be a valid workaround, but the solution still could be cleaner. I think @ashthespy means to say: `--volume-ctrl fixed` is already there. Combined with `--initial-volume 100 --mixer softvol` this leaves samples untouched. Yes it'd be easy to map this to `--mixer none`. Good opportunity to learn some Rust? 😉
Author
Owner

@ashthespy commented on GitHub (Apr 14, 2021):

The --mixer flag is ALSA specific, while the volume-ctrl is one level higher. It is how the volume command from Spotify is handled, regardless of the backend.

You could add add a case to map a "none" mixer, but I personally feel it's moot.. You shouldn't be passing in mixer if you don't mean to use it?

<!-- gh-comment-id:819841832 --> @ashthespy commented on GitHub (Apr 14, 2021): The `--mixer ` flag is ALSA specific, while the `volume-ctrl` is one level higher. It is how the volume command from Spotify is handled, regardless of the backend. You could add add a case to map a "none" mixer, but I personally feel it's moot.. You shouldn't be passing in mixer if you don't mean to use it?
Author
Owner

@roderickvd commented on GitHub (Apr 14, 2021):

The --mixer flag is ALSA specific, while the volume-ctrl is one level higher. It is how the volume command from Spotify is handled, regardless of the backend.

Current behaviour:

    --mixer MIXER   Mixer to use (alsa or softvol)
-m, --mixer-name MIXER_NAME
                    Alsa mixer name, e.g "PCM" or "Master". Defaults to
                    'PCM'

If no mixer is specified, it defaults to softvol.

<!-- gh-comment-id:819865733 --> @roderickvd commented on GitHub (Apr 14, 2021): > The `--mixer ` flag is ALSA specific, while the `volume-ctrl` is one level higher. It is how the volume command from Spotify is handled, regardless of the backend. Current behaviour: ``` --mixer MIXER Mixer to use (alsa or softvol) -m, --mixer-name MIXER_NAME Alsa mixer name, e.g "PCM" or "Master". Defaults to 'PCM' ``` If no mixer is specified, it defaults to `softvol`.
Author
Owner

@ashthespy commented on GitHub (Apr 14, 2021):

Oops, you are right! Mixed (ahem) it up with --mixer-name

So --volume-ctrl fixed --initial-volume 100 should result in no steam alteration.

I agree this isn't as succinct as --mixer none but don't think it it's worth adding!
If someone has strong feelings, feel free to add a PR.. ;-)

<!-- gh-comment-id:819870679 --> @ashthespy commented on GitHub (Apr 14, 2021): Oops, you are right! Mixed (ahem) it up with `--mixer-name` So `--volume-ctrl fixed --initial-volume 100` should result in no steam alteration. I agree this isn't as succinct as `--mixer none` but don't think it it's worth adding! If someone has strong feelings, feel free to add a PR.. ;-)
Author
Owner

@kingosticks commented on GitHub (Apr 14, 2021):

The wiki could probably do with some love there, the wording "fixed volume scaling" is not very clear:

Option   volume-ctrl [linear, log, fixed] Choose between a logarithmic (default), linear, or fixed volume scaling.

Something like:

Choose between a logarithmic scale, linear scale, or fixed volume (no control). Default is logarithmic.

maybe?

<!-- gh-comment-id:819912527 --> @kingosticks commented on GitHub (Apr 14, 2021): The wiki could probably do with some love there, the wording "fixed volume scaling" is not very clear: Option |   | volume-ctrl | [linear, log, fixed] Choose between a logarithmic (default), linear, or fixed volume scaling. -- | -- | -- | -- Something like: > Choose between a logarithmic scale, linear scale, or fixed volume (no control). Default is logarithmic. maybe?
Author
Owner

@ghost commented on GitHub (Apr 15, 2021):

The wiki could probably do with some love there

That would kinda help, but it would still be unclear that --volume-ctrl fixed --initial-volume 100 should "result in no steam alteration", as claimed by @ashthespy. That fact should be stated also. Hardcore audiophiles don't like software volume control, no matter how "good" it is, and having a "fixed volume control set at 100%" still feels worse than having "no volume control", but if that fact was clearly explained somewhere, it could be good enough.

I don't see how complicating things like that is better than simply adding --mixer none however, especially considering how very little changes it requires and how, in fact, it changes nothing in the code base.

<!-- gh-comment-id:820125450 --> @ghost commented on GitHub (Apr 15, 2021): > The wiki could probably do with some love there That would kinda help, but it would still be unclear that ``--volume-ctrl fixed --initial-volume 100`` should "result in no steam alteration", as claimed by @ashthespy. That fact should be stated also. Hardcore audiophiles don't like software volume control, no matter how "good" it is, and having a "fixed volume control set at 100%" still feels worse than having "no volume control", but if that fact was clearly explained somewhere, it could be good enough. I don't see how complicating things like that is better than simply adding ``--mixer none`` however, especially considering how very little changes it requires and how, in fact, it changes nothing in the code base.
Author
Owner

@Johannesd3 commented on GitHub (Apr 15, 2021):

You can see here and here what happens to the PCM.

<!-- gh-comment-id:820149774 --> @Johannesd3 commented on GitHub (Apr 15, 2021): You can see [here](https://github.com/librespot-org/librespot/blob/4fc3accc78768bdc995b4151439d368692704d68/playback/src/player.rs#L1158-L1280) and [here](https://github.com/librespot-org/librespot/blob/4fc3accc78768bdc995b4151439d368692704d68/playback/src/mixer/softmixer.rs#L38-L46) what happens to the PCM.
Author
Owner

@JasonLG1979 commented on GitHub (May 15, 2021):

I changed the wiki to read:

Choose between a logarithmic (default), linear, or fixed (no volume control) volume scaling.

<!-- gh-comment-id:841681464 --> @JasonLG1979 commented on GitHub (May 15, 2021): I changed the wiki to read: Choose between a logarithmic (default), linear, or fixed (no volume control) volume scaling.
Author
Owner

@JasonLG1979 commented on GitHub (May 15, 2021):

With all these options it might not be a bad idea to have a wiki page showing the proper args for a few basic use cases.

<!-- gh-comment-id:841681887 --> @JasonLG1979 commented on GitHub (May 15, 2021): With all these options it might not be a bad idea to have a wiki page showing the proper args for a few basic use cases.
Author
Owner

@roderickvd commented on GitHub (May 24, 2021):

@JasonLG1979 would you like to work on the wiki? I think you've got a pretty good idea of what and how you'd like to document it. You should be able to edit it.

<!-- gh-comment-id:847318591 --> @roderickvd commented on GitHub (May 24, 2021): @JasonLG1979 would you like to work on the wiki? I think you've got a pretty good idea of what and how you'd like to document it. You should be able to edit it.
Author
Owner

@JasonLG1979 commented on GitHub (May 24, 2021):

@JasonLG1979 would you like to work on the wiki? I think you've got a pretty good idea of what and how you'd like to document it. You should be able to edit it.

I have some ideas as far as basically a "common use cases" page or section. 100% fixed volume control with no dynamic volume normalization is certainly a valid use case for faux "bit-perfect" audio from librespot. When the new API is figured out and Spotify rolls out the hifi tier and they presumably use a lossless format like FLAC it will be more compelling because it could actually be bit-perfect.

<!-- gh-comment-id:847414553 --> @JasonLG1979 commented on GitHub (May 24, 2021): > @JasonLG1979 would you like to work on the wiki? I think you've got a pretty good idea of what and how you'd like to document it. You should be able to edit it. I have some ideas as far as basically a "common use cases" page or section. 100% fixed volume control with no dynamic volume normalization is certainly a valid use case for faux "bit-perfect" audio from librespot. When the new API is figured out and Spotify rolls out the hifi tier and they presumably use a lossless format like FLAC it will be more compelling because it could actually be bit-perfect.
Author
Owner

@roderickvd commented on GitHub (May 25, 2021):

Great! I'll add your name to this one. Could do some preparations for the upcoming merge of #685 too.

<!-- gh-comment-id:847581328 --> @roderickvd commented on GitHub (May 25, 2021): Great! I'll add your name to this one. Could do some preparations for the upcoming merge of #685 too.
Author
Owner

@JasonLG1979 commented on GitHub (May 25, 2021):

Great! I'll add your name to this one. Could do some preparations for the upcoming merge of #685 too.

Get that and the dithering merged and whatever else you want and release 0.3.0 and I'll even do a write up on optimal configurations on a Pi Zero also, being as though it's the official potato. I mean for under $50 someone can create a pretty decent complete Spotify Connect appliance with a Pi Zero that has the real potential to best commercially available off-the-shelf devices.

<!-- gh-comment-id:848351079 --> @JasonLG1979 commented on GitHub (May 25, 2021): > Great! I'll add your name to this one. Could do some preparations for the upcoming merge of #685 too. Get that and the dithering merged and whatever else you want and release `0.3.0` and I'll even do a write up on optimal configurations on a Pi Zero also, being as though it's the official potato. I mean for under $50 someone can create a pretty decent complete Spotify Connect appliance with a Pi Zero that has the real potential to best commercially available off-the-shelf devices.
Author
Owner

@roderickvd commented on GitHub (May 26, 2021):

Just merged! Great if you could find the time and work on that documentation. Meanwhile we can give everyone some time to test the all the changes in dev, then get a 0.3.0 out the door later.

<!-- gh-comment-id:849079247 --> @roderickvd commented on GitHub (May 26, 2021): Just merged! Great if you could find the time and work on that documentation. Meanwhile we can give everyone some time to test the all the changes in `dev`, then get a `0.3.0` out the door later.
Author
Owner

@JasonLG1979 commented on GitHub (May 26, 2021):

Just merged! Great if you could find the time and work on that documentation. Meanwhile we can give everyone some time to test the all the changes in dev, then get a 0.3.0 out the door later.

Good deal. I'll do it this weekend.

<!-- gh-comment-id:849163235 --> @JasonLG1979 commented on GitHub (May 26, 2021): > Just merged! Great if you could find the time and work on that documentation. Meanwhile we can give everyone some time to test the all the changes in `dev`, then get a `0.3.0` out the door later. Good deal. I'll do it this weekend.
Author
Owner

@roderickvd commented on GitHub (Jun 5, 2021):

Thanks for adding this to the wiki @JasonLG1979.

<!-- gh-comment-id:855301571 --> @roderickvd commented on GitHub (Jun 5, 2021): Thanks for adding this to the [wiki](https://github.com/librespot-org/librespot/wiki/FAQ) @JasonLG1979.
Author
Owner

@JasonLG1979 commented on GitHub (Jun 5, 2021):

Thanks for adding this to the wiki @JasonLG1979.

Your welcome but I totally didn't,lol!!! @coderootme did.

<!-- gh-comment-id:855305546 --> @JasonLG1979 commented on GitHub (Jun 5, 2021): > Thanks for adding this to the [wiki](https://github.com/librespot-org/librespot/wiki/FAQ) @JasonLG1979. Your welcome but I totally didn't,lol!!! @coderootme did.
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#391
No description provided.