Solved HDMI, mplayer and the -ao option

Running FreeBSD-10.1, I have a laptop with an HDMI port. Running cat /etc/sndsat gets me nothing, because I just realized I typed etc rather than dev. :) However, running cat /dev/sndstat gives me
Code:
pcm0: <VIA VT1802_1 (Analog 2.0+HP/2.0)> (play/rec)

pcm1: <Intel Panther Point (HDMI/DP 8ch)> (play) default
Now, if I use multimedia/vlc I can select the audio device, from its menu, called pcm1:virtual:dsp1.vp0. Using multimedia/mplayer, however, I have silence unless I use sysctl to change the default audio device. If I run sysctl -a |grep hw.snd.default I get the result of:
Code:
hw.snd.default_unit=0
Which is the laptop's sound card. This is fine, because it's what I usually want. If I run sysctl hw.snd.default_unit=1 I then have sound with mplayer.

In Linux, I can use mplayer -ao alsa:device=hdmi myfile.mp4 to get mplayer to work with sound. So, I am guessing that I'm just misreading or lacking knowledge in the way to use mplayer's -ao option with FreeBSD. I've tried various combinations of -ao oss with device=pcm1, device=hdmi, device=HDMI, and a few others. While it's not a big deal, as it's easy enough to use sysctl, I'm wondering if someone knows the correct options to use with mplayer.

Thanks for any help. I see this thread, https://forums.freebsd.org/threads/xbmc-for-freebsd.3882/, but it doesn't seem relevant to my situation.
 
Sorry, I should have mentioned in my earlier post, that the only thing I see under /dev that seems to be a sound device is /dev/sndstat (and the snd modules are loaded, as I think I've said--as mentioned, sound does work, I just can't figure out the device that the -ao option of mplayer wants.)
 
Right, the device nodes are created by the kernel on demand. If you haven't used the device for sound output yet, /dev/dsp* won't exist until you do. :)
 
Ok, I just tried that, getting a /dev/dsp0.0 and /dev/dsp1.0, (created when I did echo hello > /dev/dsp), but neither worked as a device name.

AND---I'm wrong. That worked. Give me a few minutes to test from scratch and I'll update the post.

By the way, thank you to both of you for the help.
 
Last edited by a moderator:
Ok, to sum up. As I hadn't had need for /dev/dsp* since I came back to FreeBSD, I was unaware of them. Also, the syntax for Linux and FreeBSD seems different, with Linux using mplayer -ao alsa:device=whatever, and using mplayer -ao oss:device=whatever in FreeBSD gave me an error that it couldn't find device device=whatever or something like that.

Using mplayer -ao oss:/dev/dsp1 myfile.mp4 worked perfectly, and created two /dev nodes, dsp0.0 and dsp1.0.

So, you two folks gave me the answer and I thank you.
 
Last edited:
Back
Top