[pulseaudio-discuss] How to save mixer settings?

Frode Severin Hatlevik frodeseverin at gmail.com
Sat Sep 18 14:14:53 PDT 2010


2010/9/7 Richard Shaw <hobbes1069 at gmail.com>:
> On Mon, Sep 6, 2010 at 2:51 AM, Jan Kasprzak <kas at fi.muni.cz> wrote:
>>        Hello, world!\n
>>
>> On my laptop the "Front mic" input is routed to the speakers/headphones
>> after boot, causing unnecessary noise and sometimes even a feedback loop.
>> I can mute it using "amixer -D hw:0 set 'Front mic' mute", but it becomes
>> unmuted every time I suspend and resume the laptop, or every time I log in.
>>
>> Is it possible to save the mixer settings w/ pulse?

I have a similar problem with my Acer TravelMate 4670, running Debian
GNU/Linux Squeeze/testing.

My card identifies itself like this to the system:
$ uname -a
Linux <hostname> 2.6.32-5-686 #1 SMP Wed Aug 25 14:28:12 UTC 2010 i686 GNU/Linux
$ lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High
Definition Audio Controller (rev 02)

Pulse version is as follows:
$ pactl --version
pactl 0.9.21-rebootstrapped-dirty
Compiled with libpulse 0.9.21-rebootstrapped-dirty
Linked with libpulse 0.9.21-rebootstrapped-dirty

The card is set up with Alsa, and the modules loaded for sound is
included in the attached file 'sound_modules.txt'. I have also
attached /etc/asound.conf and /etc/asound.names (the latter is rather
lentgthy. I suppose this is due to the fact that I have plugged in and
removed several usb audio devices as time has passed...)

The soundcard has the ability to route the mic directly to the output,
i.e. when I run 'alsamixer -c0', the mic shows up both under the
'Playback' and 'Capture' categories. The 'Capture' category has the
option of using two input sources at the same time, naming them 'Input
Source' and 'Input Source 1'. I normally want 'Input source' to be the
microphone, and 'Input Source 1' to be 'Line'. This is a rather fancy
card for a laptop, is it not? ...

The problem manifests itself in that using PA with KDE messes tings
up. I tried with Gnome, and it seemed to work better. Note that Debian
GNU/Linux Squeeze/testing uses KDE 4.4.5. The KDE WiKi page states
that full support for PA in Phonon and KMix is available in KDE 4.5.
Perhaps I wil have to wait for that to propagate to 'testing', but I
might have to wait for a while; it is still not in 'sid'.

What happens is this:
After KDE loads the desktop, all the mixer levels seem to be reset to
factory default levels, which are not appropriate. The worst part is
that the mic in the 'Playback' category is unmuted and at a high
level, and hence constantly feeds all the nearby sound to the
speakers. If I turn the master volume up I easily get a feedback.

I tried tapping the mic to see when in the KDE loading sequence the
messup occurs, and it seems to be rather late, at least after the
desktop appears, but before KDE has finished loading all the tidbits.
I also tried with different backends for phonon; Xine and GStreamer
both produce the same results. I even tried to replace
start-pusleaudio-kde with start-pulseaudio-x11. Nothing changed.
Disabling the '-restore' modules in default.pa did not help either.

Please find attached the output from 'amixer -c0' before and after KDE loads.

What is going on here? The only way I managed to get mixer levels
properly set is by using 'alsamixer -c0' in an xterm, or running
'/usr/sbin/alsactl restore 0'. I have previously stored the wanted
settings by issuing '/usr/sbin/alsactl store 0'. Note that /usr/sbin
is not in my path, and that alsactl is world executable.

;)Frode
Frode Severin Hatlevik

-- 
Da sa Gud: "Det bli lys!"
Og det ble lys.
                      1. Mosebok 1.3

And God said, "Let there be light,"
and there was light.
                      Genesis 1:3, NIV
-------------- next part --------------
snd_hda_codec_realtek   163238  1 
snd_hda_intel          16787  2 
snd_hda_codec          46002  2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               4054  1 snd_hda_codec
snd_pcm_oss            28671  0 
snd_mixer_oss          10461  1 snd_pcm_oss
snd_pcm                47214  3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_midi            3576  0 
snd_rawmidi            12513  1 snd_seq_midi
snd_seq_midi_event      3684  1 snd_seq_midi
snd_seq                35463  2 snd_seq_midi,snd_seq_midi_event
snd_timer              12258  2 snd_pcm,snd_seq
snd_seq_device          3673  3 snd_seq_midi,snd_rawmidi,snd_seq
snd                    34363  15 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore               3450  1 snd
snd_page_alloc          5045  2 snd_hda_intel,snd_pcm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asound.conf
Type: application/octet-stream
Size: 124 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100918/9368d42f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asound.names
Type: application/octet-stream
Size: 3669 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100918/9368d42f/attachment-0001.obj>
-------------- next part --------------
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 13 [42%] [-27.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 205 [80%] [-10.00dB]
  Front Right: Playback 205 [80%] [-10.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 25 [81%] [-9.00dB] [on]
  Front Right: Playback 25 [81%] [-9.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 24 [77%] [1.50dB] [on]
  Front Right: Playback 24 [77%] [1.50dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-1.50dB] [off]
  Front Right: Playback 22 [71%] [-1.50dB] [off]
Simple mixer control 'Mic Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 2 [67%]
  Front Right: 2 [67%]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 21 [68%] [-3.00dB] [on]
  Front Right: Playback 21 [68%] [-3.00dB] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 25 [81%] [25.50dB] [on]
  Front Right: Capture 25 [81%] [25.50dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 25 [81%] [25.50dB] [off]
  Front Right: Capture 25 [81%] [25.50dB] [off]
Simple mixer control 'Digital',0
  Capabilities: cvolume penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 82 [68%] [11.00dB]
  Front Right: Capture 82 [68%] [11.00dB]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Line'
-------------- next part --------------
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 19 [61%] [-18.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 249 [98%] [-1.20dB]
  Front Right: Playback 249 [98%] [-1.20dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [0.00dB] [on]
  Front Right: Playback 31 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-1.50dB] [on]
  Front Right: Playback 22 [71%] [-1.50dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 22 [71%] [-1.50dB] [on]
  Front Right: Playback 22 [71%] [-1.50dB] [on]
Simple mixer control 'Mic Boost',0
  Capabilities: volume penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 2 [67%]
  Front Right: 2 [67%]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 21 [68%] [-3.00dB] [on]
  Front Right: Playback 21 [68%] [-3.00dB] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 26 [84%] [27.00dB] [on]
  Front Right: Capture 26 [84%] [27.00dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 21 [68%] [19.50dB] [off]
  Front Right: Capture 21 [68%] [19.50dB] [off]
Simple mixer control 'Digital',0
  Capabilities: cvolume penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 82 [68%] [11.00dB]
  Front Right: Capture 82 [68%] [11.00dB]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Mic'


More information about the pulseaudio-discuss mailing list