Re: How to downmix 5.1 to stereo?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hello,
> 
> I tried the following in my .asoundrc:
> 
> pcm.51to20 {
>    type route
>    slave.pcm default
>    slave.channels 6
>    ttable.0.0 1      # front left -> left
>    ttable.1.1 1      # front right -> right
>    ttable.2.0 0.707  # back left -> left, gain 3dB
>    ttable.3.1 0.707  # back right -> right, gain 3dB
>    ttable.4.0 0.5    # center -> left, gain 6dB
>    ttable.4.1 0.5    # center -> right, gain 6dB
>    ttable.5.0 0.5    # LFE -> left, gain 6dB
>    ttable.5.1 0.5    # LFE -> right, gain 6dB
> }
> 
> ctl.51to20 {
>    type hw
>    card 0
> }
> 
> After logging in again, I don't have a new device "51to20" in "aplay 
> -L". How does this "asoundrc" work and how to debug it?
> 
> What's the easiest way to make anything, that would go to the back 
> speakers or the center speaker, go to my front stereo speakers?
> 
> Thanks in advance
> 
> Yours
> 
> Manuel

Hello Manuel,

I had a similar problem: I wanted everything to be played back on my
four speaker system without changing the settings of every program that
plays some sound. Your above approach seems correct to me but it
requires you to tell every program to use that pcm you created. Since I
couldn't find the relevant settings in each and every program, I used
the following solution, which should work for you with slight modifications.

First, define a default pcm in your .asoundrc like this:

pcm.upmix
{
    type upmix
    slave.pcm "s51240"
    channels 6
}

ctl.upmix {  type hw  card 0}

pcm.!default
{
    type copy
    slave.pcm "upmix"
}

This tells ALSA to play everything through "upmix" and convert 1-6
channel input to 6-channel output (see
/usr/share/doc/alsa.../upmix.txt). It may seem a bit odd to convert
everything to 6 channels if you only want stereo but this way has the
advantage that you can play stereo and surround movies (and other stuff)
through the same pcm and in the slave pcm of pcm.upmix we only have to
deal with a 6 channel signal regardless of the input.

As slave pcm of upmix I wrote the following (well, actually I also use
some softvol stuff in the middle and removed it here [hope it works]):

pcm.s51240
{
    type  route;

    slave
    {
        pcm "plug:surround51"
        channels 6
    }

    ttable.0.0    1;
    ttable.1.1    1;
    ttable.2.2    2;
    ttable.3.3    2;
    ttable.4.0    1.2;
    ttable.4.1    1.2;
    ttable.4.2    0.7;
    ttable.4.3    0.7;
    ttable.5.0    0.5;
    ttable.5.1    0.5;
    ttable.5.2    0.5;
    ttable.5.3    0.5;
    ttable.5.5    1;
    ttable.4.4    1;
}

Here you do the desired routing to the channels you want. I can't
remember why I used "surround51" instead of "surround40" but as it works
for me I won't change it. I presume you know how the routing stuff
works. You may want to change "plug:surround51" to something like
"plughw:0,0" depending on the soundcard you are using. Hope it works for
you.

Cheers, Jan

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux