嗯,怎麼辦呢,雖然我有HDMI螢幕,但沒有兩端都是HDMI的線材;還是要用能把HDMI轉成RGB D-sub與3.5mm耳機孔的轉接器呢?至於I2S,目前似乎尚未支援。
想起以前為Raspberry Pi買了一張USB音效卡,用了一陣子,後來就積灰塵,現在終於可以重見天日。
根據文件,首先判斷晶片為何,
$ dmesg | grep cm109
$ dmesg | grep Headphone
[ 3.325467] usb 1-7.1: Product: C-Media USB Headphone Set
[ 3.327013] input: C-Media USB Headphone Set as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1:1.3/0003:0D8C:000C.0004/input/input3
[ 3.380759] hid-generic 0003:0D8C:000C.0004: input,hidraw3: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-0000:00:14.0-7.1/input3
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0424:2530 Standard Microsystems Corp.
Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 004: ID 0424:4603 Standard Microsystems Corp.
Bus 001 Device 003: ID 093a:2521 Pixart Imaging, Inc.
Bus 001 Device 002: ID 046d:c31d Logitech, Inc. Media Keyboard K200
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
代表我拿到的是CM-Headphone Type。然後作設定。
新增檔案/etc/asound.conf,內容如下,
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
原始文件說是1,但我改成0才正確,因為,
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Subdevices: 0/1 Subdevice #0: subdevice #0
card 1: IntelHDMI [IntelHDMI], device 0: IntelHDMI [IntelHDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
然後修改或新增檔案/etc/modprobe.d/alsa-base.conf,修改成或加入底下這行:
options snd-usb-audio index=0
完成,播放mp3音檔與mp4影片檔,都有聲音,但是玩遊戲卻沒有,例如FreeCiv,嗯,為什麼呢?
No comments:
Post a Comment