Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running version 12.10. My PC has an built-in sound card and 3 usb sound cards of the same type. mplayer works ok for all of them using the argument -ao alsa:device=hw=2.0 for instance. vlc --aout=hw=2.0 does not work. pacmd does not list any card. Starting pulseaudio manually results in Failed to open module "alsa": file not found. hwinfo shows the built-in card only. lsusb shows the connected cards correctly and the corresponding files /sys/class/sound/pcmC?D0p/uevent look ok as well. Please advice.

share|improve this question
    
Regarding VLC, could you be a little more specific than "does not work"? –  CL. Jan 13 '13 at 17:37
    
Sorry, '...not work' means no sound. In the meantime I removed pulseaudio. vlc now connects to alsa and sees all alsa cards available, but it ignores the command line switch 'hw=' and opens the default alsa device, which most likely is the built-in card having no speaker attached. Anyway, it looks like little progress is made, but the target is still unreached... –  khan Jan 14 '13 at 21:00
    
Wow, a typo prevented vlc from using the wanted device: the needed option is --aout hw=2.0 (a blank between aout and hw, no =)... –  khan Jan 14 '13 at 21:11

1 Answer 1

In mplayer's ao option, any : or , characters in the device name must be replaced with = or . to avoid some silly conflicts in the mplayer option parsing code. The actual device name you're using is hw:2,0.

VLC's aout option specifies the audio output module name; the device name would be specified with the alsadev option:

vlc --aout=alsa --alsadev=hw:2,0
share|improve this answer
    
Thank you CL, I tried it. vlc would not accept the option alsadev. It looks like it was renamed to alsa-audio-device. Since 'aply -l' reported card 1: PCM2702 [Burr-Brown Japan PCM2702], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 –  khan Jan 15 '13 at 20:26
    
sorry for breaking the input here –  khan Jan 15 '13 at 20:27
    
aplay list the wanted card as #1, so I tried mplayer with this card using -ao alsa:device=hw=1.0 and it worked. Then I tried vlc using --aout=alsa --alsa-audio-device=hw:1,0 and I got several error messages: cannot open ALSA device "hw:1,0": No such file or directory and The audio device "hw:1,0" could not be used: No such file or directory. Please advice... –  khan Jan 15 '13 at 20:34
    
This may be usefule as well: ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card –  khan Jan 15 '13 at 20:42
    
I guess aplay -D hw:1 something.wav doesn't work either? Are the permissions on the files in /dev/snd/ correct? –  CL. Jan 15 '13 at 23:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.