понеделник, 9 април 2012 г.

Pulse mixing sound from headphones and internal speakers

After the last update, I have a problem with the sound of my laptop - I have sound from the internal speakers, but if I plug in speakers or headphones, I get sound from both internal and external speakers. Which sucks since I can't listen to too loud music.

I still have to find the solution of this problem, but while searching, I found some useful commands I'd like to share.

First, how to gather information on your sound card and so on:
$lspci -v  
this will give you the sound card you're using (along with other useful stuff)
$aplay -l
this will give you the device of your sound card
$ cat /proc/asound/card0/codec* | grep Codec
this will give you the codec you're using.
For example, running those commands I get:
Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
sysdefault:CARD=Intel
HDA Intel, ALC268 Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, ALC268 Analog

Codec: ALC268
Now that we have this info, we can use it to make our alsa.conf more usable, and eventually working better.
With the codec name, you can look in the file /usr/share/doc/alsa-base/river/HD-Audio-Models.txt.gz to find the models which work with it. Using this model name, you can then edit your: /etc/modprobe.d/alsa-base.conf (in my case the file is named alsa.conf) to add the following lines:
options snd-hda-intel model=$(MODEL)
(or
alias snd-card-0 snd-hda-intel
options snd-hda-intel index=0 model=$model position_fix=1
)
and this should fix the problem with the headphones (source).
It should, but whether it would, I have no way of knowing since I'm still looking for the file HD-Audio-Models.txt.gz. It is ridiculous, but it seems to be missing from all the directories where it usually resides.
(Note that after you change alsa.conf, you need to restart alsa with
$/etc/init.d/alsa restart
and also, to reload the module snd-hda-intel with
$modprobe -r  snd-hda-intel&& modprobe  snd-hda-intel)

Another option is to change the following settings:
[Element Front]
switch = mute
volume = merge
override-map.1 = all-front
override-map.2 = front-left,front-right

To:

[Element Front]
switch = ignore
volume = ignore
in /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
(source) I still have to try this, but it seems reasonable to me.

One more suggestions I found is the following:
For example my card is card 0: H71 [Hoontech STA DSP24 Media 7.1], device 0: ICE1712 multi [ICE1712 multi] but according to this bug other cards such as M-Audio type cards are affected too.
In my example you will need to replace the "H71" with whatever the device says when you run asoundconf list
By editing this file,
gksudo gedit /etc/pulse/default.pa
and adding the following lines at the end, I now have a working pulseaudio in 8.10 64 bit.

# Added comment rod40cool - Run command "asoundconf list" to determine what to add after "device=hw:????"
# Added comment rod40cool - Make sure after pasting that there are only 2 lines below starting each with "load-module module..."
load-module module-alsa-sink sink_name=H71_out device=hw:H71 format=s32le channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,au x5,aux6,aux7
load-module module-alsa-source source_name=H71_in device=hw:H71 format=s32le channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,au x5,aux6,aux7,aux8,aux9

(source)
I yet have to try it out, since I'm not sure if I know my device name.

So, my problem has yet to be solved. However, I found one more interesting link I'd like to share and its about .asoundrc and how to make it play sound from two or more source in the same time. Well, it turns out it's easy. I used the code from this wiki (replacing "card 1 device 7" with "card 0 device 0" in my case) and it worked! Well, at least it didn't crash. Before I had some problems playing Amarok and something else, not anymore. Cool.

Finally, I found this Sabayon Wiki dedicated to sound which I have to try out. It offers an easier way to check whether certain model works or not which will be useful considering the fact my codec is not in the table. Oh well.  In any case, tomorrow is going to be a big day.
Have fun!

Update: As ridiculous as it might sound, I found a very simply solution of my problem. It turned out that I can mute the speakers of my laptop trough kmix. Ha ha ha. Well, this is not a perfect solution since when I start amarok for example, the Speakers are again maxed, but I think I solved this by fixing the value for the speakers in /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf and restarting alsa. Finally my speakers are saved!

Няма коментари:

Публикуване на коментар