How to Force mpv to Use a Specific Audio Device?
If you want to direct your audio playback through a particular device
using the mpv media player, you can force this behavior by using the
--audio-device command line option. This setting allows you
to bypass the system’s default audio output and explicitly target
headphones, external speakers, or a specific audio interface. This
article covers how to find your available device names, format the
command correctly, and make the change permanent.
Identifying Your Audio Devices
Before you can force mpv to use a specific device, you need to know the exact name or identifier that your system uses for that device. You can get a complete list of recognized audio outputs by running the following command in your terminal or command prompt:
mpv --audio-device=helpRunning this will output a list of available devices tailored to your operating system’s audio architecture (such as ALSA/PulseAudio/PipeWire on Linux, CoreAudio on macOS, or WASAPI on Windows). The output will look similar to this:
List of detected audio devices:
'auto' (Autoselect)
'alsa/hdmi:CARD=NVidia,DEV=0' (HDA NVidia, HDMI 0/HDMI Audio Output)
'alsa/sysdefault:CARD=PCH' (HDA Intel PCH, Default Audio Device)
Forcing the Audio Device via Command Line
Once you have identified the exact string for your desired device
from the list, use the --audio-device flag followed by that
string when launching your media file.
The basic syntax is:
mpv --audio-device=device_name filename.mp4Using the example list from above, if you want to force playback through your HDMI output, your command would look like this:
mpv --audio-device=alsa/hdmi:CARD=NVidia,DEV=0 movie.mkvMaking the Setting Permanent
If you prefer not to type this command line option every time you
open a video, you can add it directly to your mpv configuration file
(mpv.conf).
- Locate your
mpv.conffile (typically found in~/.config/mpv/on Linux/macOS or%APPDATA%/mpv/on Windows). - Open the file in a text editor.
- Add the following line, replacing the value with your specific device string:
audio-device=alsa/hdmi:CARD=NVidia,DEV=0
Saving this change ensures that mpv will automatically route all future audio through your chosen device by default.