如何在 mplayer 中指定音频硬件?

如何在 mplayer 中指定音频硬件?

我的操作系统中的所有声卡信息:

ls  /dev/snd/
by-id  by-path  controlC0  controlC1  controlC2  hwC0D0  hwC2D0  pcmC0D3p  pcmC0D7p  pcmC0D8p  pcmC1D0c  pcmC2D0c  pcmC2D0p  pcmC2D1p  pcmC2D2c  seq  timer

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 1: ALC662 rev3 Digital [ALC662 rev3 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

播放音乐:

mplayer  sample.mp3

我想要指定硬件编号:

mplayer -ao alsa:device=hw=2.0  sample.mp3
MPlayer 1.4 (Debian), built with gcc-10 (C) 2000-2019 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing sample.mp3.
libavformat version 58.45.100 (external)
Audio only file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
[AO_ALSA] alsa-lib: pcm_hw.c:1715:(snd_pcm_hw_open) open '/dev/snd/pcmC2D0p' failed (-16): Device or resource busy
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa:device=hw=2.0'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video

如何使用参数--调用我的音频硬件-ao alsa:device=hw=

相关内容