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.]
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.
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.
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).
... the way systemd has turned into something similar to the bloated beast that is the Windows 'svchost.exe' ...
+1 to the anti-systemd sentiment.
-1 to using svchost.exe to make your case. svchost is just a container process. The real issue is the Windows architecture/philosophy that encourages a proliferation of services.
(I like Unix and I like Windows. Each has their place. Trying to turn one into the other is a big mistake.)
The key sequence to access my Slashdot bookmark in Firefox is Alt-B-S. I don't believe this is a coincidence.
Apologies if people think i shouldn't have posted this question to slashdot. I did a fair amount of googling to try to figure things out, to no avail. I didn't know whether my sound problems were caused by Debian or PulseAudio, so i figured Slashdot would cover both bases.
Aside from wanting to find a fix for my audio problems, i think the issue of Skype requiring a particular sound library is worthy of discussion on slashdot, as it the general UI issue of whether 'clever' behaviour should be easy to disable.
Oh, and i'm most definitely not a Microsoft troll, e.g. my day job involves working on some fairly hard-core linux debugging software.
http://op59.net/
You don't even have to stop using Skype. You only have to:
1) Not decide to blame PulseAudio even before you know what is wrong
2) Open the Skype settings
3) Turn off the correctly named default setting "automatically adjust mixer levels."
For most people, who aren't part of some sort of hateful social movement focused on attacking one man for having a good job, that is actually only a 2 step process. But even neckbeards should be able to manage it with the extra step.
I usually start by deinstalling pulseaudio. Fixes the problems every time.
Skype has actually gotten considerably worse since MS bought it.
-- Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."
I believe your solution to the OP's problem may be correct. good work.
> focused on attacking one man for having a good job,
no, people are attacking the guy for 1) messing up their stuff, 2) generally acting like a cunt, and 3) bringing manipulative poison politics into what was prevoiusly a meritocracy oasis.
> But even neckbeards should be able to
seriously, fuck you you fucking hypocrite.
Most people who care at all about audio kill off PA. ALSA handles it much better by itself. I killed off PA when I got tired of having all video I watched look like the dubbed martial arts movies where the lips and the audio have nothing to do with each other.
You might be surprised to learn that many people don't install PA at all and things work just fine.
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!
Agreed. PulseAudio was great when ALSA didn't exist, but since ALSA provides 99% of the same functionality, having it replicated like this is insane. Sadly a number of companies producing non-open programs for Linux rely on PulseAudio, so removing it completely is currently impossible.
Except you're completely wrong. This is a known bug in ALSA which has been fixed upstream but is still present in Debian stable.
This is the patch which introduced the bug:
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=de7c3eff0e371ce155403bbcdcf81ee79266fa0f (note author lol)
And this is the patch that fixed it:
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=ef0e588c76fbad4112193d311e51a60d18b44282
"Pulseaudio was a royal PITA until about 5 years ago. By then the kinks have been worked out and it works rather well."
Nope, still fails for me on a modern dual-core 64-bit system.
" The only thing worse than Pulseadudio was the cruft that it replaced."
Not even close. OSS worked more reliably and still does.
" People who still complain about it either have very weird hardware or run old systems and just like to complain about old things..."
2012 laptop. 1.6GHz 64-bit dual core, 8GB RAM, 6-channel surround through optical, typical RealTek. Not even close to weird or old.
I've been using Linux since 1998. PulseAudio is a piece of shit, period. I can't even unplug my headphones without having to reset three volume/audio options to make my speakers output.
Pulseaudio can't even do ASIO properly. It's a broken piece of crap.
Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
This is a known bug that has already been fixed. You should complain to whoever maintains the Debian package to include the patch.
>PulseAudio was great when ALSA didn't exist,
ALSA not only existed, but was the standard in Linux for years before PA (then PolypAudio) was created.
ALSA - 1998
ALSA as default - 2003 (2.6.0)
PA 0.9 - 2006
PA default in Ubuntu - 2008
Climate Progress - Hell and High Water
Skype on Android has this nasty "bug" (although people might be tempted to call it a feature): you can't really close it. Believe me, I have tried. I have all but given up on it. Even if you have all the notifications for it disabled and forcibly stop it, it will respawn automatically within a show period of time. Were it not for the fact that I need it for work, I would not allow an app like that to even be installed on my cellphone or my tablet.
With regard to systemd: if the only choices you have are broken ones, you don't really have a choice now, do you? On the one hand you have systemd, which is bloated beyond repair. On the other hand you have all those software packages that won't run otherwise because they depend on it.
DOES THAT SOUND FAMILIAR TO ANYONE AT ALL?
And on the Eighth Day, Man created God.
I have no idea where you got the idea that pulseaudio is considered best of breed.
By all the distros using it. The proof, right there in the pudding.
Before PulseAudio, linux audio sucked. Everything else was generic and networked, but audio sucked hard. Even just having multiple audio devices on a single computer was painful. Workarounds typically required an app to be restarted to switch audio devices, mostly because of deficiencies in the APIs.
With PulseAudio that was fixed, audio is a normal citizen, generic, with both a modern API and backwards compatibility. Now those same old apps, unaltered, can be moved between audio devices transparently, with no restart. Plus, networked audio is vastly more capable, able to use standard APIs instead of having to live totally outside of the normal sound ecosystem.
Were there early bugs in implementation? Yes. But that isn't PulseAudio's fault, that is the distros fault. They probably should have waited another year before doing the changeover. People are still hating on PA because of early bugs that were fixed years ago. Haters hate, but they don't read or think, so once they're told it sucks, it sucks forever. But distros hire actual professionals to make these decisions, and even the ones that weren't using PA yet during those early bugs... are using it now. Why? Space-Alien mind-control beams? Or, it is better than the alternatives?
All that is also true for systemd, except with an extra helping of known lies and a doubling of personal attacks.