2011年9月26日 星期一

在 Ubuntu 10.10 上修正 NVidia 的 HDMI audio 支援問題

首先要裝上 ppa:fourdollars/nvidia 上面的 nvidia proprietary driver
還要裝上 ppa:diwic/dkms 上面的 alsa-hda-dkms
還要裝上 ppa:ubuntu-audio-dev/ppa 上面的 pulseaudio
然後重新啟動
接下來看看 HDMI 接在哪裡
$ for i in /proc/asound/NVidia/eld*; do echo "<<$i>>"; cat $i; done
<</proc/asound/NVidia/eld#0.0>>
monitor_present		0
eld_valid		0
<</proc/asound/NVidia/eld#1.0>>
monitor_present		1
eld_valid		1
monitor_name		CHIMEI 22SH-L
connection_type		HDMI
eld_version		[0x2] CEA-861D or below
edid_version		[0x3] CEA-861-B, C or D
manufacture_id		0x73b
product_id		0x2d22
port_id			0x10000
support_hdcp		0
support_ai		0
audio_sync_delay	0
speakers		[0x1] FL/FR
sad_count		1
sad0_coding_type	[0x1] LPCM
sad0_channels		2
sad0_rates		[0xe0] 44100 48000 88200
sad0_bits		[0xe0000] 16 20 24
<</proc/asound/NVidia/eld#2.0>>
monitor_present		0
eld_valid		0
<</proc/asound/NVidia/eld#3.0>>
monitor_present		0
eld_valid		0
從上面的紀錄可以看出在 /proc/asound/NVidia/eld#1.0 上面
不過可能會看到都是靜音的狀態
$ amixer -D hw:NVidia
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',3
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
就可以執行
$ alsamixer -D hw:NVidia
在 CUI 設定畫面中全部取消靜音,接下來執行
$ pasuspender -- speaker-test -D hdmi:NVidia,1 -c 2 -t sine -l 1
應該就可以聽到聲音了,確定裝置之後就可以修改 /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf 當中的
[Mapping hdmi-stereo]
device-strings = hdmi:%f
channel-map = left,right
priority = 4
direction = output
改成
[Mapping hdmi-stereo]
device-strings = hdmi:%f,1
channel-map = left,right
priority = 4
direction = output
再重新啟動後應該就可以聽到 HDMI audio 的聲音了。

其它幫助除錯的方法還有