SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had a new pair of headphones in the post today, and they work fine on slackware without any fiddling.
However, i have to right click KMix and select the master channel as the USB device. I am wondering, is it possible to create a set up where the sound changes from speakers to headphones dynamically, as they are plugged in? I don't know the slightest thing about pulseaudio, other than it just seems to work with slackware-current since it's addition to the packages.
Example:
1. Playing music out of the speakers as normally.
2. Plug USB headphones in
3. Speakers become silent, and sound comes out of headphones.
At the moment, i have to manually switch the master channel using KMix. Is it possible to get this working??
PS; my speakers are using the standard audio output (they are not USB).
Also i have another problem, where i can't seem to get any sound from firefox (sites like soundcloud or youtube) when setting the master channel to the USB headphones. I do get music playback from DeadBeef media player though.
[24909.721495] usb 5-4: new full-speed USB device number 3 using ohci-pci
[24909.867788] usb 5-4: New USB device found, idVendor=0d8c, idProduct=0012
[24909.867796] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[24909.867800] usb 5-4: Product: USB Audio Device
[24909.867804] usb 5-4: Manufacturer: C-Media Electronics Inc.
[24909.875825] input: C-Media Electronics Inc. USB Audio Device as /devices/pci0000:00/0000:00:13.0/usb5/5-4/5-4:1.3/0003:0D8C:0012.0008/input/input25
[24909.926737] hid-generic 0003:0D8C:0012.0008: input,hidraw7: USB HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on usb-0000:00:13.0-4/input3
[24910.089125] usbcore: registered new interface driver snd-usb-audio
Edit: The only workaround i've had for this is running pavucontrol and clicking the green button to set the USB headphones as fallback. But it feels awkward as when i unplug the headphones i have to do both of these things to get speaker playback again:
1. Open pavucontrol and set speakers as fallback output device
2. Right click KMix and set speakers as master channel
I have also tried adding
Code:
load-module module-switch-on-connect
to /etc/pulse/default.pa
which after searching online, apparently should enable headphone/speaker toggling, although it has no effect here.
You can try to set a udev rule, then point it to a script. Below are two links that may get you closer to your goal. It looks as though you might have to restart pulseaudio, since apparently applications already playing sound will not switch to new output. Possibly get the script to restart pulseaudio?
Is rc.pulseaudio executable or not?
If it's executable it won't work since pulseaudio is then started with --disallow-module-loading
Not currently, but i'll try that now and reboot and see if it works.
Edit; just tried this, but the headphones don't appear (both speaker and microphone) as neither input or output devices with pavucontrol. The moment i ran /etc/rc.d/rc.pulseaudio stop the USB devices appeared and worked again when manually switching the master channel with KMix.
Every time I switch from speakers to headphones, I have to start pavucontrol to change configuration settings for built-in audio just to get sound back. That's pulseaudio, it makes more problems than it solves.
Every time I switch from speakers to headphones, I have to start pavucontrol to change configuration settings for built-in audio just to get sound back. That's pulseaudio, it makes more problems than it solves.
The thing is that /etc/rc.d/rc.pulseaudio shouldn't be executable (unless one really needs it which is very rare).
"chmod -x /etc/rc.d/rc.pulseaudio" and reboot is the best since stopping the script may not be enough.
If it's executable then it behaves as you described since i doesn't load any modules.
But i will agree to that "it makes more problems than it solves."
Last edited by Nille_kungen; 05-03-2016 at 08:55 AM.
The thing is that /etc/rc.d/rc.pulseaudio shouldn't be executable (unless one really needs it which is very rare).
"chmod -x /etc/rc.d/rc.pulseaudio" and reboot is the best since stopping the script may not be enough.
If it's executable then it behaves as you described since i doesn't load any modules.
But i will agree to that "it makes more problems than it solves."
I tried with chmod -x /etc/rc.d/rc.pulseaudio, but there was no change. Anyway, thanks for a suggestion.
I think I'm going to completely remove that piece of crap from my system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.