Ask Slashdot: Stop PulseAudio From Changing Sound Settings?
New submitter cgdae writes Does anyone know how to stop PulseAudio/Pavucontrol from changing sound settings whenever there is a hardware change such as headphones being plugged in/out or docking/undocking my laptop ? I recently had to install PulseAudio on my Debian system because the Linux version of Skype started to require it. Ever since, whenever i dock/undock or use/stop using headphones, all sound disappears, and i have to go to Pavucontrol and make random changes to its 'Output Devices' or 'Speakers' or 'Headphones' tab, or mute/unmute things, or drag a volume slider which has inexplicably moved to nearly zero, until sound magically comes back again. I've tried creating empty PulseAudio config files in my home directory, and/or disabling the loading of various PulseAudio modules in /etc/pulse/*.conf, but i cannot stop PulseAudio from messing things up whenever there's a hardware change. It's really frustrating that something like PulseAudio doesn't have an easy-to-find way of preventing it from trying (and failing) to be clever.
[In case it's relevant, my system is a Lenovo X220 laptop, with Debian jessie, kernel 3.14-2-amd64. I run fvwm with an ancient config.]
[In case it's relevant, my system is a Lenovo X220 laptop, with Debian jessie, kernel 3.14-2-amd64. I run fvwm with an ancient config.]
Sounds more like a question for a support forum than for slashdot,...
This is an obvious troll, but not from the OP. This is a troll by the editor, Timothy, to encourage discussion of the PulseAudio author, Lennart Poettering, and systemd.
$ pulseaudio --kill
There, that ought to do it.
Its just returning to the last master volume setting you had when the headphones were plugged in. You should be seeing Master change between two values when you switch, just adjust that of you want to change it. Every other OS does this as well.
If you aren't seeing that intended behavior then go report it to Debian not Slashdot.
It's a pretty good example of the half assed work. Seems a reasonable place to start.
X201 same issue.
PDNFTT. ...and to the OP: try posting in the correct forum. Hint: it isn't Slashdot.
Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
Damn right it did!
Right after you moved the jumper to change the address because of a conflict with your printer, moved the jumper to change the IRQ because of a conflict with your modem and moved the jumper to change the DMA because of a conflict with your HDD controller.
Get free satoshi (Bitcoin) and Dogecoins
Disclaimer: I wrote plenty of open source audio apps for linux, even worked with professional audio hardware with embedded linux.
Pulseaudio is just another victim of the attitude from the linux kernel developers of kicking a problem to userland when they should really be solving it.
Userspace audio mixers are OK for many applications, such as a video player, desktop sounds, listening to mp3s, etc. as long as such applications don't need low latency. If you need videogames, pro-audio stuff, or even real-time video editing you need low latency and here is the problem happens. You need somehow a way to ensure that the low latency audio thread gets notification quickly and gets priority in the scheduler (because the buffers are small), while the regular latency audio just needs to accumulate more data into buffers.
But the problem is, that you have only one DAC, and different streams might request different configuration parameters, such as bit depth, sampling rate, channels, etc. In any serious OS, the kernel will open a stream with the maximum settings for real-time, and will ensure it gets the needed attention, while it mixes and resamples the audio that comes from the regular OS sound buffers over it. Linux kernel developers are against this, and the justification is that resampling should not happen in the kernel. As a result, asks user space to solve the problem. Pulseaudio is an attempt to solve that problem, and does what the kernel should be doing in userspace, but unfortunately it just doesn't work very well. Linux is not a "real time" OS and scheduling can still fuck you your user-space audio.
Back in the day, OSS handled this perfectly, but when it was replaced by ALSA (an extremely bloated and over-designed API and driver architecture) hell began, so please don't blame PulseAudio for this, this is purely the fault of kernel developers.
I think the PA gui control programs are the biggest issue, Pavucontrol and the other tools are just utterly confusing and obtuse. Typical developer designed UI paradigm, make a widget for each configuration parameter instead of thinking through the use cases and constructing some abstractions that make sense to the user and not the developer. Once the configuration is properly presented and a task-oriented UI is constructed around that I don't think PA will give people so many issues. There are a lot of neat things you CAN do with it, IF you can figure out how. Its just that no mortal human (myself included) can make heads nor tails of the frikking thing.
"Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
To those commenters saying "don't use Skype": Skype is a proprietary protocol that can only interact with other Skype users, and Skype is very popular and so hard to avoid. I was once offered a remote interview on Skype, only to fail because I have no Windows and Skype for Linux was a piece of crap multiple major versions behind (yeah, with a week more to play I might have gotten it to half-way work with Wine, but who cares?).
To those saying "kill pulse": that's not an option when software depends on pulse (rather than, say, offering it as an option, which still may require that it be present for the dynamic libraries). https://github.com/i-rinat/apulse seems to eliminate pulse audio and still allow apps linking to it to work. I've not tested it with Skype, nor have I checked if there is a Debian package for it that can be used as a drop-in substitute (I use Gentoo, and that's where I found it).
This is *not* news for nerds, or stuff that matters. Take this question to a tech forum. Get it off the damn news site.
Timothy, what has gotten into you? You're making this site suck more and more every day.
Please stop.
Yeah, but the fact that you have to mess with and configure each component individually and manage all the dependencies yourself means you know what is going on rather than have some magic uber-daemon figure out what it thinks you want and then do something, but you have no idea what it actually did when it goes wrong.
[or is that systemd, i forget...]
Since when is this TechSupportDot?
Have some hot grits down your pants.
I dislike that pulseaudio doesn't set its volume at what was the last value, when I boot and autologin to my desktop. The sound control applet (or is it a tray icon) does remember, but it registers after twiddling it up or down.
As I use an amplifier at 100% volume and Alsamixer is set at -2dB that result in very loud sound coming from the music player or video player etc. if I forget about it. Fortunately the amp is low powered and 2x12 watts so I guess the sound comes out at around 100 decibels only. Would be fun to try a dB meter to know exactly
You're right, at least we knew what was going on. It also meant that computer users were at least semi-knowledgeable about how computers work.
Today, they don't even know the difference between RAM and storage. And in ten years, I guess they won't even know the difference between local storage and online storage.
Get free satoshi (Bitcoin) and Dogecoins
Users want skype - but not the pulseaudiuo that skype now requires. The long term solution is to get skype developers to drop the unnecessary pulseaudio.
The solution that works today:
1. Set up jack & ALSA to create a virtual soundcard that is sw-mixed into your real soundcard. Not "easy", but doable. Talk to jack experts on various linux audio forums - they sometimes do this sort of stuff for other reasons.
2. Set up pulseaudio to (mis)manage the virtual soundcard - not the real one. Not that hard, pulseaudio is not confused by a machine that has several soundcards. The fact that the other is "fake" is of no consequence.
After this, skype sound will be routed through pulseaudio and into alsa - and from there to jack and the real soundcard. If pulseaudio messes up anything, only skype will be affected. The rest of your system will run without pulseaudio interference.
A few posts down, there is a suggested fix. It seems this is a known bug.
libreoffice.org/bugzilla/show_bug.cgi?id=59217
I was a tepid Ubuntu user between Edgy and Hoary. Eventually I got bored with spending days fixing PulseAudio settings after every 6 month upgrade and went back to Windows. A couple of years ago I hopped back on the Linux bus (via Mint Maya Mate).
Touch wood, PulseAudio is now as invisible as it always should have been. It still imposes restrictions on things it shouldn't touch (want your home directory on an NTFS partition? Tough), but it no longer falls flat on its face over the most basic part of its duties (just play the f**king sound damnit).
I hope systemd matures more quickly.
P.S. Not pointing fingers, but Palimpsest also sucked last time I was obliged to use it.
Entirely unrelated - are you using the 8188ce wifi card in this? Or did you switch to the Intel card? I find wifi on my x220 will continually die and need to toggle the radio switch to restart it.
And if you throw buetooth speakers into the mix it turns into a complete nightmare that only a reboot can fix. Sometimes.
Non-Linux Penguins ?
Use mumble for voice chat. Its free and its not spyware.
Its only major fault was that it was one-process-at-a-time but that would have - IMO - been pretty easy to fix. But instead they came up with the non portable (to other versions of unix) dogs dinner called ALSA. Christ, trying to program with that API is like trying to cycle with your legs tied around your head. It works - just - but it could have been made a LOT simpler.
Personally I think X windows should manage sounds as well as video allowing networked sound apps and there should be just a single sound API across all versions of unix.
You are looking for padevchooser I guess
This is a bug which was fixed back in January: http://mailman.alsa-project.org/pipermail/alsa-devel/2014-January/071156.html
This has absolutely nothing to do with pulseaudio by the way, since the volumes are set by alsa and udev. It is still Lennart's fault though, because he wrote the udev support patch for alsa, and then didn't update it when udev rule syntax was changed.
I ran into that same problem with Skype's latest release. Rather than giving Pulse a fourth chance to burn me, I decided it might be time to give WebRTC a try.
I'm so glad I did. OS-independent browser-to-browser video chat worked fine. I used Chromium on linux while my friend used Chrome on OSX. The latest Firefox release supposedly supports h.264, so it might work as well. Here are a couple of call set-up sites in case you'd like to try it for yourself:
https://opentokrtc.com/
https://vline.com/
Very interesting that you note sound devices being a userspace issue, when it really has to do with hardware, device, kernel drivers etc. Sure.. USB brings this devices to userland as well, but if its handled properly in kernel land, hooks could provide some control into Userland. I used to compile (2.4) kernels and work in bttv, tda, emu10k and so for TV and sound cards and it just worked (a lot of it, but it was predictable!). Then I stopped compiling my own kernels and tried to do it in /etc/modprobe.conf, but that got crazy between kernel updates and Pulse and Alsa and OSS getting all blurry. So much for history. Where are we now, years later? Does a lInux desktop user have to dabble in /etc/modprobe.conf ? Doesnt make much sense to me. From working with Udev under RH6 at work, udev is working predictably with ethernet devices, seems a valid model. How about we start with a soundconfig utility that captures a systems setup at that moment, and spits out a consistent lattice work of device configurations. Users dont care about /dev/dsp01, or incomplete mixer apps, we just want sound to work.
Time for a new Political party in the US (or two!) One is off the rails Other cant pony up a leader.
Since exactly when is Skype FOSS?
Yes, but not in a very graceful fashion. The one I use on occasoion is ippi.com as a SIP provider. You can Google the proceedure to use the Skype/SIP gateway.
In a nutshell, the gateway is like dialing 9 on a PBX and outside callers needing to use an automated attendant to reach an extension, so you need to educate your Skype contacts on how to use it.
The cumbersome interface uses a Skype proxy for outgoing calls where the caller is ippi.com as the caller, and to call in from Skype, you add the poxy as a contact, then when connecting to the proxy, the caller is sent a text that needs to be replyed to with the "SIP extension" you are calling, so it does not support Skype directly. The caller needs two pieces of information to contact you, the Skype to ippi friend, then your sip user ID. For example if I used my slashdot handle, which I don't, my SIP address would be sip:technician@ippi.fr. The Skype caller would need to call the gateway Skype2ippi and then respond to the automated text and enter technician to ring my SIP phone.
Outgoing calls are simpler. I enter the full gateway/skype string into the speed dial settings on IPPI, so to call one of my friends, I just pick up the phone and speed dial them. IPPI speed dialer uses 2 digit speed dialing so you can save 99 contacts.
This works great with either a SIP softphone, or a hardware device such as an ATA and analog phone or an IP phone such as one of the Grandstream models.
The service does not provide video, only an audio connection.
The truth shall set you free!
There is and always was ALSA
You mean OSS?
If only politics hadn't fragmented the Linux sound ecosystem, we probably wouldn't have to deal with such a clusterfsck. Then again, there's always BSD...
Crimey
sudo apt-get remove pulseaudio
It'll never touch your settings again!
Also, it's incredibly poorly designed, and they won't take patches that fix things.
This is a known bug that has already been fixed. You should complain to whoever maintains the Debian package to include the patch.
PulseAudio is a piece of crap. Uninstall it, uninstall Skype, and use something else like Ekiga. Don't let a minor pissant program like Skype pull in the SystemD of audio.
vi ~/.emacs # I'm probably going to Hell for this.
This sounds like an interrupt conflict. If the USB device and audio device share the interrupt and (because of hardware misconfiguratin) pluging in/out of usb causes sound device's interrupt handler to run, it could be reading garbage data and using it as the new config settings.
Any guest worker system is indistinguishable from indentured servitude.
I wonder if your laptop is one of those that makes the sound system disappear when there is nothing plugged into the jacks. Seems like that would make it hard for pulseaudio to keep its senses.
put an adaptor in your audio jack that will stop the computer from knowing there are headphones being plugged in and out. Problem solved.
Thank you for demonstrating why using something other than Skype itself is not a feasible solution for the average user.
It is dangerous to be right when the government is wrong.
Though you're an AC, I reply because this is about the closest what I can find in this discussion and what I also experience. In my case on kubuntu. So far everyone has shifted the responsibility to everyone else. Slowly I am getting sick of FOSS, though I have used it happily for close to 20 years.
Alas, also me getting old, and the youngsters don't always follow the philosophy of the old days. So we have to endure the modern types as well, the Lennart Ps, Christoph Fs, Vishesh Hs, etc., for whom the FOSS-thing is closer to an ego trip than a community effort.
Though back to the topic: I run kubuntu almost exclusively on a number of boxes, 32-bit, 64-bit, always updated. And for the last years, none has ever been willing to store my audio settings; except of the volume.
One DELL-box has seen me setting the output to 'headphone' some 50 times, after each reboot. Another self-assembled box (MSI) with internal audio and extra sound card comes back on the internal sound card after each reboot, and graciously accepts me setting it to the extra sound card; only to revert to the built-in device after the next reboot. And, yes, I have saved the settings close to one hundred times by now. Then I stopped, giving up, and start by setting the audio system to use the add-on sound card.
In the old days the distros could know much better what angle they were responsible for; and what was upstream. With the more recent smudge-over of functionality (against the UNIX philosophy of small, modular, distributed) it is also more difficult for them to locate the trouble. And so more recent bug reports on kubuntu are returned with 'report to KDE', and from there 'report to [application]'.
Sad, just sad, very sad.
Set up pulse audio the way you like it using pavucontrol.
Use "pacmd dump" to find the proper commands to do what you want.
Use pacmd with the selected comands at startup or add the selected commands to /etc/pulse/default.pa.
Or you can just put the full configuration you dumped to your ~/.config/pulse/default.pa:
pacmd dump > ~/.config/pulse/default.pa
There is a good chance this helps you.
The only programs that I have encountered that don't work well with alsa without the need for a sound system on top of alsa are the ones with project leads that purposefully don't follow ALSA documentation.
I apologize for my lack of comprehension, and I am not trying to be a grammar Nazi, but I have a great deal of difficulty underdstanding this statement. I really did try; even to the point of doing tree graphs and venn diagrams of the sentence.
What I get is: Projects with leads who don't follow ALSA documentation are projects which don't need additional sound systems, and yet still don't work well with ALSA. (therefore maybe they DO need an additional sound system?)
or
The programs which don't work well with ALSA are the ones which don't have a sound systems on top, because the leads aren't following documentation.
Either way, I get that one needs to follow documentation and put a sound system on top. Is that what you intended?
or did you want to say that if you follow ALSA documentation, extra layers will not be required? (From context I expect the latter, but I can't get my brain to graph it that way.)
McFly777
- - -
"What do people mean when they say the computer went down on them?" -Marilyn Pittman