Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running ubuntu 13.10, but I first saw this on 13.04. Whenever my headset connects to my computer, the audio gets set for "Telephony Duplex" instead of "High Fidelity Playback". Additionally, the volume gets set to maximum, and the volume control on my screen continues to be for my laptop speaker volume instead of for the headset (which is where the music is usually now going).

This a mere annoyance if I'm just getting set up, but if I walk out of range and then back into range I can get maximum volume pummeling into my ears.

So, how do I make Ubuntu remember the volume setting across connects and disconnects?


share|improve this question
    
There may be an issue with your pulseaudio default.pa settings. Volume, and port should both be stored. Try if renaming ~/.config/pulse/ resolves the issue. If not consider posting a link to a paste of your /etc/pulse/default.pa, or to a paste of the output of pacmd list to better see what may be wrong here. –  Takkat Dec 28 '13 at 17:05
    
I moved my .config/pulse out of the way, and there was no change. I've pasted both pacmd list and default.pa, with no expiration, but both of those are huge. Is there a particular area for me to take a look at? –  Savanni D'Gerinel Dec 28 '13 at 21:28
    
Thank your for the pastes. From what I can see these are fine. They should restore Bluetooth device settings to previous volume or profile, at least this is what happens on my test system. My answer below gives you some background on how to further debug this. I suspect some application interfering. –  Takkat Dec 29 '13 at 11:56

1 Answer 1

Modules responsible for storing device settings

In a default pulseaudio setup the following modules are loaded to restore device settings, and volume settings changed by the user at runtime:

  • module-device-restore:
    restores the volume of an audio device to previous values.
  • module-card-restore:
    restores audio card settings (for a headset this will be A2DP or HSP/HFP mode).

Both modules (amongst many others) will be loaded from settings in /etc/pulse/default.pa. If we had made a custom default.pa in ~/.pulse/ these custom setting will override the defaults in /etc/pulse/.

Make sure that both module are loaded when starting pulseaudio. To see which modules are in operation we may issue:

pacmd list-modules

In case they are misssing we need to add them to our default.pa with the following lines:

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

Values for a given device will then be stored in a database located in ~/.config/pulse/ or ~/.pulse/, depending on release version.

Remove the pulseaudio database after settings were bad

In case of erroneous setting we can remove all entries to this database by renaming or deleting these directories. Changes will only take effect after restarting pulsaudio (the configuration directories will then be re-created with default values) with:

pulseaudio -k

Then any audio application will use the custom user settings after switching output sinks. To automatically switch between internal audio and a Bluetooth audio device we can add the following module to our default.pa or as command for pactl on the command line:

load-module module-switch-on-connect

Applications can override this

In case an application had defined it's own audio setting (this can also be done while playing audio with pavucontrol Install pavucontrol) these settings will override the default settings we had made.

In case our volume or card settings are not restored as expected we therefore need to remoe those application based settings. We can do so by changing the output device properties in pavucontrol, or again by removing settings which should be stored in ~/.pulse, or ~./.config/pulse with deleting these directories.

If all this does not help we may be faced with an application storing defaults in a different directory, or not respecting the pulseaudio settings (which then could both be considered as a bug).

share|improve this answer
    
I was wanting to try all of this out, and suddenly the bluetooth adapter on my machine stopped being able to detect anything at all. I know that's incorrect, though, because I have multiple working devices all in pairing mode, and all devices are still able to pair with my tablets. :| –  Savanni D'Gerinel Dec 29 '13 at 17:22
    
Its a pain, I know. You may have to remove the device from the known devices (-), then add it again (+) to repeat the pairing. –  Takkat Dec 29 '13 at 19:39
    
@Takkat On 14.04 this doesn't work. Those modules are automatically loaded (from /etc/pulse/default.pa) when I check with pacmd list-modules. If I reboot or turn off the device & turn it back on, volume always gets set to 100%. It doesn't happen for internal-audio (pa remembers volume setting for internal audio). I think this(100%) is the default volume for any Bluetooth device. Any way to change the default volume to a lower value? –  Khurshid Alam Nov 17 at 9:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.