Set volume using floating point

I am using Mopidy on a Raspberry along with a miniamp. The volume on its minimal setting is still too high. Sadly the lowest volume one can set is 1. Floating-Point isn’t supported using mixer.setVolume. Ideally I want to start at 0.1 or smth. Would this be possible to implement?

There are already some threads in this forum users want to have a lower volume, but none is really solved. So I try another request…would be so nice to have a solution for that!

Have you tried mopidy-alsamixer and its min_volume/max_volume settings.

Sounds promising, but I can’t get sound out of the mixer at all. Current setting is

[audio]
mixer = software
output = alsasink device=hw:0,0

which works.

If I try:

[audio]
mixer = alsamixer

[alsamixer]
card = 0

No sound will come out. What would be the correct setting for [alsamixer] ?

Alsamixer only impacts the (volume) mixer, not the sound output. Leave output = alsasink device=hw:0,0 as it was.

if I do that I can’t control the volume anymore. it is just very loud.

See the instructions in the alsamixer README about setting the control

What readme are referring to exactly? This one? mopidy-alsamixer/README.rst at master · mopidy/mopidy-alsamixer · GitHub

I used amixer scontrols to lookup the control-name:
Simple mixer control ‘Mini’,0

I used the name for the config:
[alsamixer]
control = Mini

(also tried control = ‘Mini’)

without any success. I also tried the interactive mixer: alsamixer -D hw:0

Changing the volume simply has no effect whatsoever.

According to certain posts the miniamp is simply not compatible with alsamixer. It appears only “software” is supported.
Do you still see a way to reduce the volume somehow without replacing the HW?

Ah, yes, that’s true. Some DACs don’t have any hardware volume control.

Perhaps you can use an ALSA softvol (similar to Support for ALSA PCM softvol plugin · Issue #290 · mikebrady/shairport-sync · GitHub) along with Mopidy-Alsamixer?

I don’t think being able to set the volume less than 1 with our software mixer will be that helpful. It’ll be impossible to use that with a volume slider control like most GUI/webclients provide.

You can put a Gstreamer volume element in the output and set it’s volume:

output = volume volume=0.5 ! alsasink device=hw:0,0

However, be aware that when you apply that much attenuation in the digital domain your losing a lot of resolution (audio bits), so sound quality will suffer.

I couldn’t get softvol running. volume less than 1 would be no problem, since I have my own GUI and can map any value I want. So if it would be possible on your side, I’d still be willing to try it out.

This had the desired effect. Thanks a lot!
Of course it would be nicer to not loose any resolution. So I’d still prefer to set a volume < 1.

The way Mopidy implements the volume control in Gstreamer will always lead to a loss of digital resolution. I’m working on an a branch that follows another approach and supports volume control in 32 bits floating point and high defenition sample rates. Kind of a high end audio Mopidy output version. I’ll create a separate topic to discuss this.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.