понеделник, 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!

понеделник, 19 декември 2011 г.

How to opt out of Google WIFI Database

While browsing trough the news, I discovered this potentially helpfull information:
"Under the agreement, which was announced by Google and the Dutch Data Protection Authority, owners of Wi-Fi routers can add “_nomap” to the end of a router’s name to tell Google that they do not want its information included."source
I don't know if or when I will change the name of my rooter, but it's good to know in case you need it. After all, paranoia aside, but the article goes on like this:
"If many people opt out of the registry, Google’s ability to offer location-based services could be compromised. The company would then have to use cell tower locations and the Global Positioning System to determine a phone’s location, which could result in less accuracy and greater use of battery power." source
I personally don't see any reason why Google should know my geographic location, nor why I should be interested in anything Google can offer me to buy. And the idea of using my GPS location without my explicit consent is outrightly spooky! That's why I almost never turn on the GPS on my phone. And I never registered my Android with my Gmail account. It might be a tiny victory for the mankind, but it makes me feel good :)
So I guess it's not a bad idea to make the effort and change the name of the rooter. Even if only in the name of making Google little bit more miserable :)

понеделник, 5 декември 2011 г.

How to load subtitles in Kaffeine Player

Ok, it was a long night, but finally I solved a problem that was bugging me for quite a while.
I love Kaffeine, it's a great player, but at one point, it stopped displaying subtitles. What's worst, I couldn't find how to load them from external file and well, I stopped using it.
Today, I finally found out how to deal with Kaffeine.

To load subtitles, following the instructions here:
Click on Playlist, right-click on the movie file you're displaying and in the context menu you'll find: Load subtitles.
Another serious problem is that the subtitles are ridiculously small. It was a real pain figuring that out, but with the help of link1 and link2, I managed it.
To change the size of the subtitles:
1. Open the file: /home/user/.kde4/share/apps/kaffeine/xine-config
2. Find the line saying subtitles.separate.subtitle_size: tiny
3. Uncomment that line (remove the #) if it is commented, and change "tiny" to whatever size you prefer (tiny  small  normal  large  very large  huge). I tried with "large" and the subs became visibly big. So this one is working. You can also change the font from here, uncommenting the line: #subtitles.separate.font:sans but I didn't need to do that.
Well, that's it.
The mystery called subtitles in Kaffeine was solved. Weee!

P.S. If you need to replace some font of Xine, you can do it in the following directory:
/usr/share/xine/libxine1/fonts/