Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-05-21 12:26:19

thed
Member
Registered: 2019-05-21
Posts: 6

[SOLVED] pulseaudio volume slider not working with usb headphones

hello all.

i am utilizing a fresh install of debian (version 9.9) with xfce (version 4.12) on two different laptops (hp and ibm). the behaviour i'm about to describe below is identical on both laptops.

i have placed a shortcut to the PulseAudio Plugin on a desktop panel - which now displays the default 'speaker' icon on my panel.

i begin to play a sound (.mp3) or movie (.mp4) file on my laptop with no usb headphones attached.

as the file is being played, and sound is emanating from the built-in laptop speaker(s), i can left-click the pulseaudio plugin 'speaker' icon on my panel, and use the 'Audio output volume' slider of the pop-up dialog to adjust the volume of the sound.

it works. the volume can be altered (increased or decreased) via the pulseaudio plugin pop-up volume slider.

clicking the 'Mute audio output' checkbox mutes the sound.

good stuff.

furthermore, if i click on the 'Audio mixer...' text link from within the pop-up dialog that appears after left-clicking the pulseaudio panel 'speaker' icon, i am successfully taken to the default audio mixer (being pavucontrol), where i can also adjust the volume of the sound (via the volume slider on the 'Playback' tabsheet).

my problem is that the pulseaudio plugin pop-up 'Audio output volume' slider has no effect if i then plug my usb headphones into my laptop and play a file containing sound (e.g. .mp3, .mp4).

although sound is now emanating from my usb headphones, the pulseaudio volume slider referenced above has no effect.

i move that darn slider left and right, all the way from timbaktu to kalamazoo, but the volume remains unaltered.

at that moment, i can only change the volume using pavucontrol (after displaying it, for example, via the aforementioned text link on the pulseaudio plugin pop-up), or via some other application such as pasystray.

if i plug my usb headphones into my laptop and then restart the laptop, there is no change. although sound is heard through my usb headphones, volume control is identical as outlined above when the usb headphones were initially plugged into the laptop prior to the restart - the pulseaudio plugin pop-up volume slider fails to change the volume.

clicking the 'Mute audio output' checkbox mutes the sound when the usb headphones are plugged in.

it would be nice to have the default pulseaudio volume slider function when usb headphones are utilized, rather than having to go through pavucontrol, or pasystray, etc.

any advice would be greatly appreciated.

thanks.

.

Last edited by thed (2019-05-23 16:34:34)

Offline

#2 2019-05-21 20:59:30

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

Hi thed, and welcome. I think this will work for you:

echo "load-module module-switch-on-connect" | sudo tee -a /etc/pulse/default.pa

Offline

#3 2019-05-21 21:01:33

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

Oops, follow with:

pulseaudio -k

Offline

#4 2019-05-22 09:15:28

thed
Member
Registered: 2019-05-21
Posts: 6

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

many thanks MrEen.

your suggestion worked for me.

a minor point:

if my usb headphones remained plugged into the laptop while following your suggestion, then the pulseaudio plugin volume slider only worked with the usb headphones when either

i. the usb headphones were unplugged and then plugged back into the laptop

or

ii. the laptop/system was restarted/rebooted

following just a single restart/reboot of the laptop/system, however, the pulseaudio plugin volume slider then always worked with any number of subsequent usb headphone unplug/replug and/or laptop/system restart/reboot events.

might there be a (pulseaudio) parameter/directive that can be utilized to simulate and facilitate recognition of the event(s) enacted by i or ii above, via a currently-running daemon or process?

regards.

thed

.

Last edited by thed (2019-05-22 11:10:31)

Offline

#5 2019-05-22 11:22:22

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

If I'm understanding correctly, prior to rebooting the instructions I gave led to the plugin not affecting your speakers if the headphones were unplugged. If that's correct, I'd guess deleting the files in ~/.config/pulse prior to running pulseaudio -k may have been necessary. The pulseaudio -k command is restarting the daemon (for most, the daemon automatically restarts) which will generate a fresh set of config files if they're not present in ~/.config/pulse (and I'm assuming Debian is the same as Mint in this regard.)

An addition; often after restarting the daemon, sound playing applications also need to be restarted for the change to take effect properly.

I could have given you this command instead which wouldn't require pulseaudio -k, but it would be required after every reboot:

pactl load module module-switch-on-connect

Does that somewhat answer your question?

Offline

#6 2019-05-23 14:07:57

thed
Member
Registered: 2019-05-21
Posts: 6

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

thanks MrEen. excuse my lack of clarity.

i attempted to explain that if my usb headphones were plugged into my laptop while your suggestion was being implemented (modification of file /etc/pulse/default.pa followed by a call to pulseaudio -k) as shown below,

echo "load-module module-switch-on-connect" | sudo tee -a /etc/pulse/default.pa
pulseaudio -k

then volume control (of the usb headphones) via the pulseaudio plugin volume slider continued not to work.

i found that after implementing your suggestion, either (i) unplugging and then replugging the usb headphones back into the laptop, or (ii) a system restart/reboot was necessary in order to have the pulseaudio plugin volume slider successfully alter the sound volume from the usb headphones. changes in the content of the files named (some-alphanumeric-string)-default-sink and (some-alphanumeric-string)-default-source (located at $HOME/.config/pulse) from

alsa_output.pci-0000_00_1b.0.analog-stereo

for the built-in speakers/microphone, to

alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.analog-stereo

for the usb headphones/microphone were also noted.

in any case, the solution you posited worked. thank you.

Last edited by thed (2019-05-25 08:37:07)

Offline

#7 2019-05-24 22:23:52

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

You're welcome, thed. And thanks for the clarification, I understand now.

I've just recently installed the plugin and haven't played with it a lot. It could be that at minimum a log out/in was required to update the plugin. I hadn't thought about that. The unplugging/replugging may have caused the plugin to refresh on the new detection.

Glad you're fixed.

Last edited by MrEen (2019-05-24 22:26:15)

Offline

#8 2019-05-25 03:15:45

thed
Member
Registered: 2019-05-21
Posts: 6

Re: [SOLVED] pulseaudio volume slider not working with usb headphones

good one.

Offline

Board footer

Powered by FluxBB