星期二, 4月 21, 2009

ALC662錄音的問題 (Intel 82801G)

在試ALC662 chipset時...發現不能錄音
一開始找不出問題
但後來發現原來是因為mic的回朔太大聲, 造成錄音無法正常運作
若使用alsa內建的指令錄音, 就都沒有問題
相關用到的指令如下

alsamixer
asoundconf set-default-card 0 (do this only when alsamixer has trouble)
aplay -l
arecord -f cd -t wav -d 5 test.wav
aplay test.wav

好用的測試聲音小工具
xoscope

還是用指令比較保險

最後....
在Volume Control/options/input srouce change to front Mic (system use front mic to be default)
and...壓低front mic與front mic boost的音量....
目前看到多一個問題,ogg type不能使用,換成wave type就好了
可以用下面方式解決
gstreamer-properties程式把原本的input plugin從"alsa"轉為"OSS"

參考用的command, 可直接修改聲音的設定
amixer sset "Input Source" "Front Mic"
amixer -q set "Front Mic" 50% unmute
...

星期三, 4月 15, 2009

How to change keycode or keybinding behavior

You can check whole hot key architecture here.
https://wiki.ubuntu.com/Hotkeys/Architecture

* Relative commands
1. input-utils package
a. lsinput: shows some information about each input device the kernel reports. This is useful to make sure you have the right device number for other testing.
b. input-events: tell you the events passing through the queue for any device
c. input-kbd: show you the keymap available for any device that provides keyboard events
2. acpi_listen: listen to acpi channel if the keycode send to acpi.
3. showkey : show the keycodes by -k and scancodes by -s parameter.
4. xev : show the key symbol in X environment like below.
5. xmodmap : GNOME mapping table
KeyRelease event, serial 33, synthetic NO, window 0x4400001,

. root 0x13b, subw 0x0, time 9487761, (321,324), root:(399,415), state 0x0, keycode 23 (keysym 0xff09, Tab), same_screen YES, XLookupString gives 1 bytes: (09) " " XFilterEvent returns: False

*How to find out the root cause of hot key
For kernel clarification
1. use "lsinput" to check which device file you used.
2. use "input-events 4" to listen if kernel get the right signal from device (4 means /dev/input/event"4")

For acpi clarification
3. excute "#showkey -s" to capture the keyboard signal.
4. Check the scancodes and refer to /usr/includes/linux/input.h file.
5. check the keycodes definition in /usr/share/acpi-support/key-constants
6. check the scripts file for acpi event in /etc/acpi/*.sh
7. you can use acpi-fakekey to simulate the keycode.

For GNOME system
8. use "xmodmap -pke" to check the key map
9. use "xev" to see which keycode or behavior under GNOME
10. Or you can use "gnome-keybinding-properties" to check the GNOME keybinding status.
============
gnome-keybinding-properties save the system default setting in following path
/var/lib/gconf/debian.defaults/%gconf-tree.xml
and save the user settings in
/home/juergen/.gconf/desktop/gnome/keybindings/"your-key-name"/%gconf.xml
============

---------------------------------------------------------------------------

For example: 0xe0 0x20 for fn-f9 audio mute binding code by showkey -s
xmodmap -pke (look for the available keycode number)
less /usr/share/X11/XKeysymDB (check which X Window default function)
setkeycodes e020 255 (that means keycode 255 will be 0xe0 0x20, change keybinding to keycode.)

For example: change keybinding 121->mute to 113->mute
$sudo xmodmap -e "keycode 113 = XF86AudioMute"
$xmodmap -pke | grep 113

For example: for acpi event
when acpi script needs 121 to mute, but mute button is 113.
add "$setkeycodes e020 121" to /etc/event.d/rc2 script section before exec line.
reboot and mute function keycode will change to 121.
modify /usr/share/acpi-support/key-constants 113 to 121



refer to the page
http://darkknight9.blogspot.com/2005/08/custom-keybinding-gnome.html
"Application/System Tools/Configuration Editor" for metacity "keybindings" function.

Command line wireless enablement

It's just refer to someone readme file, but properly useful when no GUI.

"ifconfig wlan0 up"
"ifconfig" to check the "wlan0" section
"iwlist scan" to scan all AP (The essid "testap" for example)
"iwconfig wlan0 essid testap" to set up essid
"ifconfig wlan0 broadcast 192.168.0.255 netmask 255.255.255.0 192.168.0.100"
"route add default gw 192.168.0.1 dev wlan0"