Saya ingin mendapatkan program yang menggunakan openal untuk mengirim suara melalui output HDMI kartu nvidia saya dengan menggunakan perpustakaan alsa secara langsung. Ini konfigurasi saya:
root@localhost /root % cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xef420000 irq 136
1 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xef080000 irq 17
root@localhost /root %
Sepertinya tidak ada modul kernel yang dimuat untuk kartu suara Nvidia (di Windows® ada driver kartu suara khusus) . Jika perlu, saya tidak tahu modul kernel untuk memuat.
root@localhost /root % lsmod | grep snd
snd_hda_intel 36864 0
snd_hda_codec_realtek 90112 1
snd_hda_codec_generic 73728 1 snd_hda_codec_realtek
snd_hda_codec_hdmi 49152 2
snd_hda_codec 135168 4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_core 81920 5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 114688 4 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_timer 32768 1 snd_pcm
snd 86016 8 snd_hda_intel,snd_hwdep,snd_hda_codec,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek,snd_pcm
soundcore 16384 1 snd
root@localhost /root %
Jadi saya unmuted input spdif di alsamixer: tapi suaranya masih dikirim ke speaker pc saya bukannya HDMI (mungkin itu normal karena tidak ada kabel input spdif pada kartu grafis saya).
Saya membaca tentang .asoundrc
, tapi saya tidak tahu perangkat mana yang harus dipilih (audio HDMI) :
root@localhost /root % aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=PCH
HDA Intel PCH, ALC887-VD Analog
Default Audio Device
sysdefault:CARD=PCH
HDA Intel PCH, ALC887-VD Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
Front speakers
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
hdmi:CARD=PCH,DEV=1
HDA Intel PCH, HDMI 1
HDMI Audio Output
hdmi:CARD=PCH,DEV=2
HDA Intel PCH, HDMI 2
HDMI Audio Output
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
Direct sample mixing device
dmix:CARD=PCH,DEV=1
HDA Intel PCH, ALC887-VD Digital
Direct sample mixing device
dmix:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample mixing device
dmix:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct sample mixing device
dmix:CARD=PCH,DEV=8
HDA Intel PCH, HDMI 2
Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
Direct sample snooping device
dsnoop:CARD=PCH,DEV=1
HDA Intel PCH, ALC887-VD Digital
Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample snooping device
dsnoop:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct sample snooping device
dsnoop:CARD=PCH,DEV=8
HDA Intel PCH, HDMI 2
Direct sample snooping device
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
HDA Intel PCH, ALC887-VD Digital
Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct hardware device without any conversions
hw:CARD=PCH,DEV=8
HDA Intel PCH, HDMI 2
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC887-VD Analog
Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
HDA Intel PCH, ALC887-VD Digital
Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Hardware device with all software conversions
plughw:CARD=PCH,DEV=8
HDA Intel PCH, HDMI 2
Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 1
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output
dmix:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample mixing device
dmix:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct sample mixing device
dmix:CARD=NVidia,DEV=8
HDA NVidia, HDMI 2
Direct sample mixing device
dmix:CARD=NVidia,DEV=9
HDA NVidia, HDMI 3
Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
HDA NVidia, HDMI 2
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
HDA NVidia, HDMI 3
Direct sample snooping device
hw:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
HDA NVidia, HDMI 2
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
HDA NVidia, HDMI 3
Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
HDA NVidia, HDMI 2
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
HDA NVidia, HDMI 3
Hardware device with all software conversions
root@localhost /root %
Juga tidak ada perangkat Nvidia dari daftar ini yang berfungsi aplay -D
root@localhost /root % aplay -Dhw:1 /usr/share/kde4/apps/kolf/sounds/blackhole.wav
aplay: main:788: No such file or directory
Mencari dengan strace, tampaknya ia mencoba untuk membuka file perangkat yang tidak ada:
root@localhost /root % strace aplay -Dhw:1 /usr/share/kde4/apps/kolf/sounds/blackhole.wav 2>&1 | grep /dev/snd
open("/dev/snd/controlC1", O_RDONLY|O_CLOEXEC) = 3
open("/dev/snd/controlC1", O_RDWR|O_CLOEXEC) = 3
open("/dev/snd/pcmC1D0p", O_RDWR|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory)
root@localhost /root %
Yang terlihat normal karena perangkat 1-1 tidak ada:
root@localhost /root % cat /proc/asound/devices
1: : sequencer
2: [ 0] : control
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0- 1]: digital audio playback
6: [ 0- 3]: digital audio playback
7: [ 0- 7]: digital audio playback
8: [ 0- 8]: digital audio playback
9: [ 0- 0]: hardware dependent
10: [ 0- 2]: hardware dependent
11: [ 1] : control
12: [ 1- 3]: digital audio playback
13: [ 1- 7]: digital audio playback
14: [ 1- 8]: digital audio playback
15: [ 1- 9]: digital audio playback
16: [ 1- 0]: hardware dependent
33: : timer
root@localhost /root %
Selain itu, saya menemukan klaim pavucontrol port HDMI dicabut sedangkan saya memiliki sinyal video di televisi.
ps axu
). Jika tidak, itu tidak akan berfungsi - Pulseaudio mengambil alih semua perangkat ALSA. Jika Anda ingin menjalankan Pulseaudio saat masih menggunakan ALSA untuk HDMI, Anda perlu mengkonfigurasi Pulseaudio untuk mengabaikan perangkat HDMI ALSA. Saya berasumsi Anda menguji suara itu melalui HDMI dengan Pulseaudio berfungsi, jadi orang bisa menyingkirkan masalah driver dengan kartu nvidia?