ALSA - no surround playback with mplayer

6,311

Your ideas led me down the right road and I found an alias defined in hdsp.conf, which mplayer likes.

For reference, it's "hdsp_analog" and can be addressed in mplayer's command line:

mplayer -ao alsa:device=hdsp_analog -channels 6 /path/to/media.mov

Thanks every one.

Share:
6,311

Related videos on Youtube

Linux Noob
Author by

Linux Noob

Updated on September 18, 2022

Comments

  • Linux Noob
    Linux Noob over 1 year

    When I run:

    speaker-test -c6
    

    ...everything is fine. I get 5.1 playback.

    However, when I run:

    mplayer -channels 6 "some video with 5.1 audio"
    

    no audio plays. Here is what appears in the terminal:

    ~$ mplayer /var/remote/projects/playback/video/calibration/5.1video/10000_bc-tlr2_h480p.mov 
    MPlayer UNKNOWN-4.4.5 (C) 2000-2012 MPlayer Team
    Playing /var/remote/projects/playback/video/calibration/5.1video/10000_bc-tlr2_h480p.mov.
    libavformat version 53.31.100 (internal)
    libavformat file format detected.
    [lavf] stream 0: video (h264), -vid 0
    [lavf] stream 1: audio (aac), -aid 0, -alang eng
    VIDEO:  [H264]  848x352  24bpp  23.976 fps  2132.4 kbps (260.3 kbyte/s)
    Clip info:
     major_brand: qt  
     minor_version: 537199360
     compatible_brands: qt  
     creation_time: 2008-01-08 00:00:27
     comment: Encoded and delivered by apple.com/trailers/
     comment-eng: Encoded and delivered by apple.com/trailers/
     copyright: © 2008 Warner Bros. Pictures. All Rights Reserved
     copyright-eng: © 2008 Warner Bros. Pictures. All Rights Reserved
     title: 10,000 BC
     title-eng: 10,000 BC
    
    Load subtitles in /var/remote/projects/playback/video/calibration/5.1video/
    
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    libavcodec version 53.60.100 (internal)
    Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
    
    ==========================================================================
    
    Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
    AUDIO: 48000 Hz, 6 ch, s16le, 465.9 kbit/10.11% (ratio: 58238->576000)
    Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
    
    ==========================================================================
    [AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
    [AO_ALSA] alsa-lib: pcm.c:2209:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
    [AO_ALSA] Playback open error: No such file or directory
    AO: [pulse] 48000Hz 6ch s16le (2 bytes per sample)
    Starting playback...
    Unsupported PixelFormat 61
    Unsupported PixelFormat 53
    Unsupported PixelFormat 81
    Movie-Aspect is undefined - no prescaling applied.
    VO: [xv] 848x352 => 848x352 Planar YV12 
    A:   0.1 V:   0.0 A-V:  0.084 ct:  0.004   0/  0 ??% ??% ??,?% 0 0 
    [h264 @ 0xf0c760]Increasing reorder buffer to 1
    A:  75.9 V:  75.9 A-V:  0.000 ct:  0.084   0/  0  4%  0%  0.5% 0 0 
    Truncating packet of size 1173 to 500
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xe953e0]stream 1, offset 0x13dc10b: partial file
    A:  76.3 V:  75.9 A-V:  0.395 ct:  0.084   0/  0  4%  0%  0.5% 5034 0 
    [aac @ 0xf0c760]Input buffer exhausted before END element found
    A:  76.3 V:  75.9 A-V:  0.396 ct:  0.084   0/  0  4%  0%  0.5% 5035 0 
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xe953e0]stream 1, offset 0x13dc5ab: partial file
    A:  76.3 V:  75.9 A-V:  0.396 ct:  0.089   0/  0  4%  0%  0.5% 5035 0 
    
    
    Exiting... (End of file)
    

    The most telling being the line:

    [AO_ALSA] alsa-lib: pcm.c:2209:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
    

    Does anyone know of a way to simply force mplayer to use the same output path that is used by alsa's speaker-test utility?

    Other advice?

    For reference:

    $ aplay -l
    
    **** List of PLAYBACK Hardware Devices ****
    
    card 0: DSP [Hammerfall DSP], device 0: RME Hammerfall DSP + Multiface [RME Hammerfall DSP + Multiface]
    
        Subdevices: 1/1
        Subdevice #0: subdevice #0
    
  • ssmy
    ssmy about 11 years
    That error is just because mplayer by default attempts to use OSS, which is generally not in use on modern Linux systems, and as such the device doesn't exist. It's not related to OP's actual error.
  • Linux Noob
    Linux Noob about 11 years
    I can't seem to target the device this way. When I use alsa:device=hw=0 (or 0.0), I receive an error saying that the card could not be found. I'll post the exact error when back in the office in a couple of days.
  • Linux Noob
    Linux Noob about 11 years
    Here's what I get: $ mplayer -ao alsa:device=hw=0 -channels 6 /var/remote/projects/playback/video/calibration/5.1video/100‌​00_bc-tlr2_h480p.mov [AO_ALSA] Unable to set access type: Invalid argument Failed to initialize audio driver 'alsa:device=hw=0' Could not open/initialize audio device -> no sound. Audio: no sound Any thoughts @CL.? Thanks a lot.
  • CL.
    CL. about 11 years
    The Hammerfall uses an unusual access type that isn't supported by mplayer (or many other programs), so you always have to use plughw instead of hw.
  • Cestarian
    Cestarian about 8 years
    You might want to know that alsa doesn't dmix 5.1 speaker setups by default (means you can only play one sound at a time, e.g. you can't play music and play a game at the same time) there is a workaround for this by manually creating dmix. dl.dropboxusercontent.com/u/18371907/asoundrc ; just in case you ever run into problems.