You are not logged in.

#1 2010-06-21 10:18:43

DoDoENT
Member
Registered: 2010-06-09
Posts: 23

Yet another ALSA mix problem

Hello everyone!

I was following this wiki article for setuping the ALSA for allowing multiple programs to play sound simultaneously.

The problem is that if I aplay a file with -Dplug:dmix parameter, I can play more files simultaneously, but this plugin allows me only two channels of playback, and I have 5.1 surround system.

So I've tried creating my own asound.conf file which will describe the 6-channels dmixer.
The problem is: if I play file with amarok, and while playing aplay a wav in terminal, aplay prints no error, as if there is no playback problems. However, I can't hear the aplayed file.

Here is my /etc/asound.conf:

pcm.!default "surround"

pcm.zvucna {
    type hw
    card 0
}

pcm.monoup {
    type route
    slave.pcm "dmixer"
    slave.channels 6
    ttable.0.0 1
    ttable.0.1 1
    ttable.0.2 1
    ttable.0.3 1
    ttable.0.4 1
    ttable.0.5 1
}

pcm.stereoup {
    type route
    slave.pcm "dmixer"
    slave.channels 6
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

pcm.surround {
    type route
    slave.pcm "dmixer"
    slave.channels 6
    ttable.0.0 1
    ttable.1.1 1
    ttable.2.2 1
    ttable.3.3 1
    ttable.4.4 1
    ttable.5.5 1
}

# used by aoss
pcm.dsp0 {
    type plug
    slave.pcm "dmixer"
}

pcm.dmixer {
    type dmix
    ipc_key 83484784
    ipc_key_add_uid 0
    ipc_perm 0666
    slave {
        pcm "zvucna"
        channels 6
        period_time 0
        period_size 1024
        buffer_time 0
        buffer_size 8192
        rate 48000
    }
    bindings {
        0 0
        1 1
        2 2
        3 3
        4 4
        5 5
    }
}

ctl.dmixer {
  type hw
  card 0
}

Please help me if you can.


Smile! It makes people wonder what you are thinking about...

Offline

#2 2010-06-21 10:27:00

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Yet another ALSA mix problem

DoDoENT wrote:

this plugin allows me only two channels of playback

Of course - it's meant for exactly 2 channels, by default.

I have 5.1 surround system

But you're not explaining the input - 2-channel music?

I expect you want my upmix_20to51.

For an "improved dmix", see thread.

Last edited by brebs (2010-06-21 10:27:33)

Offline

#3 2010-06-21 10:29:49

DoDoENT
Member
Registered: 2010-06-09
Posts: 23

Re: Yet another ALSA mix problem

Thank you for such a quick answer.

I have one question more:

if I use your upmix 20to51, will I be able to play real 6-channel audio sources (surround from movies, 6-channel wavs, etc) ?


Smile! It makes people wonder what you are thinking about...

Offline

#4 2010-06-21 11:54:32

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Yet another ALSA mix problem

Yeah, it's compatible with dmix. Or at least, it's compatible with a dmix that actually works. I use:

slave.pcm dmixed:6

Where "dmixed" is defined in the thread I just gave you.

Offline

#5 2010-06-21 13:35:44

DoDoENT
Member
Registered: 2010-06-09
Posts: 23

Re: Yet another ALSA mix problem

brebs wrote:

Yeah, it's compatible with dmix. Or at least, it's compatible with a dmix that actually works. I use:

slave.pcm dmixed:6

Where "dmixed" is defined in the thread I just gave you.

I've tried that and all other solutions in thread you've given me, but still I can't play more file simultaneously.

I'll try with OSS or with PulseAudio. ALSA made my hair grey.


Smile! It makes people wonder what you are thinking about...

Offline

Board footer

Powered by FluxBB