MPV无音频问题

MPV无音频问题

我安装了 MPV,发现播放任何媒体文件(mp3、mp4、webm 等)时都不会播放任何音频。

我曾尝试添加mpv.conf文件:

# ===== Audio =====
ao=alsa
audio-device=auto

但还是没有声音。
可能是什么问题?

更新 1

  1. 输出sudo fuser -v /dev/snd/*
abhishek@kamal:~$ sudo fuser -v /dev/snd/*
[sudo] password for abhishek: 
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  abhishek   1210 F.... pulseaudio
/dev/snd/controlC1:  abhishek   1210 F.... pulseaudio
abhishek@kamal:~$
  1. 输出mpv -audio-device=help*
abhishek@kamal:~$ mpv -audio-device=help
List of detected audio devices:
  'auto' (Autoselect device)
  'pulse/alsa_output.pci-0000_00_1f.3.analog-stereo' (Built-in Audio Analog Stereo)
  'alsa' (Default (alsa))
  'alsa/samplerate' (Rate Converter Plugin Using Samplerate Library)
  'alsa/speexrate' (Rate Converter Plugin Using Speex Resampler)
  'alsa/jack' (JACK Audio Connection Kit)
  'alsa/oss' (Open Sound System)
  'alsa/upmix' (Plugin for channel upmix (4,6,8))
  'alsa/vdownmix' (Plugin for channel downmix (stereo) with a simple spacialization)
  'alsa/plughw:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/Hardware device with all software conversions)
  'alsa/plughw:CARD=PCH,DEV=3' (HDA Intel PCH, HDMI 0/Hardware device with all software conversions)
  'alsa/plughw:CARD=PCH,DEV=7' (HDA Intel PCH, HDMI 1/Hardware device with all software conversions)
  'alsa/plughw:CARD=PCH,DEV=8' (HDA Intel PCH, HDMI 2/Hardware device with all software conversions)
  'alsa/plughw:CARD=PCH,DEV=9' (HDA Intel PCH, HDMI 3/Hardware device with all software conversions)
  'alsa/plughw:CARD=PCH,DEV=10' (HDA Intel PCH, HDMI 4/Hardware device with all software conversions)
  'alsa/sysdefault:CARD=PCH' (HDA Intel PCH, ALC256 Analog/Default Audio Device)
  'alsa/front:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/Front output / input)
  'alsa/surround21:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/2.1 Surround output to Front and Subwoofer speakers)
  'alsa/surround40:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/4.0 Surround output to Front and Rear speakers)
  'alsa/surround41:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/4.1 Surround output to Front, Rear and Subwoofer speakers)
  'alsa/surround50:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/5.0 Surround output to Front, Center and Rear speakers)
  'alsa/surround51:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/5.1 Surround output to Front, Center, Rear and Subwoofer speakers)
  'alsa/surround71:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/7.1 Surround output to Front, Center, Side, Rear and Woofer speakers)
  'alsa/hdmi:CARD=PCH,DEV=0' (HDA Intel PCH, HDMI 0/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=1' (HDA Intel PCH, HDMI 1/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=2' (HDA Intel PCH, HDMI 2/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=3' (HDA Intel PCH, HDMI 3/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=4' (HDA Intel PCH, HDMI 4/HDMI Audio Output)
  'alsa/dmix:CARD=PCH,DEV=0' (HDA Intel PCH, ALC256 Analog/Direct sample mixing device)
  'alsa/dmix:CARD=PCH,DEV=3' (HDA Intel PCH, HDMI 0/Direct sample mixing device)
  'alsa/dmix:CARD=PCH,DEV=7' (HDA Intel PCH, HDMI 1/Direct sample mixing device)
  'alsa/dmix:CARD=PCH,DEV=8' (HDA Intel PCH, HDMI 2/Direct sample mixing device)
  'alsa/dmix:CARD=PCH,DEV=9' (HDA Intel PCH, HDMI 3/Direct sample mixing device)
  'alsa/dmix:CARD=PCH,DEV=10' (HDA Intel PCH, HDMI 4/Direct sample mixing device)
  'alsa/usbstream:CARD=PCH' (HDA Intel PCH/USB Stream Output)
  'alsa/plughw:CARD=NVidia,DEV=3' (HDA NVidia, HDMI 0/Hardware device with all software conversions)
  'alsa/plughw:CARD=NVidia,DEV=7' (HDA NVidia, HDMI 1/Hardware device with all software conversions)
  'alsa/plughw:CARD=NVidia,DEV=8' (HDA NVidia, HDMI 2/Hardware device with all software conversions)
  'alsa/plughw:CARD=NVidia,DEV=9' (HDA NVidia, HDMI 3/Hardware device with all software conversions)
  'alsa/plughw:CARD=NVidia,DEV=10' (HDA NVidia, HDMI 4/Hardware device with all software conversions)
  'alsa/hdmi:CARD=NVidia,DEV=0' (HDA NVidia, HDMI 0/HDMI Audio Output)
  'alsa/hdmi:CARD=NVidia,DEV=1' (HDA NVidia, HDMI 1/HDMI Audio Output)
  'alsa/hdmi:CARD=NVidia,DEV=2' (HDA NVidia, HDMI 2/HDMI Audio Output)
  'alsa/hdmi:CARD=NVidia,DEV=3' (HDA NVidia, HDMI 3/HDMI Audio Output)
  'alsa/hdmi:CARD=NVidia,DEV=4' (HDA NVidia, HDMI 4/HDMI Audio Output)
  'alsa/dmix:CARD=NVidia,DEV=3' (HDA NVidia, HDMI 0/Direct sample mixing device)
  'alsa/dmix:CARD=NVidia,DEV=7' (HDA NVidia, HDMI 1/Direct sample mixing device)
  'alsa/dmix:CARD=NVidia,DEV=8' (HDA NVidia, HDMI 2/Direct sample mixing device)
  'alsa/dmix:CARD=NVidia,DEV=9' (HDA NVidia, HDMI 3/Direct sample mixing device)
  'alsa/dmix:CARD=NVidia,DEV=10' (HDA NVidia, HDMI 4/Direct sample mixing device)
  'alsa/usbstream:CARD=NVidia' (HDA NVidia/USB Stream Output)
  'jack' (Default (jack))
  'sdl' (Default (sdl))
abhishek@kamal:~$

答案1

找了好久,终于找到解决办法:

  1. 在终端运行此命令,mpv --audio-device=help
    您将看到一些“检测到的音频设备列表”。
  2. 使用上面的列表并按照以下命令用音频设备逐一测试:
    mpv --audio-device=alsa/speexrate your_video.mp4
    mpv --audio-device=alsa/vdownmix your_video.mp4等等。

通过上述测试,您可以找到哪个音频设备适合您。
然后打开/创建~/.config/mpv/mpv.conf并将以下内容添加到mpv配置文件文件:

# ===== Audio =====

osc=no
ao=alsa
audio-device=alsa/speexrate

并将其替换alsa/speexrate为您上面已经测试过的适用选项。

相关内容