[MPlayer-users] audio... more than 2 speakers..

Albino albino.antonio at fastwebnet.it
Mon Sep 16 15:44:02 CEST 2002


Arpi ha scritto:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi,
> 
> 
>>it's as simpl as:
>>
>>-get a video with ac3 audio
>>-mplayer file-witth-ac3-audio-avi -channels 4
>>
>>?
> 
> 
> yes, assuming that the ac3 track has 4 (4.0 or 3.1) or more (5.1 etc) channels.
> it can't play 1-ch (mono, 1.0) or 2-ch (stereo, 2.0) ac3 on 4 speakers...
yes he can with a trick, try with a modified version of 
/usr/local/etc/emu-script like this:

you ll'get a routing of front to rear and left right to central, plus a 
sub boost (ugly).
but if you want something better try the attachment, their names are 
self explanatory, and works with all players (not even video required, 
try xmms with some music ;)

I'll even attach an old working with both stereo/mono and ac3 
emu10k1conf and an emu-script, but you must use the ones included in 
http://prdownloads.sourceforge.net/emu10k1/emu-tools-0.9.4.tar.gz?download

goog luck!

------------------ begin -----------------


#!/bin/bash -e
#
#     emu-script  --  A setup script
#
#     Author: Daniel Bertrand
#     Last Update:   Sept 30, 2001
#     Version:       0.7
#
# Description:
# -----------
# You can use this script to automatically configure the card
# on module load
#
# To do so, add the following line to your module.config (or 
conf.module) file
# (and remove the leading '#'):
#
# post-install emu10k1 /usr/local/etc/emu-script
#
# if you want to save mixer levels, you can use the following:
#
# post-install emu10k1 /usr/local/etc/emu-script restore
# pre-remove emu10k1 /usr/local/etc/emu-script save
#
# configuration is done in the file 'emu10k1.conf'
#
# Requirements:
# ------------
# This script needs the following to be installed:
#
# -the emu10k1 tools:
#      emu-config, emu-dspmgr and the dsp .bin files
# -aumix (installed by default on many Linux distros)
#



# Default location of programs:
BASE_PATH=/usr/local
DSPPATH=$BASE_PATH/share/emu10k1

DSPMGR=$BASE_PATH/bin/emu-dspmgr
CONFIG=$BASE_PATH/bin/emu-config

DRIVER_VERSION=` $DSPMGR  -q`

load(){

# Source configurations
   . $BASE_PATH/etc/emu10k1.conf
#set some variables
if [ $USE_DIGITAL_OUTPUT = yes ]; then
     FRONT="Digital"
     CENTER="Digital Center"
     LFE="Digital LFE"
else
     FRONT="Front"
     CENTER="Analog Center"
     LFE="Analog LFE"
fi

##function to enable an input
enable_input(){
     INPUT=$@
     $DSPMGR -a"$INPUT:$FRONT" -a"$INPUT:Rear" -a"$INPUT:$CENTER" 
-a"$INPUT:$LFE"

}
input_volume(){
     INPUT=$1
     VOLUME=$2

     $DSPMGR -p"$VOLUME Vol" -l"$INPUT" -f$DSPPATH/vol_2.bin -c"Vol_L" 
-m"${VOLUME}_l" -c"Vol_R" -m"${VOLUME}_r"
}

#Start by clearing everything and stopping the FX8010
$DSPMGR -x -z


#
# Livedrive and other special inputs can be enabled here by un-commenting
# the appropriate lines
#


if [ $ENABLE_CD_Spdif = yes ]; then
     enable_input "CD-Spdif"
     input_volume "CD-Spdif" "dig1"
fi

if [ $ENABLE_OPTICAL_SPDIF = yes ]; then
     enable_input "Opt. Spdif"
     input_volume "Opt. Spdif" "dig2"
fi
if [ $ENABLE_LINE2_MIC2 = yes ]; then
     enable_input "Line2/Mic2"
     input_volume "Line2/Mic2" "line2"
fi
if [ $ENABLE_RCA_SPDIF = yes ]; then
     enable_input "RCA Spdif"
     input_volume "RCA Spdif" "dig3"
fi
if [ $ENABLE_RCA_AUX = yes ]; then
     enable_input "RCA Aux"
     input_volume "RCA Aux" "line3"
fi

if [ $AC3PASSTHROUGH = yes ]; then
     $DSPMGR -a"fx15:Digital L"
     $DSPMGR -a"fx15:Digital R"
     $DSPMGR -l"Digital" -f$DSPPATH/ac3pass.bin
fi


# Add common routes:

$DSPMGR -a"Pcm1:Rear" -a"Analog:ADC Rec"  -a"Analog:Rear" -a"Pcm:Rear"

#PCM volume gain
$DSPMGR -l"Pcm1" -l"Pcm" -f$DSPPATH/gain_4.bin

#Rear Volume Controls
#$DSPMGR -p"Master R" -l"Rear R" -f$DSPPATH/vol.bin -cVol -mvol_r
#$DSPMGR -p"Master L" -l"Rear L" -f$DSPPATH/vol.bin -cVol -mvol_l
$DSPMGR -p"Rear Vol R" -l"Rear" -f$DSPPATH/vol_2.bin -c"Vol_L" -mogain_l 
-c"Vol_R" -mogain_r

#digital/analog specific setup
if [ $USE_DIGITAL_OUTPUT = yes ]; then

     $DSPMGR -a"Analog:Digital"
     $DSPMGR -p"Digital Vol" -l"Digital" -f$DSPPATH/vol_2.bin -cVol_L 
-mvol_l -cVol_R -mvol_r

     enable_input "Pcm"
     input_volume "Pcm" "pcm"

#bogus routes to "ground" pcm to analog output:
     $DSPMGR -a"fx15:Front"
else
     if [ $INVERT_REAR = yes ] ; then
	$DSPMGR -l"Rear L" -f$DSPPATH/inv.bin
	$DSPMGR -l"Rear R" -f$DSPPATH/inv.bin
     fi
     $DSPMGR -a"Pcm:Front"

# with older driver, pcm:front volume is handle by the ac97 chip
     if [ $DRIVER_VERSION = 0 ]; then
	$DSPMGR -v"Pcm L:Rear L" -mpcm_l
	$DSPMGR -v"Pcm R:Rear R" -mpcm_r
     else
	enable_input "Pcm"
	input_volume "Pcm" "pcm" 	
     fi
fi

if [ $ENABLE_TONE_CONTROL = yes ] ; then

     if [ $DRIVER_VERSION = 0 ] ; then
	TONE=tone-old.bin
     else
	TONE=tone.bin
     fi

     $DSPMGR -l"Pcm L" -f$DSPPATH/$TONE -cbass -mbass -ctreble -mtreble
#The next 3 'inherit' the oss control of the above line:
     $DSPMGR -l"Pcm R" -f$DSPPATH/$TONE
     $DSPMGR -l"Pcm1 L" -f$DSPPATH/$TONE
     $DSPMGR -l"Pcm1 R" -f$DSPPATH/$TONE
     # aumix -t 68
     # aumix -b 68
fi


# Multichannel set-up:
#

if [ $MULTICHANNEL = yes ] ; then

     # 5.1 main routes
     $DSPMGR -a"fx8-9:$FRONT" -a"fx10-11:Rear" -a"fx12:$CENTER" 
-a"fx13:$LFE"

     # Subwoofer += low frequencies from other channels
     $DSPMGR -a"fx8-9:$LFE" -a"fx10-11:$LFE" -a"fx12:$LFE"

     GAIN=$DSPPATH/gain_6.bin

     # Use the full dynamic range of all inputs
     $DSPMGR -l"fx8" -l"fx9" -l"fx10" -l"fx11" -l"fx12" -l"fx13" -f$GAIN
fi



# Need to toggle third output on 5.1 cards

if [ $CARD_IS_5_1 = yes ] ; then
     if [ $USE_DIGITAL_OUTPUT = yes ] ; then
	$CONFIG -d
     else
	$CONFIG -a
     fi
fi

# See if we should enable IR

if [ $ENABLE_LIVEDRIVE_IR = yes ] ; then
      $CONFIG -i
fi

# Restart the FX8010
$DSPMGR -y

}

case "$1" in

	restore | restart)
                 load
		# restore mixer settings
		/bin/aumix-minimal -f /etc/.aumixrc -L  >/dev/null 2>&1 || :
                 ;;
         save | stop)
		# save mixer settings
		/bin/aumix-minimal -f /etc/.aumixrc -S   >/dev/null 2>&1 || :
		;;
         *)
		load
esac




------------------  end  -----------------



-- 

ciao
                                      albino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prologic
Type: application/x-java-vm
Size: 6583 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20020916/38237490/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: surround
Type: application/x-java-vm
Size: 6581 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20020916/38237490/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: emu10k1.conf
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20020916/38237490/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emu-script
Type: application/x-java-vm
Size: 6892 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20020916/38237490/attachment-0002.bin>


More information about the MPlayer-users mailing list