Posts Tagged ‘headphones’
Ubuntu 9.10 Karmic Koala beta
I just want to inform you, if you have not tried it yet. Brightness control works out of the box. S1 key works, AV key does not. Headphones jack detection works. Built-in microphone does not. Web camera works in Skype.
Dmesg output when using AV key:
sony-laptop: Unknown event: 0x100 0xa1 sony-laptop: Unknown event: 0x100 0x21
I guess sony-laptop module is without our patch or just a new one. I’ll check sources when I have time.
Stay tuned.
Headphones/Front switch script
I’m not defining a “hippo” model for “snd-hda-intel” to make headphones detection about we talk earlier. Because I’m using my headphones plug very rarely, I decided to write a shell script to switch sound to headphone and back and link it to to S1 button. This information could help you if you want to make S1 button to do something else too.
Here is a switch script, when you run it, it detects if headphones are switched on then it switch it off and vice-versa. Front mixer channel will be switched off if headphones switched on and vice-versa.
#!/bin/bash # by Anton Veretenenko <anton[email sign]veretenenko.ru> is_front_on=`amixer -c 0 cget numid=2,iface=MIXER,name='Front Playback Switch' | grep -i -c -P -e "values=on,on"` if [ "$is_front_on" == "1" ] then amixer -c 0 cset numid=2,iface=MIXER,name='Front Playback Switch' off amixer -c 0 cset numid=3,iface=MIXER,name='Headphone Playback Switch' on else amixer -c 0 cset numid=2,iface=MIXER,name='Front Playback Switch' on amixer -c 0 cset numid=3,iface=MIXER,name='Headphone Playback Switch' off fi
To link S1 button to this script (make a shortcut) you need to delete shortcut from System->Preferences->Keyboard Shortcuts for this button, if you have it. I guess you saw that S1 button named as “XF86Launch1″ in keyboard shortcuts, you need this name later.
Open gconf-editor (Alt+F2, type gconf-editor, Run). On the left tree select apps->metacity->global_keybindings the on the right you should see a list of keys, select one you like (I choose “run_command_1″) and edit it (right click, Edit Key), enter name of S1 button (“XF86Launch1″) into value field. Then select “keybinding_commands” on the left.
Edit “command_1″ key, into value field you should enter path to the script, in my case it is “/home/egaistek/scripts/alsa-front-mute”. That’s all, it should work now.
P.S. Do not forget to add executable permissions to a script file (chmod +x in terminal or File->Properties, Permissions tab, set “Allow executing file as program” in Nautilus/File Explorer)
P.P.S. This works only for Gnome without Compiz running. If you want to add shortcuts with Compiz, use Compiz configuration tools.
Headphones detection, auto switch off laptop speakers
Thanks to Sean Carlos for pointing us.
Add this line into /etc/modprobe.d/options file:
options snd-hda-intel model=hippo
Then reboot and try to plug in your headphones.