You are not logged in.

#1 2013-07-27 02:03:32

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

[solved] issue on 2-speakers to play .mkv with 5.1 channels

Hi,

I have a .mkv video files seems having 5.1 channels, but i only have 2 speakers and i think only heard 2 of the channels (sometimes only background music with subtitles, or sometimes only voice).
I use alsa+basic GStreamer player (parale), no pulseaudio or other audio dependencies.

Here's my questions:

1. How to confirm the number of audio channels in a .mkv file? (i really don't have extra speakers to plug into the audio panel)
2. I followed some ALSA wikis to downmix the channels into 2, but they don't work. Anyone could give me a link of an accurate setup wiki?
3. If this were not ALSA to downmix the channels, could it be gstreamer or something else? How?

Thanks!

Last edited by enihcam (2013-07-28 01:07:34)

Offline

#2 2013-07-27 05:21:39

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

I use this kind of alsa config for my downmixing needs.
https://github.com/Cloudef/dotfiles-ng/ … sound.conf

Keep in mind though, that some player might do their own downmixing or just reduces the channels (dropping sounds and so), so you need to force them to use the audio's original channel amount.
On mplayer I usually just force this with channels=6 for some sort of 5.1 emulation and it sounds beautiful. (without alsa downmixing, some of the sounds will be on low volume though)

Last edited by Cloudef (2013-07-27 05:25:12)

Offline

#3 2013-07-27 10:20:58

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

Cloudef wrote:

I use this kind of alsa config for my downmixing needs.
https://github.com/Cloudef/dotfiles-ng/ … sound.conf

Keep in mind though, that some player might do their own downmixing or just reduces the channels (dropping sounds and so), so you need to force them to use the audio's original channel amount.
On mplayer I usually just force this with channels=6 for some sort of 5.1 emulation and it sounds beautiful. (without alsa downmixing, some of the sounds will be on low volume though)


Thanks but it doesn't work.

Actually I found a solution:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541786

BUT, this also brings another issue -- it loses ability to play multiple audio file simultaneously. It seems like dmix is disabled.

I'm wondering how to merge this solution with your configuration to get dmix back.

Last edited by enihcam (2013-07-27 10:24:48)

Offline

#4 2013-07-27 10:24:54

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

Check out the pcm.aout block in my configuration, that's dmix.
You should also check out the pcm.asymed, if you want audio input to work as well.

Note that the buffer settings are tuned for my hardware and may not work so well for you.

Last edited by Cloudef (2013-07-27 10:25:35)

Offline

#5 2013-07-27 10:27:13

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

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

enihcam wrote:

It seems like dmix is disabled.

See config in my sig.

Offline

#6 2013-07-27 17:35:23

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

brebs wrote:
enihcam wrote:

It seems like dmix is disabled.

See config in my sig.

dropbox is blocked in China. sad

Offline

#7 2013-07-28 01:09:52

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: [solved] issue on 2-speakers to play .mkv with 5.1 channels

Finally I got vdownmix and dmix both worked, which the following asound.conf:

(pcm.asymed has the core change, i changed 'aout' to 'surround71'.)

defaults.pcm.rate_converter "samplerate_best"

pcm.snd_card {
        type hw
        card 0
}

pcm.aout {
        type dmix
        ipc_key 1
        ipc_key_add_uid false
        ipc_perm 0660
        slave {
                pcm "snd_card"
                channels 2
        }
}

# Audio in
pcm.ain {
        type dsnoop
        ipc_key 2
        ipc_key_add_uid false
        ipc_perm 0660
        slave {
                pcm "snd_card"
                channels 2
        }
}

pcm.!surround71 {
        type vdownmix
        slave.pcm "aout"
}

pcm.asymed {
        type asym
        playback.pcm "surround71"
        capture.pcm  "ain"
}

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

Offline

Board footer

Powered by FluxBB