Just Another Security/Programming Blog: January 2015

Sunday, 11 January 2015

Incorrect volume in PulseAudio indicator, with fix.

I was encountering a strange bug with PulseAudio, and the indicator/applet that is used to change the volume on my laptop.

I'm using external, Bose Companion 5 speakers, in Ubuntu, with PulseAudio through ALSA.

When I used the speakers, the audio would only come out of them if the pulseaudio("Sound Settings") indicator/applet was set to >90%. That is when audio began to work.

Strangely, it wasn't that it wasn't loud enough, it was because it just wouldn't actually start increasing the real volume.
91% volume in PulseAudio was 11%, 92% was 22%, etc. etc.

This was very irritating because I couldn't, through PulseAudio, choose to have the speakers at the volume, say, 7%.

`alsamixer' correctly set the speaker level, which is how I worked out that PuleAudio would be at around 91% for 10%, etc.

According to the helpful Raymond at bugs.freedesktop.org, "the USB audio only supports 6 channels, and has PCM playback volume control with a very small dB range, from -3.12dB to 0dB."

His recommendation was to add  " ignore_dB=1" to Pulse.

The way I did this, was add to it ~/.pulse/default.pa, since I had already set that file up when I set up my 'secure Ubuntu.'
If I hadn't set it up in ~/.pulse/default.pa, I would have to edit /etc/pulse/default.pa.

I found the line:
"load-module module-udev-detect" in default.pa and replaced it with
"load-module module-udev-detect ignore_dB=1"

And then restarted pulseaudio(`pulseaudio -k')

Likely, there is a way to set this "ignore_dB" option only for the external speakers, compared to the whole of PulseAudio. But the option doesn't seem the affect my internal speakers' usage.