You are not logged in.

#1 2005-12-11 15:47:12

Neuro
Member
From: Poland
Registered: 2005-10-12
Posts: 352

Mplayer -channels switch auto?

Hi,

Well uhm... I've been fighting with this for a long time, searched the net multiple times and haven't found a solution to this yet.

I use mplayer for my video playback and I have Audigy 1 with a 5.1 speaker arrangement.

For some video files containing only 2 channels, when I specify -channels 2 on the command line (or don't specify anything at all) both supplied channels are routed to all speakers by ALSA (left > left+rear_left, right>right+rear_right, left+right>center, LFE gets the bass).

But when I play an AC3 5.1 file, I need to explicitly supply the -channels 6 argument. That way, mplayer plays the supplied 6 channels directly to ALSA (wuithout rerouting)  and everything is fine. But when I don't supply the -channels 6 argument to mplayer, the AC3 channels are downrouted to only 2 channels and then are rerouted by ALSA like the an usual 2 channel file above (thus loosing all the nice surround effect of the file).

However, if I try to play a 2 channel file using the -channel 6 argument,  only the right and left speakers play, ALSA doesn't do any rerouting (which I'd like to have).

What I'd like to have, is a situation when mplayer knows wether to put ALSA into 6 channel mode (and not allow it to do any rerouting) or the 2 channel mode (with rerouting). Something like an -channels auto parameter, but I haven't found any.

Is there a way to do it?

Offline

#2 2005-12-13 12:50:20

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 620
Website

Re: Mplayer -channels switch auto?

I guess so

Add an alias in your ~/.bashrc file like that one (adapt it to your needs) :
alias mplayer6='mplayer -channels 6'
That way when you run 'mplayer6' you'll launch mplayer with 6 channels smile

There might be something to try with Alsa but this just overcome my knowledge :oops:


PGP Key: 1C2A554EFF0157D9
Core i3 @3.30GHz | 4GB RAM | Arch linux-ck
Atom N450 | 2 gig RAM | Arch linux 4.6.0rc3 i686 / 4.07 x86_64 (5-6H battery life smile * ARM Tegra K1 | 4 gig RAM | Chrome OS
Atom Z520 | 2 gig RAM | OMV (Debian) kernel 3.16.0-0.bpo.4-586 on SDHC

Offline

#3 2005-12-14 17:52:54

Neuro
Member
From: Poland
Registered: 2005-10-12
Posts: 352

Re: Mplayer -channels switch auto?

True, but that doesn't solve my problems.

What I want to avoid is looking at the output log to see if the file has got 2 or 6 channels. If I already do that, typing "mplayer6" instead of "mplayer -channels 6" is hardly an improvement, isn't it? wink

I'd like to know if there is a way of making mplayer autodetect the number of channels in the file and adjust the -channels attribute accordingly.

Offline

Board footer

Powered by FluxBB