Exploring surround sound in Linux

This is an information post … I’m not really looking for help, although I concede I don’t yet have things configured properly.

Anyway, I finally broke down and purchased a set of 5.1 surround sound speakers (Logitech X-540’s, which have 4xsatellite, 1-center, 1-sub-woofer). I connected them to an ancient (9-year old) athlon-1100 w/1GB RAM running openSUSE-11.1 with KDE-3.5.10 and the “git” alsa-1.0.19. The 9-year old athlon is on an MSI KT3 Ultra motherboard.

When connecting the speakers I pulled out the motherboard manual and noted when connecting a 6 (or 4) channel analog audio to the backpannel connectors, I was to use the Line-Out, Line-In, and Mic for the 5.1 surround sound speakers. I connected the Line-Out to the Front channels, Line-In to the Rear channels and Mic to the Center/Sub-woofer channel. Of course the Line-in and Mic are to function as line outs for surround sound (on this old PC).

I also checked the Logitech X-540 speaker system manual, and it in essence suggested the same connections for the speakers to the PC.

After connecting, and booting to openSUSE-11.1 (KDE-3.5.10) I immediately obtained only 2 channel sound from “speaker-test -c2 -l5 -twav” and also from “speaker-test -c6 -l5 -twav” with sound only coming from front speakers (right/left front) which initially lead me to believe surround sound was not working. Pressing the matrix button on the speaker’s hardware control put 2-channel sound from all 6-speakers, confirming all 6 speakers gave sound (albeit only 2 channel). :slight_smile: … sound was nice :slight_smile:

I then downloaded chan-id.wav file from: http://www.halfgaar.net/media/chan-id.zip and tested it with mplayer and vlc.

I went into smplayer and turned on surround sound. I also tuned kmix (and the mixer settings I noted have a significant input as to what sound comes from what speaker, and the mixer labels don’t always appear to make sense).

With smplayer playing chan-id.wav:

  • Front left => sound from front left & front right speakers
  • Front right => sound from front right speaker
  • Center => simultaneous sound from rear-left, rear-right, center, subwoofer speakers
  • rear left/right => simultaneous sound from rear-left, rear-right, subwoofer, speakers saying different things :slight_smile:
  • rear right => center speaker …

and then played the chan-id.wav with vlc:

  • Front left => Front left speaker
  • Front right => Front right speaker
  • Center => Center and Subwoofer speakers
  • rear left => Rear Left Speaker
  • rear right => Rear Right Speaker
    so vlc replayed the surround sound perfectly.

If kmix has the wrong settings, sound does not come out of some speakers.

“ffplay chan-id.wav” gave something even more different (with sound from some speakers somewhat corrupted). Its possible the mixer needs to be better tuned for ffplay.

I’m puzzling a bit as to the best settings and the differences between players.

This is all mostly a mute point, as I hope to have a new PC in 2 weeks with superior sound, and I’ll move the 5.1 surround sound speaker system over to that pc when it arrives.

This old athlon does not have MS-Windows, so I have no idea as to how these speakers are supposed to behave under Windows.

Anyway, it was nice to play with Linux for an evening, after two wasted evenings helping out winXP wireless problem (and I know nothing about WinXP making that wireless problem even more annoying).

I just wanted to note the page where I obtained some hints for surround sound:
Surround sound in Linux

Thanks for the info and link. I’ll have to look into this. I have 4.1 surround and have not gotten it to work.

:slight_smile:

I was given this command in IRC freenode #alsa to help test all my surround sound system’s channels:
speaker-test -c6 -Dplug:surround51 -t wav -l1 User “gnubien” who has helped me in the past was very helpful. … In fact, I may post selected parts out of that help thread, as it may help others …

Below, for info, is the output of a conversation on IRC channel freenode #alsa, where I obtained help in better tuning my new 5.1 surround sound system. I’ve posted the exchange (with some edits, fixing typo’s and also removing some posts not relevant) …

I hope it is as useful to others as it was to me:

<oldcpu> setup my 1st 5.1 surround system last night and looking for some guidance
<oldcpu> Its a Logitech X-540, on openSUSE-11.1 w/KDE-3.5.10 w/alsa-1.0.19. Motherboard MSI KT3 ultra w/athlon-1100, and sound a VIA-8233A with ALC650D. Alsa script http://www.alsa-project.org/db/?f=53476d3f0fcc29b5314716d8789a85f0435dacc7
<oldcpu> I think I have surround sound working ... but possibly misconfigured
<oldcpu> ... as noted in this thread http://forums.opensuse.org/hardware/413656-exploring-surround-sound-linux.html I get different behaviour between mplayer and vlc when testing.  Also "speaker-test -c6 -l2 -twav" does not work on all 6 channels (only 2 channels).  But chan-id.wav file from here does give me sound in all channels with the different mplayer/vlc behaviour noted:  http://www.halfgaar.net/media/chan-id.zip

<oldcpu> aplay gives only front left / front right sound. ffplay gives good sound for front left/right but distored sound out of remaining.
<oldcpu> Is there any recommended tuning suggested?  ... I'm reasonably happy now .. but always looking for better ways to tune :)
<gnubien> oldcpu run this command to test all your speakers and report you have sound, no sound or errors: speaker-test -c6 -Dplug:surround51 -t wav -l1
<oldcpu> Neat !  all worked except for 4 - center (no sound )
<gnubien> ok
<gnubien> oldcpu: run this: amixer set 'Center',0 80% on
<oldcpu> done
<gnubien> rerun speaker-test -c6 -Dplug:surround51 -t wav -l1
<oldcpu> Neat - sound came from all (ie also from center this time) ... not sure yet if sub woofer gave any sound though ...need to run command again an crawl under desk to listen :) 
<oldcpu> ok .. it "sounds" like I get weak sound from subwoofer during 3-Rear Right, 2-Rear left, and 5-LFE at same time as rear-right speaker and rear-left speaker when then appropriate return sound ...
<oldcpu> I need to learn the proper syntax for those amixer commands :)
<oldcpu> when they appropriately return sound
<gnubien> oldcpu: man amixer
<gnubien> oldcpu: amixer set command is what to read carefully
<oldcpu> gnubien, yep ... looking now. ... I've actually done "man amixer" some months back ... but now that I have a 5.1 system I am more motivated :) ... thanks for the help/guidance
<gnubien> oldcpu: center speakers in alsa and speaker test are subwoofer iirc
<gnubien> amixer set Master,0 100%,100% unmute
<gnubien> amixer set PCM,0 100%,100% unmute
<gnubien> oldcpu: amixer -q sset Master,0 toggle
<oldcpu> the last one switched off front-right and front-left :)
<oldcpu> with current settings .... speaker-test -c6 -Dplug:surround51 -t wav -l1  # I get no sound from 0 - Front Left ; nor sound from 1 - Front Right ; Rear-Left works; Rear-Right works; Center/LFE both give sound from Center.  Subwoofer gives low sound for all but not for 0 - Front Left nor 1-Front Right
<oldcpu> amixer -q sset Master,0 toggle  # switched OFF 0-Front Left and switched OFF 1-Front Right
<oldcpu> It also put a mute sound thru kmix :) 
<oldcpu> mute symbol thru kmix :)
<gnubien> oldcpu: this command will cycle either on or off so run it again: amixer -q sset Master,0 toggle
<gnubien> oldcpu: if the control is off the toggle command will set it on; if off then it will set it to on
<oldcpu> gnubien, neat ... that toggles the two front speakers on / off (and gives the visual mute in kmix)
<gnubien> oldcpu: if on then it will set it to off
<gnubien> yea, handy sometimes
<oldcpu> yes indeed ...
<oldcpu> I can see I have some fun ahead playing with amixer :)
<gnubien> yep
<gnubien> oldcpu http://alsa.opensrc.org/Special:Search?search=surround&go=Go
<oldcpu> ahh ... neat ... lots of reading and tidbits there ! Thx.

OK, this was an smplayer misconfiguration on my part.

I had smplayer’s output audio module set to “alsa”. By changing it to “alsa (0.0 - VIA8233A)” sound comes out the same as that in VLC. So I had smplayer configured inexactly ! Most interesting … I didn’t realize it was that important to have exactly tuned. :slight_smile:

oldcpu wrote:

>
> oldcpu;1979857 Wrote:
>> I then downloaded chan-id.wav file from:
>> http://www.halfgaar.net/media/chan-id.zip and tested it with mplayer and
>> vlc.
> I just wanted to note the page where I obtained some hints for surround
> sound:
> ‘Surround sound in Linux’
> (http://www.halfgaar.net/surround-sound-in-linux)
>
>

Thanks for that oldcpu, just setup a 7.1 system that needs a couple of
tweaks to get spot on that last link looks good to me.


Mark

Nil iligitimi carborundum

I connected my 5.1 system to my new PC, which has an Asus P6T motherboard with an AD2000B (according to hardware specs). The alsa-info.sh script identifies that as an AD1989B.

The 5.1 test commandspeaker-test -c6 -Dplug:surround51 -t wav -l1 does not work. (It freezes in the konsole at the first channel).

And the test command:speaker-test -c6 -l5 -twavonly yields 2 channel sound.

But when downloading the file:
http://www.halfgaar.net/media/chan-id.zip
and unzipping and playing that in mplayer and smplayer I get 5.1 surround sound.

So it appears 5.1 works on this motherboard under alsa, but I am puzzling a bit on it.

oldcpu adjusted his/her AFDB on Sunday 17 May 2009 08:16 to write:

>
> I connected my 5.1 system to my new PC, which has an Asus P6T
> motherboard with an AD2000B (according to hardware specs). The
> alsa-info.sh script identifies that as an AD1989B.
>
> The 5.1 test command::speaker-test -c6 -Dplug:surround51 -t wav
> -l1 ::does not work. (It freezes in the konsole at the first
> channel).
>
> And the test command:::speaker-test -c6 -l5
> -twav::only yields 2 channel sound.
>
> But when downloading the file:
> http://www.halfgaar.net/media/chan-id.zip
> and unzipping and playing that in mplayer and smplayer I get 5.1
> surround sound.
>
> So it appears 5.1 works on this motherboard under alsa, but I am
> puzzling a bit on it.
>
>

oldcpu,

I have setup my sound hardware on a gigabyte board with 7.1 surround all 7
speakers are connected, normal 5.1 through a 5.1 amp and the side through a
spare pair of “normal” amplified comp speakers.

it is an ATI Technologies Inc SBx00 Azalia (Intel HDA) chipset, all the
channels are listed in the mixer and work well, however I have found that
some tests work and some do not, the normal test wav will sometimes output
nothing or just through the front speakers even if I use the option for all
of them.

i think the old adage of “If it ain’t broke don`t fix it” is the way here.

I have not looked into it much but maybe the rear and side speakers only
kick in when the sound being played is “Dolby” and this is decoded through
the card hardware or the apps software??

I could be talking out of my rear ( speakers ) here as sound systems is not
my strong point.

:wink:


Mark

Nullus in verba
Nil illigitimi carborundum

I have not updated this thread in a long time. In fact, this test command works great now on my new PC with a 64-bit openSUSE-11.1 with KDE-3.5.10 and the 2.6.27.29 kernel

speaker-test -c6 -Dplug:surround51 -t wav -l1 

… and with the following alsa packages installed:

alsa-plugins-1.0.18-6.13
alsa-docs-1.0.20-46.1
alsa-oss-32bit-1.0.17-1.37
alsa-plugins-pulse-1.0.18-6.13
alsa-oss-1.0.17-1.43
alsa-driver-kmp-default-1.0.20.20090822_2.6.27.29_0.1-1.1
alsa-utils-1.0.18-6.4
alsa-1.0.20-46.1

One of the kernel updates (from 2.6.27.9 to 2.6.27.29) caused me problems with the audio, which is why I updated (and installed) the 1.0.20 alsa driver and supporting packages. I probably could have updated the remaining, but I thought since it worked, there was no sence in trying to break it. :slight_smile: I think the 1.0.20 of alsa works better on my PC than the older 1.0.17/1.0.18 (only) worked.

I am not getting the rear or the subwoofer speakers to work. Presently I have installed this as my .asoundrc file and that does not work. I am using OpenSuse 13.1 and I have tried speaker-test -c6 -Dplug:surround51 -t wav -l1.
.asoundrc
pcm.!default {
type plug
slave.pcm “surround51”
slave.channels 6
route_policy duplicate
}

The sound card is creative labs x-fi USB card. I have tried the spdif but that did not work so now I have the hard wire analog
connection.

I do not use a .asoundrc file for the sound on my hardware. Its not needed. My surround sound just works.

I note you have a Creative Labs X-FI USB card. My recollection is support for this is problematic at best due to a significant lack of support from Creative. I recommend you not waste any time on this - and instead immediately write a bug report on openSUSE surround sound with your openSUSE-13.1 version. There is guidance here wrt writing bug reports: http://en.opensuse.org/openSUSE:Submitting_bug_reports . You can log on to bugzilla with your openSUSE forum user name and password. Be certain to run the diagnostic script alsa-info.sh and include as an attachment to your bug report the text output from that script. Do not waste your time referencing a forum thread in your bug report as the alsa sound driver developer(s) who work for SuSE-GmbH will not read a forum thread. You can run the diagnostic script by opening a terminal and sending the command:


/usr/sbin/alsa-info.sh --no-upload

That will tell you where it copied the diagnostic output and you can copy that to your bug report.