Alternative ALSA device in MPlayer

pulseaudio usually handles my sound cards just fine, but sometimes I want to play a video in
mplayer while a song is playing in mpd — just on different devices.
To find out which cards are available:
julio@julio-acer ~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC269 Digital [ALC269 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
To change the device, just play the video with the -ao parameter, as in the example:
- Sound through the headphones:
mplayer Koyaanisqatsi (1982).mkv -ao alsa:device=hw=0.0 - Sound through the TV:
mplayer Koyaanisqatsi (1982).mkv -ao alsa:device=hw=0.3
More information at: Alsa

I’m a Brazilian computer engineer based in Germany, passionate about tech, science, photography, and languages.
I’ve been programming for about two decades already, exploring everything from mobile apps and web development to machine learning. These days I focus on cloud SRE and data engineering.
I volunteer in the open source and Python communities, helping organize PyCon DE and PyData Berlin, mentoring, and contributing with code and translations.
On my blog, I share Linux tips, setup guides, and personal notes I’ve written for future reference. I hope others find them helpful as well. The content is available in multiple languages.
Browse my gallery for some of my photography.
Away from the keyboard, you’ll find me at concerts, playing clarinet, cycling, scuba diving, or exploring new places, cultures, and cuisines.
Always happy to connect! 🙂