LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 10-23-2010, 09:13 PM   #1
chrisinspace
LQ Newbie
 
Registered: Dec 2008
Location: Alexandria, VA
Distribution: Ubuntu, Debian, CentOS, CrunchBang
Posts: 21

Rep: Reputation: 0
Distortion when PCM is at 100


I am using Kubuntu 10.10 and having a sound issue. I fully installed PulseAudio so that I could properly enable the 5.1 sound on my system. At some volume levels it sounds great, while at others it has a terrible metallic-sounding distortion. I have worked with the various audio tools I have installed and narrowed down the problem.

Here is what I have installed to configure sound settings: kmix (KDE equivalent of gnome-volume-manager), pavucontrol, alsamixer.

I have found that when I adjust the master volume level through kmix (either with the GUI slider or the volume control keys on my keyboard), the levels in alsamixer all change, too, not just the Master level. When PCM maxes out at 100, I get the distortion, but if it is at 99 or lower, everything sounds perfect. The weird thing is that as I adjust the master volume level, the PCM level bounces between 98 and 100. Like this:

Master PCM

23.....100
35.....98
42.....100
52.....98
58.....98
61.....100
68.....98
74.....98
78+....100

Is there any way to lock the PCM level or cap it at 99? If I can keep the PCM from hitting 100, I can get rid of the distortion. I would greatly appreciate anyone's help.
 
Old 10-24-2010, 07:30 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I'm not an alsa expert. Looking in /etc/alsa.state, I found this segment:

Code:
...
        control.22 {
                comment.access 'read write user'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 255'
                comment.tlv '0000000100000008ffffec1400000014'
                comment.dbmin -5100
                comment.dbmax 0
                iface MIXER
                name 'PCM Playback Volume'
                value.0 255
                value.1 255
        }
I think that the alsa state file is read in when alsa starts. I think that comment.dbmax 0 is purely information.
But this segment of the "amixer" program output indicates that editing the "value" line will limit the lower and upper bounds of the alsa mixer:
Code:
Simple mixer control 'PCM',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
You may need to resort to the alsa documentation to see if there is an equivalent asound.conf setting.

Using pulse, you shouldn't need to touch kmix at all. I normally listen to podcasts on my laptop, piping the audio to my desktop. Selecting the optical output on my desktop (from the laptop padevchooser applet) selects my stereo for audio.

Last edited by jschiwal; 10-24-2010 at 07:34 PM.
 
Old 10-25-2010, 11:14 AM   #3
chrisinspace
LQ Newbie
 
Registered: Dec 2008
Location: Alexandria, VA
Distribution: Ubuntu, Debian, CentOS, CrunchBang
Posts: 21

Original Poster
Rep: Reputation: 0
I have been using Linux for a while, but I'm not a programmer and I've never had to hack ASLA before. So, to clarify, you think that by editing the 'value.0' and/or 'value.1' lines in the /etc/alsa.state file, I can set an upward limit? The range in the alsamixer is 0 to 100, so do you have any recommendations as to what value I should use to slightly decrease the cap? 255 looks like IP bit notation where 255 would equal 11111111 in binary.

Quote:
Originally Posted by jschiwal View Post
Using pulse, you shouldn't need to touch kmix at all. I normally listen to podcasts on my laptop, piping the audio to my desktop. Selecting the optical output on my desktop (from the laptop padevchooser applet) selects my stereo for audio.
I'm using kmix with pulse because this is a HTPC and I control it from a multimedia keyboard. I really need the volume control keys to work and they are currently tied to the main volume channel of kmix.
 
Old 10-26-2010, 05:21 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Code:
                value.0 255
                value.1 255
I think changing the 255 to 250, for example, may change the max level. On my system, the alsa.state file is saved when alsa shuts down and I presume is reloaded then the device is detected:

I read through /etc/init.d/alsasound, where alsa is started, and the alsactl command to load the state file is commented out. I mentions that udev does it instead.

Code:
cat /etc/udev/rules.d/40-alsa.rules 
SUBSYSTEM=="sound",             GROUP="audio"
SUBSYSTEM=="snd",               GROUP="audio"
KERNEL=="controlC[0-9]*",       NAME="snd/%k"
KERNEL=="hwC[D0-9]*",           NAME="snd/%k"
KERNEL=="pcmC[D0-9cp]*",        NAME="snd/%k"
KERNEL=="midiC[D0-9]*",         NAME="snd/%k"
KERNEL=="timer",                NAME="snd/%k"
KERNEL=="seq",                  NAME="snd/%k"
SUBSYSTEM=="sound", KERNEL=="controlC?", RUN+="/usr/sbin/alsa-init %n"
There may be a better place to set the maxDB variable in a configuration file, but I'm not certain on which file or syntax to use.
 
Old 10-29-2010, 09:00 PM   #5
chrisinspace
LQ Newbie
 
Registered: Dec 2008
Location: Alexandria, VA
Distribution: Ubuntu, Debian, CentOS, CrunchBang
Posts: 21

Original Poster
Rep: Reputation: 0
I just checked and I don't have a /etc/alsa.state file, so I'm back to square one. I'm wondering if there is some way to maybe control which level kmix adjusts. Right now my only choice of channels is "Internal Audio Analog Surround 5.1". I can't choose "master", "PCM", etc.
 
Old 10-31-2010, 01:14 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You could use "sudo /usr/sbin/alsactl store 0" to store the settings for card 0. Looking at the kmix settings, I saw settings for the initial value, but not a way to set a max limit.

For pulse audio, you can run "pavucontrol", and change the settings in the Output tab.

Last edited by jschiwal; 10-31-2010 at 01:22 AM.
 
Old 11-02-2010, 09:49 PM   #7
chrisinspace
LQ Newbie
 
Registered: Dec 2008
Location: Alexandria, VA
Distribution: Ubuntu, Debian, CentOS, CrunchBang
Posts: 21

Original Poster
Rep: Reputation: 0
jschiwal, thank you for taking the time to look into this. I appreciate your help.

Well, in case anyone else is having this issue, I eventually found a work around on another forum (Thanks, Mandriva). If you kill kmix, then run the command

Code:
KMIX_PULSEAUDIO_DISABLE=1 kmix
you will be able to select the master channel. I selected PCM. That allows me to control the system volume with the PCM slider, preventing it from jumping to 100. I just never set the volume above 99. The change reverts if I reboot the machine, so the next step will be to set it that way at bootup, but I haven't gotten there yet. I'll update this when I figure that out, but it's not super-high on my priority list since I don't reboot this machine very often.
 
Old 11-04-2010, 06:01 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Thank you for the update.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
alsamixer: PCM front attenuator always @100 when starting. stf92 Linux - Software 2 07-31-2010 09:24 AM
(Sound) what is PCM? what's the difference between PCM volume and master volume? snr8fl3 Linux - General 2 01-27-2009 06:12 AM
Xircom CreditCard 10/100 CE3-10/100 driver not loaded under FEDORA or RHEL androphag Linux - Laptop and Netbook 1 02-06-2005 01:35 AM
RBEM56G-100 Xircom RealPort Cardbus Ethernet 10/100+Model 56 Linux Drivers/ Phalk sxa Linux - Laptop and Netbook 1 06-12-2004 11:20 AM
linksys pcm pc200 10/100 cardbus marzer Linux - Networking 0 06-20-2002 06:05 AM


All times are GMT -5. The time now is 10:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration