mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #855] Volume 100 too low #430
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#430
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AndreKR on GitHub (Sep 26, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/855
Originally assigned to: @roderickvd on GitHub.
I have adjusted alsamixer in a way that other players on the system, like Rhasspy, Mopidy,
aplay, etc. are each playing with a reasonable volume range. With Librespot however when I turn the volume in Spotify to maximum the actual volume coming out of the speakers is more like what would be 20-30% in e.g. Mopidy.@roderickvd commented on GitHub (Sep 27, 2021):
Please provide:
Also, the Alsa mixer has been completely rewritten in
dev. Is there any difference between the latestdevand currently released0.2.0?@AndreKR commented on GitHub (Sep 27, 2021):
/usr/bin/librespot --name Kitchen --device-type speaker --backend alsa --bitrate 160 --cache /var/cache/raspotify --enable-volume-normalisation --normalisation-pregain 6 --volume-ctrl linear --initial-volume=50 --username [redacted] --password [redacted]I added the
--normalisation-pregain 6later in order to get louder output, but it didn't really work too well.If you mean
/etc/asound.conf, it's:The first two lines set the default soundcard, the last line allows playback from Docker containers.
It appears that Raspotify has been built last in Dec 2020, and 0.16.0 is the librespot version? I think I'm gonna make a new build (0.2.0 or dev) first.
@ashthespy commented on GitHub (Sep 27, 2021):
You don't seem to be using the hardware mixer in this example. When no
mixeroption is passed, it defaults to the software mixer (softvol).So the volume in the librespot (0 - 100) is mapped to the current alsa mixer volume.
@AndreKR commented on GitHub (Sep 27, 2021):
Correct, none of my applications is controlling the hardware mixer, it is set to a fixed value.
But still "volume 100%" in Mopidy is blowing my eardrums and "volume 100%" in Raspotify/librespot is calm background noise.
@ashthespy commented on GitHub (Sep 27, 2021):
AFAIK, if nothing is touching the mixer, then the software mixer should just map 100 to the current volume.
So if you set the mixer to 80% - then 100% in librespot is 80% of the actual mixer.
But, again I could be wrong with the new revamped implementation. You could confirm with a simple experiment with
amixer, mopidy and librespot..@roderickvd commented on GitHub (Sep 27, 2021):
@ashthespy is correct, I have nothing to add to that.
Your
asound.confis plain & simple so I don't understand what you mean by "I have adjusted alsamixer in a way that other players on the system". But I am sure that you will need to either use:--mixer alsa(if Raspotify supports that -- I just don't know) oralsamixerto 100% and then control volume usinglibrespotsoftvol.Raspotify documents this too: https://github.com/dtcooper/raspotify#troubleshooting
I'm closing this for now because I'm 99% certain that this isn't a bug in
librespotand either of above options will do what you want.@roderickvd commented on GitHub (Sep 27, 2021):
As a follow-up, unless you have some specific requirement I think you'll want to use a
logvolume control and notlinear. Also see: https://github.com/librespot-org/librespot/wiki/Options#volume-control@AndreKR commented on GitHub (Sep 27, 2021):
What I meant is: I have deliberately set
alsamixerto 45%. Because then, when I play with Mopidy at 100% volume, it is the absolute maximum volume that I want to put my speakers, ears and neighbors through. If I then play the same song from Spotify with Raspotify/librespot at 100% it is so quiet you can talk comfortably in the room.Now you could say it's just that the MP3 that I'm playing with Mopidy is very very loud, but it's always the same, whether I play an MP3 or play from YouTube (with Mopidy) or play a voice announcement with Rhasspy or
aplayor play from Bluetooth with bt-speaker. It's only Raspotify that is so quiet, all other sources share about the same idea of "100% volume".@ashthespy commented on GitHub (Sep 27, 2021):
Not sure what mopidy is doing, but open up
alsamixerand confirm thet both mopidy and librespot don't touch your mixer.Another check can be to completely turn off volume control via librespot and confirm nothing funky is going on..
@AndreKR commented on GitHub (Sep 27, 2021):
I can confirm that, it stays at 45 the entire time.
I tried both and I liked
linearbetter. With linear the "good" volumes are distributed over a wider range, so if for example I give a voice command "louder", which will increase the volume by 5%, it's always a good amount. With thelogvolume control going from 95% to 100% has a too strong effect and going from 45% to 50% has almost no useful effect.@roderickvd commented on GitHub (Sep 27, 2021):
Can you try the latest
librespotby compiling fromdev?Also curious what happens if you disable normalisation altogether. I'm not sure which
librespotRaspotify v0.16.0 is basedon, but from the basic logs it seems like it's on
librespot0.1.x. That only has the basic limiter and not the new dynamic limiter. If so, upping the pregain will do the opposite from what you want, because it will drop the volume of the entire track based on the highest peak +6 dB.Finally, that full verbose log would be good.
@AndreKR commented on GitHub (Sep 27, 2021):
Yeah, I'll set up a build and check again, maybe it's just the old version.
The log I posted isn't the one you were looking for?
@roderickvd commented on GitHub (Sep 27, 2021):
I don't think Raspotify is at
librespot0.2.0 yet: https://github.com/dtcooper/raspotify/issues/394, maybe @JasonLG1979 can tell - he's an avid Raspotify user.Please launch with
--verbosefor a full debug log.Have you tried without normalisation?
@JasonLG1979 commented on GitHub (Sep 27, 2021):
@AndreKR I suspect that normalization is the issue. Refer to @roderickvd's comments. Without any sort of dynamic effects (limiting/compression) just lowering the volume by just a few dB is pretty noticeable as -6dB is the equivalent to 1/2 the wattage and -10dB is about half the perceived volume.
@AndreKR commented on GitHub (Oct 3, 2021):
Progress report: I'm having trouble building Raspotify. Instead I'll build librespot myself. Unlike Python/pip I do actually know Rust/cargo.
@JasonLG1979 commented on GitHub (Oct 3, 2021):
You can always just install raspotify and then replace the binary with a version you build yourself. That's what I do when I'm doing prolonged tests on things. You have to make sure to use the proper args though in
/etc/default/raspotify. They have changed since the version that is included in raspotify.