You are not logged in.

#1 2014-06-27 13:27:43

bergqvistjl
Member
Registered: 2011-01-05
Posts: 59

ALSA 5.1 outputting different channels to multiple cards

Hi, I was wondering if it would be possible to, using a 5.1 stream, output the two front channels as stereo through an HDMI card, and the two rear channels as another stereo stream to the 3.5" jack on my PC (ignoring the LFE and Centre channel).

I'd like to have the stereo speakers plugged into the green 3.5" Jack if that's still possible

This is the asoundrc I have that currently outputs audio to both cards simulatenously:

pcm.both {
    type route;
    slave.pcm {
        type multi;
        slaves.a.pcm "plughw:0,0" #STEREO
        slaves.b.pcm "plughw:1,3" #HDMI Card
        slaves.a.channels 2;
        slaves.b.channels 2;
        bindings.0.slave a;
        bindings.0.channel 0;
        bindings.1.slave a;
        bindings.1.channel 1;
    
        bindings.2.slave b;
        bindings.2.channel 0;
        bindings.3.slave b;
        bindings.3.channel 1;
    }   
   
    ttable.0.0 1;
    ttable.1.1 1;
   
    ttable.0.2 1;  
    ttable.1.3 1;  
}

pcm.!default {
        type plug
        slave.pcm "both"
}

ctl.!default {
        type hw
        card PCH
}

and this is the output of aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1708S Analog [VT1708S Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1708S Alt Analog [VT1708S Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and aplay -L

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default:CARD=PCH
    HDA Intel PCH, VT1708S Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, VT1708S Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output

I want to do this just through alsa, not throuh pulseaudio, if possible?

Thanks. Any help would be greatly appreciated

Last edited by bergqvistjl (2014-06-27 13:51:43)

Offline

#2 2014-06-29 19:59:24

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: ALSA 5.1 outputting different channels to multiple cards

What is the outpuit of speaker-test?

speaker-test -c 6 -D default; speaker-test -c 6 -D both; speaker-test -c 6 -D plug:both;

I would try plug pcm plugin directly instead of route. If it should be necessary to use all channels you could try type empty to disable unwanted ones.

Offline

Board footer

Powered by FluxBB