If you take Ubuntu Brainstorm’s word for it, one of the more popular wishes for Ubuntu, is to avoid having to adjust the volume slider up and down as you plug and unplug your headphones, but instead keep separate volumes stored for both.
Long story short, it’s a desirable feature, and we’re moving in that direction, but slowly, as the feature is more complex than it seems like at first glance.
The good news: in the upcoming Ubuntu Oneiric (11.10), this is actually working. The bad news: it isn’t working for everyone.
For external stuff, mainly USB and Bluetooth devices, this has been working for a quite a few releases now (although you might have to manually switch to your new card when you plug it in). So let’s restrict the discussion to internal sound cards, that on a typical laptop would control your internal speaker and your 3.5mm headphone jack. Here’s where Oneiric will make a positive difference for many of you (although, still far from all of you).
PulseAudio has the concept of “ports” (in your Gnome “Sound settings”, this is what’s labeled a “Connector”), and headphones and speakers would be different ports of the same card. As of Oneiric, every port has its volume stored independently, so when you switch ports, the volume will automatically change.
Now, this does not become really useful until this port can automatically switch back and forth when you plug and unplug your headphones. This feature is also now implemented in Oneiric, as you can read about in my previous blog post, PulseAudio with jack detection.
Things are not always that easy. Not everyone has just internal speakers and headphones, some have line outs instead, or all three. On the input side, some have internal mics, microphone jacks (often more than one), line ins, or any combination of those. In addition, people are different: some want headphones to automatically mute line outs, others don’t. That’s a typical case where different drivers expose very different behaviour: some do, some don’t, some have a setting you can control in alsamixer. Some drivers enable the user to have different volumes for different outputs, others don’t. Drivers label volume controls and jacks differently. Not every driver actually exposes the current jack sense state to userspace, either.
The bottom line: Is this working for you? Great! Is it not? You’re not alone. I’ll try to fix some of that up for Ubuntu 12.04, but there will – no doubt – be users who won’t have this functionality for a long time. At this point, the best you can do is to file a bug using the “ubuntu-bug audio” command, and hope for the best. Even if it might be too late for your hardware to be supported in 11.10, filing the bug sooner rather than later might help to get it into 12.04. However, manpower is always an issue, so even better would be if you could write a kernel patch yourself to fix it.
Works for me on HP Envy 14. Thanks!
I got used to Ubuntu having one volume for everything, then I ran into a website that “required Windows” and it wasn’t fooled by useragent spoofing so I ..obtained.. Windows 7.
It keeps separate volume for speakers and headphones. Drives me *nuts*.
Am I mistaken saying this can already be done with alsa ?
Well, it depends. Most ALSA drivers support independent headphone and speaker volume. So on a system with ALSA and without PulseAudio, this would probably work (again, for most people, not all).
In fairness: PulseAudio adds another layer of functionality, abstraction and complexity. E g the ability to have your media keys on your keyboard to control your headphones when those are plugged in, and your speakers when they are unplugged (typically). That’s the stuff we want to work as well (and that isn’t possible with just ALSA).
This is the first I’ve heard of ubuntu-bug. Any chance that “reportbug” could get fixed to work on Ubuntu?
I don’t know, maybe asking that question in The Ubuntu devel-discuss mailinglist will yield better results?
Pingback: Colin Watson: Top ideas on Ubuntu Brainstorm (August 2011) | Ubuntu Forms
I have been trying to make jack sense work on Ubuntu Oneiric for weeks on a ASUS m4A89GTD PRO/USB3 Motherboard (ALC892 Audio) with no luck. Used a newer kernel, compiles a more recent alsa, took advice from pulseaudio people to change ports settings for analog-headphone analog-headphone2 files, etc. I just got here and to your other post (http://voices.canonical.com/david.henningsson/2011/09/06/pulseaudio-with-jack-detection/) while looking for a solution. I really hope it gets integrated in a more “automagic” way into Ubuntu, via PulseAudio. So far I am clueless as to any possible workaround.
Most Realteks (as of 3.0 as well as the latest upstream ALSA) has support for headphone jacks, but not much more. Could you, if not already done so, file a bug with “ubuntu-bug audio”, then point me to it and I’ll have a deeper look when time permits?
Also, when upgrading ALSA drivers, make sure you follow the instructions here and nowhere else – there are plenty of guides around the net, which often come without proper uninstallation instructions and in some cases can screw up your sound stack a lot.
Hi David, I really appreciate your interest. I have done as you asked. The bug report is at https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/871582 .
I have two of this motherboards (exactly equal systems) running Ubuntu Oneiric. So if you want me to test stuff, or if you ever need more info, please just ask.
Ihave verified that ALC892 is being used in new Bulldozer-ready motherboards and Intel i7 (extreme desktop) from MSI, ASUS, Gigabyte, Asrock. It may become a popular chip soon.
Thank you so much for the link to the guide too: I can easily spot differences from many previous ones I’ve followed.
Kind regards,
Effenberg
David, I just wanted to say THANK YOU for your work on this! I’ve been wishing for this feature since I started using Ubuntu on 10.04, and it’s working for me now in 11.10! (On a System76 Starling.) It’s a credit to the subtle elegance of this idea that I didn’t notice it until I happened to plug in my headphones with the sound menu open today, and then it dawned on me that I haven’t had my ears blown out by headphones since I upgraded! =D
Thanks again!
You’re welcome! And to give proper credit, while I’ve personally been a driver for the jack detection stuff, the patch to actually enable per-port volumes came from upstream.
Doesn’t work on my Lenovo x220 i3 with DisplayPort to HDMI cable. I have to switch the output source manually.. Is this expected behaviour? Any fixes?
Good question. It is difficult to know without knowing more about your hardware.