This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to retain audio settings in KDE

Tags: None
(comma "," separated)
jlinkels
Registered Member
Posts
31
Karma
0
OS

How to retain audio settings in KDE

Mon Apr 11, 2011 4:09 pm
This computer runs KDE4.4, Debian Squeeze, used by my wife who is a complete computer illiterate. Sound is provided by a HDA Intel card with controller with Realtec ALC888 chip. The C200 webcam is connected but not use for sound.

When she starts the computer, she is not able to use Skype: the sound is not captured. She is barely able to find KMixer, but when she does, there are 2 input controls shown:
- Internal Audio Analog Stereo
- Logitech C200 Analog Mono
Nothing more, no controls, no flags, no way to add any more controls, not even through settings or whatever.

Anyway, when I open alsamixer, not less than 6 capture controls are available:
- Front Mic Boost (level)
- Mic Boost (level)
- Capture (flag + level)
- Capture 1 (flag + level)
- Input Source (enumeration, line, mic, front mic)
- Input Source 1 (enumeration, line, mic, front mic)
Mind you, this is only for the HDA Intel device not even for de C200 webcam.

Certain combinations of flags and levels make sound appear in Skype. There are about 36 possible combinations of flags where most do not produce the desired result.

As said, the settings get lost at reboot and my wife can use KMix but there is no way she can start alsamixer, let alone select the correct settings. I did alsactl store, but either the settings are not stored, or overwritten by KDE at KDE startup.

So the questions:
- Is there a way to make KMix simply show the controls for the devices which are available? I hope once the controls are set from this interface they are restored at the next boot. Frankly I don't see why KDE is not able to manage and restore audio settings.
- Is there a way to store the alsamixer settings and have them restored at the next boot, without some stupid KDE application with settings not reachable in the GUI put the controls back in a state which is undesired?

I feel that when push comes to shove, I have to write a startup script which let amixer set all the controls settings correctly after my wife has logged in into KDE. But this is quite stupid, isn't it?

jlinkels
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS
You are using pulseaudio. When pulseaudio is enabled, it takes precedence over alsa. The controls you see are for pulseaudio. I had some problems with combinations of earlier versions of pulseaudio and kmix not remembering some settings.

To fix the problem, try installing pavucontrol, then launching that application. It will add a system tray icon. Use that to make sure none of the volume controls are muted and that they have the proper volume.

If that doesn't work turn off pulseaudio and kmix will show the same controls as alsa.

These issues have been fixed for a while, though (at least since 4.5, I think).


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
jlinkels
Registered Member
Posts
31
Karma
0
OS
Thanks for the reply. I can't test it now because I am out of town for a few days. When I get home I'll test and report back.

jlinkels
jlinkels
Registered Member
Posts
31
Karma
0
OS
OK, I did some tests.

First there seemed to be no way to switch off Pulse, not in KDE, not using the kill command. Then I completely uninstalled PulseAudio, and voila, all the settings showed up in KDE.

Not that it works. When I still had the problem that my audio settings were lost, I was able to set up audio eventually right with AlsaMixer using a console. Now, when I test Skype, the microphone is not usable. That is, sound is being recorded, but it is so distorted, it becomes unrecognizable. It is like I am using a preamplifier which is fully saturated with the audio I produce. Still when I reduce the sensivity of the mic and the mic boost nothing changes. This is not a hardware problem as it occured at the moment I removed PulseAudio.

What also puzzles me is that I have TWO sliders for front mic, one is called front mic boost the other one front mic boost (capture) which move simultaneously. There is no way to unlock them so they move simultaneously. Even in AlsaMixer they show up both and I cannot recall they did before.

On another machine which I upgraded two weeks ago, the sound mixer was behaving correctly, but sound was distorted in exactly the same way. But while experimenting on that computer sound suddenly became normal and has not given problems since.

I also tried to use Sound Recorder to test the sound capture but that program aborted with an error: "Your sound capture settings are not correct. Please adjust them in KDE System Preferences". Now I can't find a program "KDE System Preferences". I can find "KDE System Settings" but there is no way to adjust capture settings.

Now one more general question. I have looked up what the idea is behind PulseAudio. It is an additional layer between Alsa and the application. But WHY does it hide all reasonable settings, and is there no way to reach them from the application? What sense does that make?

jlinkels
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
For the audio capture, you probably need to try some combination of setting lower capture values (about 50% or so) and muting various other capture sources.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
jlinkels
Registered Member
Posts
31
Karma
0
OS
That is what I did. Switched off everything that could capture. Anything that was not explicitly an output reduced to 0. Then one by one switching capture on and raising the sensitivity a bit. No avail. As soon as I detect any capturing it is distorted like that.

jlinkels
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
So now you have got rid of pulseaudio what do you have? alsa or oss? If the former I suggest you have a look here: https://wiki.archlinux.org/index.php/ALSA

and especially:

https://wiki.archlinux.org/index.php/AL ... at_startup


Debian testing
jlinkels
Registered Member
Posts
31
Karma
0
OS
I have ALSA, but the restore of audio settings is not the problem anymore. Settings can be adjusted in KMixer and are retained over reboots. They also can be adjusted in alsamixer, and both mixers show the same settings. No problem here.

But the sound of my mic is so severely distorted I cannot recognize anything. It does record: I can discern between sound and silence.

Setting up which sound source to use is not a problem either, eventually I selected the USB Webcam mic. I can deselect the capture of the hardware mic, I can select the USB mic, I can tell Skype to use the USB mic.

Eventually I want to be able to use my hardware mic because that sound quality is much better.

jlinkels
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
Coolio.

Try and reduce recording volume to get rid of the distortion.


Debian testing
jlinkels
Registered Member
Posts
31
Karma
0
OS
Sure.

I know how to handle audio and sampling, I have been an electronics engineer for the past 30 years.

No matter how low I put the accessible controls in KMix or Alsamixer, as soon as sound gets recorded it distorted beyond recognition.

jlinkels
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Your sound hardware may need a ALSA specific option in order to fully function properly. I suggest googling the name of your sound hardware (Retrieved from lspci) to see if anything is known to be needed.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
jlinkels
Registered Member
Posts
31
Karma
0
OS
Well, the strange thing is that when I install pulseaudio back my hardware mic works. But the ALSA settings are overwritten in a way which cannot be restored by alsactl restore, only manually. And I can't ask the wife to check and adjust 17 settings in alsamixer.

When I remove pulseaudio the sound is distorted beyond recognition. However recording with arecord works fine. GUI applications as Sound Recorder or Skype fail.

About Kmixer when I have pulseaudio not installed: when I tell Kmixer to save and restore my settings, it does not. It restores to someone different than alsactl restored at boot time, and also something different as I used last in Kmixer. In other words, it restores to something which Kmixer might like, but not the user. This has nothing to do with booting, overwriting by Kmixer happens when KDE is restarted.

Storing the correct settings in alsactl and tell Kmixer not to restore the settings keep the settings correct. But I find this hardly acceptable from a non-geek user point of view.

jlinkels
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
workaround: put desired alsa settings in rc.local


Debian testing
jlinkels
Registered Member
Posts
31
Karma
0
OS
jlinkels wrote:I feel that when push comes to shove, I have to write a startup script which let amixer set all the controls settings correctly after my wife has logged in into KDE. But this is quite stupid, isn't it?
jlinkels


That is what I suggested in my first post.

jlinkels
User avatar
toad
Global Moderator
Posts
1258
Karma
7
OS
In not so many words, yes - anyway, easy enough to overlook after 14 posts...

BTW, are you certain that this is a KDE problem? I don't remember reading tests with other environments.


Debian testing


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], rockscient