LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Alsa, surround sound and so on.... (http://www.linuxquestions.org/questions/linux-hardware-18/alsa-surround-sound-and-so-on-240677/)

BedriddenTech 10-09-2004 03:15 PM

Alsa, surround sound and so on....
 
Hello!

Again, it's me. :) Like many people before, I want my four analogue speakers to be a surround40 device *and*, whenever I play from a stereo (and not a surround source), they all four playing this sound.

I already had this question, and some member suggested to use the device "surround40"; but this device though enables this capativity, but plays the stereo source only on my front speakers. I played a bit around with the .asoundrc file, and had this solution in the end:

Code:

# Duplicate a stereo source to the rear speakers
pcm.ch40dup {
        type route
        slave.pcm surround40
        slave.channels 4
        ttable.0.0 1
        ttable.1.1 1
        ttable.0.2 1
        ttable.1.3 1

}

# do a rate conversion since 44100 is played to fast
pcm.rate48000 {
        type rate
        slave.pcm ch40dup
        slave.rate 48000
}

Now, this works, and quite nice, for example when playing mp3's with xmms. But! ;) I'm not sure whether this would "kill" any real surround sound, e.g. when watching a DVD. I cannot test, since I don't know how (the only thing I could do was looking for a surround sound file, but I found none). Could please anybody answer this, and, perhaps, provide a solution that would not overwrite any surround sound source (if my solution does this).

I'm a totally ALSA :newbie: and am thankful for every piece of help :)

swatikiss 01-04-2005 12:05 AM

i am confused about the .asoundrc file

what must i specify in xmms to use the fake surround sound settings??

is this under the "Audio device" or "mixer device" settings for ALSA config ??

Thanks!

Electro 01-04-2005 02:56 AM

You will have to specify rate48000 in the default. Then every program will use it if you use alsa as the sound device. If your sound card does not do any hardware mixing, you have to use dmix. For 6 channel output (5.1), you have specify alsa and the surround51 device. In some programs you may have to specify six channels. No, this will not effect a 6 channel output from a video or audio like a DVD movie. The alsa library ttable just copies the audio, so you are not getting real simulated surround sound. You have to delay and decrease volume for the rear channels. You can use the code below but delay will have to be done by a circuit because the ladpa filter plugins does not support multi-channels. The code below is just a volume change. Instead of 1 or 100% for the volume, it will be 0.75 or 75% of volume for the rears. The front channels will be untouched.

Code:

# Duplicate a stereo source to the rear speakers
pcm.ch40dup {
        type route
        slave.pcm surround40
        slave.channels 4
        ttable.0.0 1
        ttable.1.1 1
        ttable.0.2 0.75
        ttable.1.3 0.75

}

A primitive of adding delay is to use sealed (acoustic suspension) type speakers for the front and vented (bass reflex) for the rears. The vented box type has about 30 ms or more for the delays. The sealed is about 5 ms to 15 ms. Doing this way, you do not have to worry about adding delays because the different box types will do it for you.

If you are not using bipole (rear) or dipole (side) speakers for the rears, make sure the speakers are not directly pointing at the listening center. The rear channels only gives ambient sound which means the rears should be first bouncing off an diffused material and then at the listening area to get the full effect of surround sound.

Sorry I went off topic, but a lot of people setup surround sound systems wrong.

BedriddenTech 01-04-2005 07:50 AM

So, physically, what effect does this have (except that the rear speakers have little lower volume)? I don't get the point, sorry :(

/EDIT: "0.75" as value doesn't work ("Invalid....") :scratch:

Electro 01-04-2005 04:47 PM

The rear channels should not be as loud as the front channel. Think of a lamp shade versus a lamp with out a lamp shade. The lamp with a lamp shade gives out ambient light which will be like the rear channels. The front channels will be like the lamp without a lamp shade that outputs all light .

I used 0.75 for the rear channels and I have no problems with it.

SlackerLX 01-04-2005 05:14 PM

Be sure that all LFE channels is in [off] position if you have 5.1 speaker system!
*LFE channel is to create emulation of 5.1 matrix for 4 speakers systems

BedriddenTech 01-05-2005 10:02 AM

Electro: So with 0.75 you create the effect of reflection instead of a 2nd source, like in a concert hall, the music reflects from the wall behind you?

Electro 01-05-2005 06:14 PM

The 0.75 or 75% of volume for the rears makes it easier to hear the audio better instead of most of the frequencies be canceled if 1.0 is used. This is not concert hall because there is no set delay and reverb.

The lines below will simulate theater like setting that A/V Prologic Recieivers will give you.

type route
slave.pcm surround51
slave.channels 6
ttable.0.0 0.9
ttable.1.1 0.9
ttable.0.2 0.75
ttable.1.3 0.75
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5

4 is center channel and 5 is subwoofer. Though there is no low-pass filter for the subwoofer channel, so you have to use an active low-pass filter (op-amp or transistors) on the line out jack or use a passive low-pass filter (capacitors and inductors) on the subwoofer amplifier output. Also you will have to create a device that will do delay and reverb effects for the rear channels.

I have not come up a way to only transfer a channel through a ladpa low-pass and delay filter using ALSA.

BedriddenTech 01-06-2005 06:40 AM

Why dont you post those settings on alsa-project.org? I was, like many others, searching for stuff like that before, that's why I posted my solution to this problem


All times are GMT -5. The time now is 11:31 PM.