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
Update to librespot 0.3.0 #445
Conversation
* Allow initial volume to be empty, and make that the default. Doing so will have librespot query the current volume from hardware if so supported, or fall back to 50% otherwise. If an initial volume is entered, then that is treated as an override value. * Enable normalization by default, like in the official Spotify client. * Update the default pregain to 0 dB and the treshold to -2 dBFS, like in the latest official Spotify client. * Add an "auto" normalization gain type, and make that the default. Doing so will have librespot use album values when playing an album, and track values otherwise, like in the official Spotify client. * Add dithering options, defaulting to automatic depending on the format. This is what happens when no dithering option is selected. Set dithering to "none" to override. * Add a cubic volume control. * Add a configurable range for the volume controls, which is empty by default. Doing so will have librespot query the hardware device capabilities if so supported, or fall back to 60 dB otherwise. If a volume range is entered, then that is treated as an override value. * Add support for a F64 format. * Note that librespot-org is the Librespot Organization, which includes but is not limited to the great Sasha Hilton. * Fix various typos.
Great, thanks :-) I'll review over the coming days. |
Come to think of it: for librespot to query the volume range and current volume from Alsa, it needs to use the Alsa mixer. moOde doesn't do that and uses the softvol mixer instead. So, the hints in this PR may be misleading because there are no hardware queries. We could do as follows:
What do you think? Note that I do recommend softvol over the Alsa mixer in 99% of cases, unless there is some specific requirement, such as latching onto mute/unmute switches to physically power on/off or switch some relays. Softvol works in 64-bit floating point which will be better even than 32-bit integer mixing in hardware. For users with those specific requirements, I think they are advanced enough to configure the Alsa mixer themselves, without introducing this complexity in moOde. |
Correct, we use software volume for audio renderers to keep it simple for users and so far no complaints. Also many users have audio devices that don't support hardware mixer. Couple things:
|
If you leave it out, it will default to 60 dB. This is a sane value and was hardcoded before. If you leave it as a configurable setting, then it has the advantage that users can control the steepness of the volume curve, in effect influencing the usable volume range of the slider.
My PR already does that, if we're talking about the same thing: $initial_volume = empty($cfg_spotify['initial_volume']) ? '' : ' --initial-volume ' . $cfg_spotify['initial_volume']; If the field is left empty, then the cached value is used.
I have no particular preference either way. Normalization is enabled by default in the official Spotify client, but purists may look the other way. In Librespot it's not standard either but we haven't debated it. |
Ok so makes sense to have volume_range option and we can leave normalization initially "No" which would be consistent with the other renderers and MPD where DSP is initially off. The issue with input fields of type="number" is that only numeric values are allowed. User could never set the field to "". |
OK I'll update the PR to do that and change the hints as well.
I understand what you're saying, but this is what I tried in Safari yesterday and worked just fine. Haven't tried other browsers yet, but in Safari I could just clear the value. |
Being able to set numeric field to blank is because the attribute "required" is missing in the <input... statement. I did quick global search of the codebase and most number fields have the "required" attribute which is really the correct way to validate number fields. Prolly the easiest would be to have -1 be the value that designates the conditions below. The help could say "Set to -1 to ..." initial_volume = "Use previously cached volume" When the field is set to -1 the startSpotify() function would test for this value instead of blank. |
OK I'll work on it tonight. |
03010b8 should about do it. |
Thanks ❤️ We haven't released 0.3.0 yet as there was a last minute fix we want to vet first, but it shouldn't be long. In the meantime if you want to run librespot with these new options, feel free to compile the current |
Will do. Question: Is the -1 setting and default behavior for initial_volume independent of whether we launch librespot with --mixer sovtvol vs --mixer alsa (+ the other mixer params)? For example let's say we have two audio devices. Device A has a hardware volume mixer and device B does not. With the -1 setting the volume slider on a client connecting to device A will be set to the current alsa volume on that device. If the client connects to device B the client volume slider will be set to 50%. Is that correct? |
Correct for device A. Correct for device B if it is the first launch or the cache has been wiped from disk, otherwise it will use the previously set volume. |
Perfect, thanks :-) |
We just released 0.3.0. One PR slipped through and we might release a 0.3.1 soon, but at least you can now get these new |
Compiled and working fine :-) |
We plan to release librespot 0.3.0 shortly. This PR adds support for the various new and changed command line options. Please refer to the extended commit log for more information.
I'll drop a note here once 0.3.0 is out of the door!