[GH-ISSUE #898] Command line arguments are incorrectly echoed in TRACE. #447

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

Originally created by @ghost on GitHub (Dec 5, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/898

See this output:

[2021-12-05T12:11:07Z INFO  librespot] librespot 0.3.1 7160dc1 (Built on 2021-12-05, Build ID: dLpKscF9, Profile: release)
[2021-12-05T12:11:07Z TRACE librespot] Command line argument(s):
[2021-12-05T12:11:07Z TRACE librespot] 		--name Speakers
[2021-12-05T12:11:07Z TRACE librespot] 		--backend alsa
[2021-12-05T12:11:07Z TRACE librespot] 		--device hw:1,0
[2021-12-05T12:11:07Z TRACE librespot] 		--mixer alsa
[2021-12-05T12:11:07Z TRACE librespot] 		--alsa-mixer-device hw:1
[2021-12-05T12:11:07Z TRACE librespot] 		--bitrate 320
[2021-12-05T12:11:07Z TRACE librespot] 		--cache /tmpfs/spotify/
[2021-12-05T12:11:07Z TRACE librespot] 		--cache-size-limit 512M
[2021-12-05T12:11:07Z TRACE librespot] 		--volume-ctrl cubic
[2021-12-05T12:11:07Z TRACE librespot] 		--verbose 
[2021-12-05T12:11:07Z TRACE librespot] 		--initial-volume 100
[2021-12-05T12:11:07Z TRACE librespot] 		--enable-volume-normalisation 
[2021-12-05T12:11:07Z TRACE librespot] 		--normalisation-method dynamic
[2021-12-05T12:11:07Z TRACE librespot] 		--normalisation-gain-type track
[2021-12-05T12:11:07Z TRACE librespot] 		--normalisation-pregain 
[2021-12-05T12:11:07Z TRACE librespot] 		-3 
[2021-12-05T12:11:07Z TRACE librespot] 		--format S24_3
[2021-12-05T12:11:07Z TRACE librespot] 		--username XXXXXXXX
[2021-12-05T12:11:07Z TRACE librespot] 		--password XXXXXXXX
[2021-12-05T12:11:07Z TRACE librespot] 		--autoplay 

The part that says -3 belongs to the argument before that.

The argument is parsed correctly, because the other part of the log is correct:

[2021-12-05T12:11:25Z DEBUG librespot_playback::mixer::alsamixer] Alsa forcing linear dB mapping: false
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Type: Track
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Pregain: -3.0 dB
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Threshold: -2.0 dBFS
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Method: Dynamic
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Attack: 5ms
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Release: 100ms
[2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Knee: 1.0

So it seems only the echo is incorrect. Minor error, but could be fixed whatsoever I believe.

Originally created by @ghost on GitHub (Dec 5, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/898 See this output: ``` [2021-12-05T12:11:07Z INFO librespot] librespot 0.3.1 7160dc1 (Built on 2021-12-05, Build ID: dLpKscF9, Profile: release) [2021-12-05T12:11:07Z TRACE librespot] Command line argument(s): [2021-12-05T12:11:07Z TRACE librespot] --name Speakers [2021-12-05T12:11:07Z TRACE librespot] --backend alsa [2021-12-05T12:11:07Z TRACE librespot] --device hw:1,0 [2021-12-05T12:11:07Z TRACE librespot] --mixer alsa [2021-12-05T12:11:07Z TRACE librespot] --alsa-mixer-device hw:1 [2021-12-05T12:11:07Z TRACE librespot] --bitrate 320 [2021-12-05T12:11:07Z TRACE librespot] --cache /tmpfs/spotify/ [2021-12-05T12:11:07Z TRACE librespot] --cache-size-limit 512M [2021-12-05T12:11:07Z TRACE librespot] --volume-ctrl cubic [2021-12-05T12:11:07Z TRACE librespot] --verbose [2021-12-05T12:11:07Z TRACE librespot] --initial-volume 100 [2021-12-05T12:11:07Z TRACE librespot] --enable-volume-normalisation [2021-12-05T12:11:07Z TRACE librespot] --normalisation-method dynamic [2021-12-05T12:11:07Z TRACE librespot] --normalisation-gain-type track [2021-12-05T12:11:07Z TRACE librespot] --normalisation-pregain [2021-12-05T12:11:07Z TRACE librespot] -3 [2021-12-05T12:11:07Z TRACE librespot] --format S24_3 [2021-12-05T12:11:07Z TRACE librespot] --username XXXXXXXX [2021-12-05T12:11:07Z TRACE librespot] --password XXXXXXXX [2021-12-05T12:11:07Z TRACE librespot] --autoplay ``` The part that says `-3` belongs to the argument before that. The argument is parsed correctly, because the other part of the log is correct: ``` [2021-12-05T12:11:25Z DEBUG librespot_playback::mixer::alsamixer] Alsa forcing linear dB mapping: false [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Type: Track [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Pregain: -3.0 dB [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Threshold: -2.0 dBFS [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Method: Dynamic [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Attack: 5ms [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Release: 100ms [2021-12-05T12:11:25Z DEBUG librespot_playback::player] Normalisation Knee: 1.0 ``` So it seems only the echo is incorrect. Minor error, but could be fixed whatsoever I believe.
kerem closed this issue 2026-02-27 19:30:41 +03:00
Author
Owner

@ghost commented on GitHub (Dec 5, 2021):

Seems the problem is around this line: github.com/librespot-org/librespot@e66cc5508c/src/main.rs (L669)

The code expects a minus sign always denotes a new item, while a minus sign in this case denotes a negative value instead.

<!-- gh-comment-id:986235123 --> @ghost commented on GitHub (Dec 5, 2021): Seems the problem is around this line: https://github.com/librespot-org/librespot/blob/e66cc5508cee0413829aa347c7a31bd0293eb856/src/main.rs#L669 The code expects a minus sign always denotes a new item, while a minus sign in this case denotes a negative value instead.
Author
Owner

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

I got it that's my bad. I'll just make sure anything followed by a - is only 1 char and a letter that should do it.

<!-- gh-comment-id:986267313 --> @JasonLG1979 commented on GitHub (Dec 5, 2021): I got it that's my bad. I'll just make sure anything followed by a - is only 1 char and a letter that should do it.
Author
Owner

@ghost commented on GitHub (Dec 5, 2021):

I got it that's my bad. I'll just make sure anything followed by a - is only 1 char and a letter that should do it.

That check would probably be enough, unless (-)[a-z] would be a valid username and/or password, i.e. --username -a or --password -a which I am fairly certain are not valid.

<!-- gh-comment-id:986274280 --> @ghost commented on GitHub (Dec 5, 2021): > I got it that's my bad. I'll just make sure anything followed by a - is only 1 char and a letter that should do it. That check would probably be enough, unless `(-)[a-z]` would be a valid username and/or password, i.e. `--username -a` or `--password -a` which I am fairly certain are not valid.
Author
Owner

@ghost commented on GitHub (Dec 5, 2021):

Now that I think of it, device name should probably be valid as --name "-a", which would break the rule, but should work.

Anyone correct me please?

<!-- gh-comment-id:986274567 --> @ghost commented on GitHub (Dec 5, 2021): Now that I think of it, device name should probably be valid as ``--name "-a"``, which would break the rule, but should work. Anyone correct me please?
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

With the PR:

--verbose "totally invalid because --verbose is a flag" --name --name -N "totally invalid because -N is a flag" --normalisation-pregain -3.0 -d -a -u stuff fart

Outputs:

[2021-12-06T01:08:05Z TRACE librespot] Command line argument(s):
[2021-12-06T01:08:05Z TRACE librespot] 		--verbose 
[2021-12-06T01:08:05Z TRACE librespot] 		--name --name
[2021-12-06T01:08:05Z TRACE librespot] 		-N 
[2021-12-06T01:08:05Z TRACE librespot] 		--normalisation-pregain -3.0
[2021-12-06T01:08:05Z TRACE librespot] 		-d -a
[2021-12-06T01:08:05Z TRACE librespot] 		-u XXXXXXXX

"--name" is kinda weird but still a valid device name.

"totally invalid because --verbose is a flag" and "totally invalid because -N is a flag" are ignored because they are never actually evaluated by librespot because --verbose and -N are flags so we only check if they exist.

"-a" is technically valid I guess maybe? Although I'd bet it would fail as soon as you tried to use a device named "-a".

-u is the short version of --username so "stuff" is redacted.

"fart" is not evaluated because it's not a valid flag or option or a value of a valid option. It's ignored completely by librespot.

<!-- gh-comment-id:986353007 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): With the PR: ``` --verbose "totally invalid because --verbose is a flag" --name --name -N "totally invalid because -N is a flag" --normalisation-pregain -3.0 -d -a -u stuff fart ``` Outputs: ``` [2021-12-06T01:08:05Z TRACE librespot] Command line argument(s): [2021-12-06T01:08:05Z TRACE librespot] --verbose [2021-12-06T01:08:05Z TRACE librespot] --name --name [2021-12-06T01:08:05Z TRACE librespot] -N [2021-12-06T01:08:05Z TRACE librespot] --normalisation-pregain -3.0 [2021-12-06T01:08:05Z TRACE librespot] -d -a [2021-12-06T01:08:05Z TRACE librespot] -u XXXXXXXX ``` "--name" is kinda weird but still a valid device name. "totally invalid because --verbose is a flag" and "totally invalid because -N is a flag" are ignored because they are never actually evaluated by `librespot` because `--verbose` and `-N` are flags so we only check if they exist. "-a" is technically valid I guess maybe? Although I'd bet it would fail as soon as you tried to use a device named "-a". `-u` is the short version of `--username` so "stuff" is redacted. "fart" is not evaluated because it's not a valid flag or option or a value of a valid option. It's ignored completely by `librespot`.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

Also @coderootme a couple notes about your args:

--backend alsa is not necessary unless you have also compiled other backends into librespot.

Unless you have some special reason to use --mixer alsa (like you're using some alsa feature that requires that you use alsa volume control) software volume control in librespot is objectively superior to alsa hardware volume control, and much less potentially jankey because it actually works 100% of the time as apposed to alsa volume controls.

--normalisation-method dynamic is redundant. dynamic is already the default.

--alsa-mixer-device hw:1 is also redundant as it defaults to whatever you set --device to.

--normalisation-gain-type track Unless you really prefer track mode all the time you might just leave that out so it defaults to auto. Which changes from track to album mode automatically depending on what you're listening to.

<!-- gh-comment-id:986383828 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): Also @coderootme a couple notes about your args: `--backend alsa` is not necessary unless you have also compiled other backends into `librespot`. Unless you have some special reason to use `--mixer alsa` (like you're using some alsa feature that requires that you use alsa volume control) software volume control in `librespot` is objectively superior to alsa hardware volume control, and much less potentially jankey because it actually works 100% of the time as apposed to alsa volume controls. `--normalisation-method dynamic` is redundant. `dynamic` is already the default. `--alsa-mixer-device hw:1` is also redundant as it defaults to whatever you set `--device` to. `--normalisation-gain-type track` Unless you *really* prefer track mode all the time you might just leave that out so it defaults to `auto`. Which changes from `track` to `album` mode automatically depending on what you're listening to.
Author
Owner

@ghost commented on GitHub (Dec 6, 2021):

Unless you have some special reason to use --mixer alsa (like you're using some alsa feature that requires that you use alsa volume control) software volume control in librespot is objectively superior to alsa hardware volume control, and much less potentially jankey because it actually works 100% of the time as apposed to alsa volume controls.

The advantage of using alsa's mixer, for me at least, with DACs that support it, is that the volume change is instant, while the software volume control delays the volume change (because of buffer, I think). For audiophile setup, I do not use any mixer at all and change the volume with the volume knob on my amplifier only, which is not really that often when the whole gear is of high quality and all tracks are outputted at the same LUFS.

--normalisation-method dynamic is redundant. dynamic is already the default.

Yes, I know, I will probably erase it. I've been using it for a long time now and I like to configure all parameters like these, in case the defaults might change in the future (I manage multiple librespot-powered devices and I wouldn't like some settings changing by itself just because the project development decides to change the default when no value is specified.

How probable is this situation with FOSS?

--alsa-mixer-device hw:1 is also redundant as it defaults to whatever you set --device to.

I thought so too, but it doesn't work without that parameter. Here is the output log when I completely remove --alsa-mixer-device hw:1 from the command:

[2021-12-06T07:58:37Z INFO  librespot_playback::mixer::alsamixer] Mixing with Alsa and volume control: Cubic(0.0) for device: hw:1,0 with mixer control: PCM,0
ALSA lib conf.c:5084:(parse_args) Unknown parameter 1                                                                                                         
ALSA lib conf.c:5217:(snd_config_expand) Parse arguments error: No such file or directory                                                                     
ALSA lib control.c:1471:(snd_ctl_open_noupdate) Invalid CTL hw:1,0                                                                                            
thread 'main' panicked at 'Could not open Alsa mixer: Error("snd_mixer_attach", Sys(ENOENT))', playback/src/mixer/alsamixer.rs:42:60                          
stack backtrace:                                                                                                                                              
   0:   0x8d09b0 - std::backtrace_rs::backtrace::libunwind::trace::hd738fd9ee0e1e0e7      
(... backtrace continues ...)

--normalisation-gain-type track Unless you really prefer track mode all the time you might just leave that out so it defaults to auto. Which changes from track to album mode automatically depending on what you're listening to.

Yes, I currently really prefer track mode. I usually do not listen to whole albums and when I do, I do not mind that the relative volume of songs is changed. For very good masters, like Dire Straits/Mark Knopfler for example, I find the track mode relatively okay-ish, and for anything with bad mastering, I don't mind changing the relative volume of songs. The convenience of listening without touching the volume knob too often is more important to me than listening to an album with crappy mastering as the author intended, when the intention is shit in the first place. I'm not sure I'm making any sense here. But I will happily change my opinion in the future, as I have changed many opinions in the last years.

<!-- gh-comment-id:986528998 --> @ghost commented on GitHub (Dec 6, 2021): > Unless you have some special reason to use `--mixer alsa` (like you're using some alsa feature that requires that you use alsa volume control) software volume control in `librespot` is objectively superior to alsa hardware volume control, and much less potentially jankey because it actually works 100% of the time as apposed to alsa volume controls. The advantage of using `alsa`'s mixer, for me at least, with DACs that support it, is that the volume change is instant, while the software volume control delays the volume change (because of buffer, I think). For audiophile setup, I do not use any mixer at all and change the volume with the volume knob on my amplifier only, which is not really that often when the whole gear is of high quality and all tracks are outputted at the same LUFS. > > `--normalisation-method dynamic` is redundant. `dynamic` is already the default. Yes, I know, I will probably erase it. I've been using it for a long time now and I like to configure all parameters like these, in case the defaults might change in the future (I manage multiple librespot-powered devices and I wouldn't like some settings changing by itself just because the project development decides to change the default when no value is specified. How probable is this situation with FOSS? > > `--alsa-mixer-device hw:1` is also redundant as it defaults to whatever you set `--device` to. I thought so too, but it doesn't work without that parameter. Here is the output log when I completely remove `--alsa-mixer-device hw:1` from the command: ``` [2021-12-06T07:58:37Z INFO librespot_playback::mixer::alsamixer] Mixing with Alsa and volume control: Cubic(0.0) for device: hw:1,0 with mixer control: PCM,0 ALSA lib conf.c:5084:(parse_args) Unknown parameter 1 ALSA lib conf.c:5217:(snd_config_expand) Parse arguments error: No such file or directory ALSA lib control.c:1471:(snd_ctl_open_noupdate) Invalid CTL hw:1,0 thread 'main' panicked at 'Could not open Alsa mixer: Error("snd_mixer_attach", Sys(ENOENT))', playback/src/mixer/alsamixer.rs:42:60 stack backtrace: 0: 0x8d09b0 - std::backtrace_rs::backtrace::libunwind::trace::hd738fd9ee0e1e0e7 (... backtrace continues ...) ``` > > `--normalisation-gain-type track` Unless you _really_ prefer track mode all the time you might just leave that out so it defaults to `auto`. Which changes from `track` to `album` mode automatically depending on what you're listening to. Yes, I currently really prefer track mode. I usually do not listen to whole albums and when I do, I do not mind that the relative volume of songs is changed. For very good masters, like Dire Straits/Mark Knopfler for example, I find the track mode relatively okay-ish, and for anything with bad mastering, I don't mind changing the relative volume of songs. The convenience of listening without touching the volume knob too often is more important to me than listening to an album with crappy mastering as the author intended, when the intention is shit in the first place. I'm not sure I'm making any sense here. But I will happily change my opinion in the future, as I have changed many opinions in the last years.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

The advantage of using alsa's mixer, for me at least, with DACs that support it, is that the volume change is instant, while the software volume control delays the volume change (because of buffer, I think)

I wouldn't think there should be any noticeable delay normally, the buffer should only be 0.5 secs?

I thought so too, but it doesn't work without that parameter. Here is the output log when I completely remove --alsa-mixer-device hw:1 from the command:

That would be a bug for @roderickvd the ,0 part of hw:1,0 should probably be stripped off in that case and in the case that --device takes the form of something like hw:CARD=Generic,DEV=0 it should probably be just hw:CARD=Generic? Idk about that one? That would require some more testing?

In the meantime you can use hw:1 for --device since it's the same as hw:1,0 and it should work. 0 is the default device. Any place anywhere in any alsa config (not just librespot) if the device is 0 you can omit it.

Yes, I currently really prefer track mode.

Fair enough.

<!-- gh-comment-id:986557989 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): > The advantage of using alsa's mixer, for me at least, with DACs that support it, is that the volume change is instant, while the software volume control delays the volume change (because of buffer, I think) I wouldn't think there should be any noticeable delay normally, the buffer should only be 0.5 secs? > I thought so too, but it doesn't work without that parameter. Here is the output log when I completely remove --alsa-mixer-device hw:1 from the command: That would be a bug for @roderickvd the `,0` part of `hw:1,0` should probably be stripped off in that case and in the case that `--device` takes the form of something like `hw:CARD=Generic,DEV=0` it should probably be just `hw:CARD=Generic`? Idk about that one? That would require some more testing? In the meantime you can use `hw:1` for `--device` since it's the same as `hw:1,0` and it should work. `0` is the default device. Any place anywhere in any alsa config (not just `librespot`) if the device is `0` you can omit it. > Yes, I currently really prefer track mode. Fair enough.
Author
Owner

@roderickvd commented on GitHub (Dec 6, 2021):

I don’t know for sure either, but it does look redundant (and so not functioning). You can file an issue or PR for it. Right now still hard at work at other librespot stuff so it’d on the backlog.

<!-- gh-comment-id:986566162 --> @roderickvd commented on GitHub (Dec 6, 2021): I don’t know for sure either, but it does look redundant (and so not functioning). You can file an issue or PR for it. Right now still hard at work at other librespot stuff so it’d on the backlog.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

I manage multiple librespot-powered devices and I wouldn't like some settings changing by itself just because the project development decides to change the default when no value is specified.

How probable is this situation with FOSS?

You should already be getting warning messages about --normalisation-method dynamic in dev. But really librespot is not stable and makes not promises about stability whatsoever. Args can and have changed and may in the future with little to no notice.

<!-- gh-comment-id:986567718 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): > I manage multiple librespot-powered devices and I wouldn't like some settings changing by itself just because the project development decides to change the default when no value is specified. > How probable is this situation with FOSS? You should already be getting warning messages about `--normalisation-method dynamic` in dev. But really `librespot` is not stable and makes not promises about stability whatsoever. Args can and have changed and may in the future with little to no notice.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

You can file an issue or PR for it

I'll add it to my list which adds it to your list,lol!!!

<!-- gh-comment-id:986569152 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): > You can file an issue or PR for it I'll add it to my list which adds it to your list,lol!!!
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

@roderickvd along the way I'll see about making the mixer not explode on errors,lol!!

<!-- gh-comment-id:986570736 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): @roderickvd along the way I'll see about making the mixer not explode on errors,lol!!
Author
Owner

@roderickvd commented on GitHub (Dec 6, 2021):

While I feel that API and command line option stability is important, consider everything as tentative baselined until 1.0.0 and it’s up to FOSS to keep up. I’m a moOde user myself and make efforts to keep that up to date.

<!-- gh-comment-id:986573140 --> @roderickvd commented on GitHub (Dec 6, 2021): While I feel that API and command line option stability is important, consider everything as tentative baselined until 1.0.0 and it’s up to FOSS to keep up. I’m a moOde user myself and make efforts to keep that up to date.
Author
Owner

@ghost commented on GitHub (Dec 6, 2021):

You should already be getting warning messages about --normalisation-method dynamic in dev. But really librespot is not stable and makes not promises about stability whatsoever. Args can and have changed and may in the future with little to no notice.

Yes, I was wondering about that. Why is the librespot development team thinking of removing the basic normalisation method?

I know many audophiles do not like any dynamics compression whatsoever; myself included, except for some special cases, for example when listening on speakers at night as a background noise when doing something else, but definitely not when fully focused on music using good gear.

Removing simple method leaves users who want to equalize tracks to the same LUFS to use dynamic with very low preamp value, I think -9 is the safest value. Which is OK, as long as your DAC and AMP have very high SNR, which most don't.

simple normalisation method solves this at least a bit for poor setups, in my opinion.

But the whole audio theory is so difficult and trying to satisfy all categories of users, casual listeners and audophiles, is sometimes impossible. But removing an already implemented function which simply works, is always so strange to me.

mpd has this function too. It is called replaygain_limit and by default it is enabled, i.e. it works the same as librespot's simple volume normalization. See: github.com/MusicPlayerDaemon/MPD@2240327286/doc/mpdconf.example (L401)

I love how these issue threads always result in discussions where all users learn something new. This community is so amazing! I love being here and reading all your posts and ideas. Obviously many developers here are very knowledgeable about the whole project, which is awesome!

<!-- gh-comment-id:986588409 --> @ghost commented on GitHub (Dec 6, 2021): > You should already be getting warning messages about `--normalisation-method dynamic` in dev. But really `librespot` is not stable and makes not promises about stability whatsoever. Args can and have changed and may in the future with little to no notice. Yes, I was wondering about that. Why is the librespot development team thinking of removing the basic normalisation method? I know many audophiles do not like any dynamics compression whatsoever; myself included, except for some special cases, for example when listening on speakers at night as a background noise when doing something else, but definitely *not* when fully focused on music using good gear. Removing `simple` method leaves users who want to equalize tracks to the same LUFS to use `dynamic` with very low `preamp` value, I think `-9` is the safest value. Which is OK, as long as your DAC and AMP have very high SNR, which most don't. `simple` normalisation method solves this at least a bit for poor setups, in my opinion. But the whole audio theory is so difficult and trying to satisfy all categories of users, casual listeners and audophiles, is sometimes impossible. But removing an already implemented function which simply works, is always so strange to me. `mpd` has this function too. It is called `replaygain_limit` and by default it is enabled, i.e. it works the same as librespot's `simple` volume normalization. See: https://github.com/MusicPlayerDaemon/MPD/blob/22403272869228dce81e37523eda9da0c4305489/doc/mpdconf.example#L401 I love how these issue threads always result in discussions where all users learn something new. This community is so amazing! I love being here and reading all your posts and ideas. Obviously many developers here are very knowledgeable about the whole project, which is awesome!
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

Yes, I was wondering about that. Why is the librespot development team thinking of removing the basic normalisation method?

The idea being that dynamic is objectively better than basic. Basic is literally just the volume being turned up and down as you've figured out. And 99.99% of people would rather use dynamic.

I know many audophiles do not like any dynamics compression whatsoever; myself included, except for some special cases, for example when listening on speakers at night as a background noise when doing something else, but definitely not when fully focused on music using good gear.

Currently you really can't put "audiophile" in the same sentence as Spotify since it's lossy audio. When they roll out the HiFi tier and start streaming FLAC maybe.

Removing simple method leaves users who want to equalize tracks to the same LUFS to use dynamic with very low preamp value, I think -9 is the safest value. Which is OK, as long as your DAC and AMP have very high SNR, which most don't.

simple normalisation method solves this at least a bit for poor setups, in my opinion.

But the whole audio theory is so difficult and trying to satisfy all categories of users, casual listeners and audophiles, is sometimes impossible. But removing an already implemented function which simply works, is always so strange to me.

It's mostly about trying to pair the code and options down. There's no point keeping options and code that most people don't use. Code is not a static thing it has to be maintained. As other parts of the program are updated and changed that mostly unused code also has to updated and changed putting undo burden on devs.

The consensus I think was that dynamic > basic to most users and that audiophiles generally would not use it at all for the most part.

<!-- gh-comment-id:986840972 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): > Yes, I was wondering about that. Why is the librespot development team thinking of removing the basic normalisation method? The idea being that dynamic is objectively better than basic. Basic is literally just the volume being turned up and down as you've figured out. And 99.99% of people would rather use dynamic. > I know many audophiles do not like any dynamics compression whatsoever; myself included, except for some special cases, for example when listening on speakers at night as a background noise when doing something else, but definitely not when fully focused on music using good gear. Currently you really can't put "audiophile" in the same sentence as Spotify since it's lossy audio. When they roll out the HiFi tier and start streaming FLAC maybe. > Removing simple method leaves users who want to equalize tracks to the same LUFS to use dynamic with very low preamp value, I think -9 is the safest value. Which is OK, as long as your DAC and AMP have very high SNR, which most don't. > simple normalisation method solves this at least a bit for poor setups, in my opinion. > But the whole audio theory is so difficult and trying to satisfy all categories of users, casual listeners and audophiles, is sometimes impossible. But removing an already implemented function which simply works, is always so strange to me. It's mostly about trying to pair the code and options down. There's no point keeping options and code that most people don't use. Code is not a static thing it has to be maintained. As other parts of the program are updated and changed that mostly unused code also has to updated and changed putting undo burden on devs. The consensus I think was that dynamic > basic to most users and that audiophiles generally would not use it at all for the most part.
Author
Owner

@roderickvd commented on GitHub (Dec 6, 2021):

@coderootme point did make me think it over. It's fair enough not to remove existing functionality that's working well and used in the wild, even when I don't think by a lot of people. Honestly in this particular case it is so little lines of code that the burden of maintainability isn't really an issue.

On the other hand there's the argument of toning down on configuration options which is an agreed direction.

Where the logic seems flawed however is the point on catering to audiophiles (count me in as one so it's not at all that I object to that group!). Audiophiles with a poor setup, little headroom or poor SNR, is just an oxymoron.

The dynamic limiter (yeah, actually a compressor) preserves DNR for 99% of the time by only throwing away bits (potentially, depending on the sample format) when the track is over limit. The basic limiter throws away DNR for the entire track even if it's just a short passage that's over limit.

For most music and playlists it really won't matter that much. You'd be surprised how little the limiter engages at the default settings with music that is mastered sensibly. I'm not talking about hip hop and pop rock of course, there's little to save there even for an audiophile. But start throwing classical into the mix and at those fringes of dynamic range, it really shows that the basic limiter is a poor man's tool.

@JasonLG1979 is right: by these accounts the dynamic limiter is objectively better. I understand that there will always be exceptions to that rule, but I'm not buying into the audiophile argument here.

<!-- gh-comment-id:987240250 --> @roderickvd commented on GitHub (Dec 6, 2021): @coderootme point did make me think it over. It's fair enough not to remove existing functionality that's working well and used in the wild, even when I don't think by a lot of people. Honestly in this particular case it is so little lines of code that the burden of maintainability isn't really an issue. On the other hand there's the argument of toning down on configuration options which *is* an agreed direction. Where the logic seems flawed however is the point on catering to audiophiles (count me in as one so it's not at all that I object to that group!). Audiophiles with a poor setup, little headroom or poor SNR, is just an oxymoron. The dynamic limiter (yeah, actually a compressor) preserves DNR for 99% of the time by only throwing away bits (potentially, depending on the sample format) when the track is over limit. The basic limiter throws away DNR for the entire track even if it's just a short passage that's over limit. For most music and playlists it *really* won't matter that much. You'd be surprised how little the limiter engages at the default settings with music that is mastered sensibly. I'm not talking about hip hop and pop rock of course, there's little to save there even for an audiophile. But start throwing classical into the mix and at those fringes of dynamic range, it really shows that the basic limiter is a poor man's tool. @JasonLG1979 is right: by these accounts the dynamic limiter is objectively better. I understand that there will always be exceptions to that rule, but I'm not buying into the audiophile argument here.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

For most music and playlists it really won't matter that much. You'd be surprised how little the limiter engages at the default settings with music that is mastered sensibly. I'm not talking about hip hop and pop rock of course, there's little to save there even for an audiophile. But start throwing classical into the mix and at those fringes of dynamic range, it really shows that the basic limiter is a poor man's tool.

Even with pop, rock, hip-hop and metal (generally what I listen to) if you set the --normalisation-pregain to -3.0 and --normalisation-threshold to -3.0 you're basically adhering to the ReplayGain standard with 3dB of additional headroom for tracks that might not be mastered the greatest. With those settings I have never noticed the limiter kick in either audibly or by skimming the logs.

<!-- gh-comment-id:987262291 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): > For most music and playlists it _really_ won't matter that much. You'd be surprised how little the limiter engages at the default settings with music that is mastered sensibly. I'm not talking about hip hop and pop rock of course, there's little to save there even for an audiophile. But start throwing classical into the mix and at those fringes of dynamic range, it really shows that the basic limiter is a poor man's tool. Even with pop, rock, hip-hop and metal (generally what I listen to) if you set the `--normalisation-pregain` to `-3.0` and `--normalisation-threshold` to `-3.0` you're basically adhering to the ReplayGain standard with 3dB of additional headroom for tracks that might not be mastered the greatest. With those settings I have never noticed the limiter kick in either audibly or by skimming the logs.
Author
Owner

@JasonLG1979 commented on GitHub (Dec 6, 2021):

You can get pretty deep in the weeds when you start talking audiophile jargon with some of if grounded in reality more other things but generally speaking I tend to be an objectivist when it comes to hardware and software design. We can't know what every system sounds like so we have to go with the math and science as the great equalizer.

<!-- gh-comment-id:987266482 --> @JasonLG1979 commented on GitHub (Dec 6, 2021): You can get pretty deep in the weeds when you start talking audiophile jargon with some of if grounded in reality more other things but generally speaking I tend to be an objectivist when it comes to hardware and software design. We can't know what every system sounds like so we have to go with the math and science as the great equalizer.
Author
Owner

@ghost commented on GitHub (Dec 7, 2021):

Even with pop, rock, hip-hop and metal (generally what I listen to) if you set the --normalisation-pregain to -3.0 and --normalisation-threshold to -3.0 you're basically adhering to the ReplayGain standard with 3dB of additional headroom for tracks that might not be mastered the greatest. With those settings I have never noticed the limiter kick in either audibly or by skimming the logs.

I agree. This is a good point.

<!-- gh-comment-id:987484699 --> @ghost commented on GitHub (Dec 7, 2021): > Even with pop, rock, hip-hop and metal (generally what I listen to) if you set the `--normalisation-pregain` to `-3.0` and `--normalisation-threshold` to `-3.0` you're basically adhering to the ReplayGain standard with 3dB of additional headroom for tracks that might not be mastered the greatest. With those settings I have never noticed the limiter kick in either audibly or by skimming the logs. I agree. This is a good point.
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#447
No description provided.