LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   alsa + Nforce2(Realtek ALC650) + 5.1 surround question (https://www.linuxquestions.org/questions/linux-hardware-18/alsa-nforce2-realtek-alc650-5-1-surround-question-547628/)

captainkrypto 04-20-2007 12:00 PM

alsa + Nforce2(Realtek ALC650) + 5.1 surround question
 
Hey everyone,

This is kind of a generic question regarding my audio setup since I don't have access to my system ATM. I have a Shuttle SN41G2 that has onboard Nvidia Nforce2 audio that uses the Realtek ALC650 chipset. I have compiled and installed the latest alsa drivers (1.0.14rc3). The installation was successful and I am able to get sound from all 6 speakers. The problem I am having is when I am trying to play a 5.1 test file that should produce a test sound from each speaker... here are the ones I used: http://wiki.hydrogenaudio.org/index....e=Multichannel I'm not sure where the problem lies... I've tried various .asoundrc files that claim to have working 5.1 that I've found around the net to no avail. When I play the file through mplayer, I specify alsa and to use 6 channels. The output reports 6 channels, but the output from the speakers is incorrect. For example, the file plays the sound "Left Rear", but the audio comes out of the right front... yes, I've checked that the speakers are plugged in properly ;) Another problem comes up when I play 2 channel audio... the audio comes out of all speakers except the center. I am very familiar with linux, but don't have too much experience with configuring sounds card since most of the time it just works... so

-Can anyone recommend where I should begin to troubleshoot the configuration problem?
-Does anyone have a working 5.1 /etc/asound.conf and/or /etc/asound.state file for the ALC650 chipset?

I'm sorry if this sounds vague, but I am away from my computer. I can post any info that might be relevant when I get home.

Any insight would be appreciated.

Thanks,
Dave

netcrawl 04-20-2007 12:46 PM

Have you tried speaker-test, included in alsa-utilities?

captainkrypto 04-20-2007 05:17 PM

Thanks for your reply. Based on you suggestion, I stumbled upon my answer. I used this from the alsa wiki: http://alsa.opensrc.org/SurroundSound and followed the directions on how to use surround with jack...

On Fedora 6 with 2.6.20-1.2944.fc6 kernel

Here is what I did based on the guide:

Installed Jack:

Code:

yum install jack-audio-connection-kit
Edit /etc/asound.conf (or ~/.asoundrc) like so:

Code:

ctl.jack51 {
    type hw
    card 0
}

pcm.jack51 {
    # "asym" allows for different
    # handling of in/out devices
    type asym
    playback.pcm {
        # route for mmap workaround
        type plug
        slave.pcm "surround51"
        slave.channels 6
        route_policy duplicate
    }
    capture.pcm {
        # 2 channels only
        type hw
        card 0
    }
}

Edit /etc/asound.state like so:
Code:


state.nForce2 {
        control.1 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Master Playback Switch'
                value true
        }
        control.2 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'Master Playback Volume'
                value.0 29
                value.1 29
        }
        control.3 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Center Playback Switch'
                value true
        }
        control.4 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 31'
                iface MIXER
                name 'Center Playback Volume'
                value 31
        }
        control.5 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'LFE Playback Switch'
                value true
        }
        control.6 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 31'
                iface MIXER
                name 'LFE Playback Volume'
                value 31
        }
        control.7 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 2
                iface MIXER
                name 'Surround Playback Switch'
                value.0 true
                value.1 true
        }
        control.8 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'Surround Playback Volume'
                value.0 31
                value.1 31
        }
        control.9 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Master Mono Playback Switch'
                value true
        }
        control.10 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 31'
                iface MIXER
                name 'Master Mono Playback Volume'
                value 28
        }
        control.11 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'PC Speaker Playback Switch'
                value true
        }
        control.12 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                iface MIXER
                name 'PC Speaker Playback Volume'
                value 0
        }
        control.13 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Phone Playback Switch'
                value true
        }
        control.14 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 31'
                iface MIXER
                name 'Phone Playback Volume'
                value 0
        }
        control.15 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Mic Playback Switch'
                value true
        }
        control.16 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 31'
                iface MIXER
                name 'Mic Playback Volume'
                value 0
        }
        control.17 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Mic Boost (+20dB)'
                value false
        }
        control.18 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Line Playback Switch'
                value true
        }
        control.19 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'Line Playback Volume'
                value.0 27
                value.1 27
        }
        control.20 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'CD Playback Switch'
                value true
        }
        control.21 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'CD Playback Volume'
                value.0 27
                value.1 27
        }
        control.22 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Video Playback Switch'
                value true
        }
        control.23 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'Video Playback Volume'
                value.0 0
                value.1 0
        }
        control.24 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Aux Playback Switch'
                value true
        }
        control.25 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'Aux Playback Volume'
                value.0 0
                value.1 0
        }
        control.26 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'PCM Playback Switch'
                value true
        }
        control.27 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 31'
                iface MIXER
                name 'PCM Playback Volume'
                value.0 28
                value.1 28
        }
        control.28 {
                comment.access 'read write'
                comment.type ENUMERATED
                comment.count 2
                comment.item.0 Mic
                comment.item.1 CD
                comment.item.2 Video
                comment.item.3 Aux
                comment.item.4 Line
                comment.item.5 Mix
                comment.item.6 'Mix Mono'
                comment.item.7 Phone
                iface MIXER
                name 'Capture Source'
                value.0 Mix
                value.1 Mix
        }
        control.29 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Capture Switch'
                value false
        }
        control.30 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 2
                comment.range '0 - 15'
                iface MIXER
                name 'Capture Volume'
                value.0 0
                value.1 0
        }
        control.31 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name '3D Control - Switch'
                value true
        }
        control.32 {
                comment.access 'read write'
                comment.type ENUMERATED
                comment.count 1
                comment.item.0 Mix
                comment.item.1 Mic
                iface MIXER
                name 'Mono Output Select'
                value Mix
        }
        control.33 {
                comment.access 'read write'
                comment.type ENUMERATED
                comment.count 1
                comment.item.0 Mic1
                comment.item.1 Mic2
                iface MIXER
                name 'Mic Select'
                value Mic1
        }
        control.34 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                iface MIXER
                name '3D Control - Center'
                value 15
        }
        control.35 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 15'
                iface MIXER
                name '3D Control - Depth'
                value 15
        }
        control.36 {
                comment.access read
                comment.type IEC958
                comment.count 1
                iface MIXER
                name 'IEC958 Playback Con Mask'
                value '0fff000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000'
        }
        control.37 {
                comment.access read
                comment.type IEC958
                comment.count 1
                iface MIXER
                name 'IEC958 Playback Pro Mask'
                value cf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000
        }
        control.38 {
                comment.access 'read write'
                comment.type IEC958
                comment.count 1
                iface MIXER
                name 'IEC958 Playback Default'
                value '0082000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000'
        }
        control.39 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'IEC958 Playback Switch'
                value false
        }
        control.40 {
                comment.access 'read write'
                comment.type INTEGER
                comment.count 1
                comment.range '0 - 3'
                iface MIXER
                name 'IEC958 Playback AC97-SPSA'
                value 0
        }
        control.41 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Duplicate Front'
                value false
        }
        control.42 {
                comment.access 'read write locked'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Surround Down Mix'
                value false
        }
        control.43 {
                comment.access 'read write locked'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Center/LFE Down Mix'
                value false
        }
        control.44 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Exchange Center/LFE'
                value true
        }
        control.45 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Swap Surround Slot'
                value false
        }
        control.46 {
                comment.access 'read write'
                comment.type ENUMERATED
                comment.count 1
                comment.item.0 Shared
                comment.item.1 Independent
                iface MIXER
                name 'Surround Jack Mode'
                value Shared
        }
        control.47 {
                comment.access 'read write locked'
                comment.type ENUMERATED
                comment.count 1
                comment.item.0 '2ch'
                comment.item.1 '4ch'
                comment.item.2 '6ch'
                iface MIXER
                name 'Channel Mode'
                value '6ch'
        }
        control.48 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'IEC958 Capture Switch'
                value false
        }
        control.49 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'Analog to IEC958 Output'
                value false
        }
        control.50 {
                comment.access 'read write'
                comment.type BOOLEAN
                comment.count 1
                iface MIXER
                name 'External Amplifier'
                value false
        }
}

Start jackd:

Code:

jackd -d alsa --device jack51 -C -r 44100 -p 128 -n 2 -d hw

Hope that helps someone...

Electro 04-20-2007 08:17 PM

People these days do not know surround sound. Also they do not know that surround sound can color sound too much making it horrible. Copying a two channel source to all channels is not surround sound. I recommend do not use surround sound for two channel sources. If you insist converting two channel sources to multiple channels to simulate surround sound, read the following links.

http://www.linuxquestions.org/questi...d.php?t=471139
http://www.linuxquestions.org/questi...ad.php?t=55236

I made created 5.1 file named surround51test.ac3. Run it in mplayer and use the channels option to tell it to output six channels.

Soon I will take a stab at using ladspa plugins for each individual channel to produce better surround sound.

You do not need jack to play surround sound. Also you should not edit asound.state because it changes every time you adjust the volume through alsamixer or amixer.

ALSA version 1.0.14 is still experimental. I suggest downgrading to 1.0.13.

captainkrypto 04-22-2007 12:07 PM

Electro, thanks for the reply (albeit somewhat condescending). A few notes on what you said:

-I can't install alsa version 1.0.13 due to a bug when compiling
-I posted the asound.state more so people would know what boxes I checked.

I would love to have surround sound working in the correct way, but at this point, I would be happy just to have sound coming out of all of the speakers... and the correct speakers. I've tried various .asoundrc files with mixed results. My biggest problem now is when I play the sample file Electro posted I get sound coming out the incorrect speakers. I play the sample file with the command: "mplayer -channels 6 surround51test.ac3" I get the following output from my speakers:

FL coming out of FL
FR coming out of FL
C coming out of center
RL coming out of RL & RR
RR coming out of RL & RR
LFE coming out of LFE

How do I modify this behavior? I've tried several .asoundrc files and I get the same results. Thanks in advance...

netcrawl 04-22-2007 01:26 PM

What results, if any, did you get using speaker-test?

Electro 04-22-2007 02:29 PM

The utility speaker-test does not work for all sound cards.

Put "3D Control", "3D Center", and "3D Depth" to 0 or false. Also change "Surround Jack" to independent might work better than shared. For recording or listening from MIC or Line in or CD enable External Amplifier. Please post the print out that amixer outputs instead what /etc/asound.state contains.

If you can or you have an open PCI slot, buy a PCI sound card like Turtle Beach Santa Cruz or any sound card based on VIA Envy 1724. These are the easiest to setup multiple channel output. Also they are very easy to setup to record. On-board sound cards that shares their connectors to be either an output or an input are very hard to configure and control.

I do not have any trouble compiling ALSA 1.0.13, so I do not know what bug you are complaining about. If you post this error too, I or someone else could give you hints.

captainkrypto 04-23-2007 09:00 AM

Hey guys. Thanks for the replies and suggestions. I've been trying to get this sound card to work with surround sound ever since I got the computer so I'm pretty much fed up with it at this point. I'm going to take Electros advice and get a new sound card. Unfortunately, the Shuttle SN41G2 only has one PCI slot which I'm using for a tv capture card, so I think I will have to go the USB route.

-Does anyone have any recommendations for an inexpensive 5.1 USB sound card?

Electro 04-23-2007 01:35 PM

USB for a sound card does not work well because it is not designed to handle constant throughput which multimedia needs. I suggest go with IEEE-1394 (aka Firewire or i.Link). Firewire is meant for multimedia. If you have a Firewire support, take out the video capture card and place a PCI sound card. Use Canopus ADVC110 as a video capture device.

You could get something like the following link.
http://www.cyberresearch.com/store/c...600_3227.2.htm

captainkrypto 04-23-2007 03:51 PM

I've done some research on the options I have. Adding a PCI expansion seems a bit pricey... $800+ was the cheapest I found. I also looked into a USB or Firewire sound card interface. The firewire interfaces were fairly expensive as well... $100+. Finally, it seems from what little info I found that the USB sound cards were complicated to configure and people were having problems getting the 5.1 output from them... that would put me back at square one ;) Anyway, one last option I am looking into is getting a surround receiver from ebay and hooking it up to the SPDIF out. I found this .asoundrc on: http://alsa-project.org/alsa-doc/doc...odule=intel8x0

Code:

pcm.nforce-hw {
type hw
card 0
}

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

#0,0 is analog out (i.e. headphone socket on the shuttle), and 0,1 is
#spdif out.

pcm.nforce {
type dmix
ipc_key 1234
slave {
pcm "hw:0,1"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}

ctl.nforce-hw {
type hw
card 0
}

Please correct me if I am wrong, but if I feed everything out through the SPDIF out into the surround receiver, then the receiver will handle outputting the correct channels for 5.1 surround?

Electro 04-23-2007 04:45 PM

Fooling around getting SPDIF working with every program will be hard and time consuming. I suggest take out the video capture card and use a sound card like M-Audio Revolution 7.1 in its place. Then use Canopus ADVC110 as your video capture device. I think mplayer will be able to playback from Canopus ADVC110.

IMHO, eBay is good for non-electronics but buying electronics may not work as it should be. I like buying electronics as brand new instead of used. Look at ubid (I saw in a TV commercial). They may provide better warranty and better package/shipping.

captainkrypto 04-23-2007 06:34 PM

I'm trying to get this done as inexpensively as possible, so I'm trying to get the most for my money.

The TV capture card is essential to this system. It is a dedicated front end MythTv(http://www.mythtv.org) system. The 5.1 surround sound is a nice thing to have, but without the tuner card... I think I am going to go the surround receiver route since there is only 2 programs that would need to be configured for spdif... mplayer and xine. From my research, configuring them for spdif for those programs seems pretty straight forward...

With a surround receiver, I will also be able to get surround from my DirecTv box and my DVD player as well.


All times are GMT -5. The time now is 12:37 AM.