May 28
How-to: Enable Surround Sound on Ubuntu Hardy
By default, Ubuntu Hardy Heron uses PulseAudio for audio mixing, which disables surround sound by default. I just bought new 5.1-channel speakers, but I was only heard sound coming from the front two. Disappointed, I went searching for the answer in the forums. If you want surround sound on your Linux setup, keep reading below..
Like I said above, Ubuntu now uses PulseAudio by default, so it dictates the kind of output you’ll be getting from your sound card. Luckily, PulseAudio makes it very easy to enable surround via a simple configuration file. I followed instructions here for editing via the command-line, but using a GUI should be just as easy.
- Press Alt-F2 to open a “Run” dialog, and type “
gksudo nautilus“. This will give us a file-browser with administrator privileges.Warning: With this file browser we have access to do almost anything to our system. Follow these instructions carefully, or things could get bad!
- In the file browser, click on the “File System” icon on the right. Then navigate into the “etc” folder, and then “pulse”. This is the folder where our configuration file lives.
- Make a backup of “daemon.conf”. Do this by selecting the file, copy it, and then paste it in the same directory. Right click the new copy and rename it “daemon.conf.bak”. This is just in case things go wrong– it’ll be easy to revert back to the original settings.
- Now we’re going on edit the settings file. Double-click on “daemon.conf” to open it in a text editor. Remember that we have administrator privileges, so be very careful of the changes you make!
- Find the following line in the file, it should be towards the bottom:
; default-sample-channels = 2First, remove the “;” character to “uncomment” the line. Then change the value from 2 to either 6, for 5.1 surround sound, or 8 for 7.1 surround. For example:
default-sample-channels = 6 - Save the file and exit the text editor and file browser. This is important so we don’t accidentally make more changes with administrator access.
That’s it for the hard part. For the changes to take effect, you will need to restart your computer. Afterwards, there is a simple command that you can use to test your surround sound. Press Alt-F2 to start the “Run” dialog, and enter the command:
speaker-test -Dplug:surround51 -c6 -l1 -twav
or to test 7.1 surround:
speaker-test -Dplug:surround71 -c8 -l1 -twav
This will play a sound from each speaker telling what channel it is set to. You should hear audio out of each one. If you don’t then you may have some of the channels disabled. Check them with the volume manager:
- Right click on the volume meter in the panel and press “Open Volume Control”.
- Make sure the “ALSA” mixer is selected. Go to File, Change Device, and select the one that contains “Alsa Mixer”.
- By default, many of the channels are hidden. Select Edit, Preferences. Make sure you have at least the following selected: Master, Front, Surround, Center, and LFE (and Side if using 7.1 sound)
- Now, make sure none of the channels are muted under the “Playback” tab. If they are, un-mute them.
Then use the test command above to try again.
At this point you should have surround sound working via the test command. However, some applications may also need to be setup to use surround sound. Rhythmbox should play music using surround by default. However, Totem Movie Player needs to be configured for it. To do so:
- Open Totem Movie Player from the Applications menu under Sound and Video, Movie Player.
- Select Edit, Preferences, and click on the “Audio” tab
- Set the “Audio output type” to your surround-sound preference. For example. 5.1-channel.
Other applications or webpages that use Flash may not use surround sound correctly. You can test if an application is using surround sound using the PulseAudio volume meter. To do so, press Alt-F2 to open the “Run..” dialog, and enter the command “pavumeter“. You should see sound in each channel.
I’ve been very happy with my surround sound so far. What experiences have you had? Did these instructions work for you? Are there any other applications you’ve found that don’t work with surround sound? Post in the comments.















June 9th, 2008 at 11:20 am
I wrote -before read this blog- one related article in my blog. “Enabling surround sound in ubuntu” in web:
http://brange.wordpress.com/2008/06/09/enabling-surround-sound-in-ubuntu/
Thank you for information.
Regards
June 16th, 2008 at 1:28 pm
Hey, thanks for the info. I had the same surround sound problem.
June 19th, 2008 at 9:23 pm
Thanks a lot man !!. Such a simple step made sound come out from all of my 5.1 speakers ! you rock !!. But one question though, when i used the command you gave to test my surround sound, the sound came out of my laptop speakers though rhythmbox and totem both played sound from all of my 5.1 speakers.
June 20th, 2008 at 7:33 am
Hi Ajibola,
There’s a few things you can check out:
First of all, make sure that all of your “Sound” settings from the System > Preferences menu is set to “Autodetect”; this should correctly select pulseaudio as the default.
If that doesn’t work out, you may have an advanced configuration that I didn’t consider here. The forum article here has a lot more detail and user responses, which may point you in the right direction. Let me know if you find something useful there, and I’ll update this post!
June 20th, 2008 at 7:41 am
Simply Brilliant … for sooo long I’ve been trying to get 5.1 working on Ubuntu distros
Your detailed and easy to follow instructions (and pulseAudio) had my box booming in no time at all.
Thankyou very much
June 23rd, 2008 at 1:02 pm
Excellent. Had the same problem as described, resolved with this exposé. Thanks a lot!
July 1st, 2008 at 4:52 am
WoW! i finnaly use all of my 5.1 system ! thankyou *_*
July 9th, 2008 at 3:41 am
Don’t work for me, i’m use Ubuntu 8.04 – Hardy Heron, in a motherboard Intel DG33. The line (66 in my file) “; default-sample-channels = 2″ in the file daemon.conf is modified by “default-sample-channels = 6″, but pavumeter still showing only two channels. Suggestions?
July 23rd, 2008 at 5:47 pm
Sweeeeeet!
I’ve recently installed Ubuntu 8.04, and being a noob I’ve been ripping my hair out trying to get things going….. You saved me a lot of hair!
thanks a million
July 25th, 2008 at 11:10 am
Thanks a lot for the post. I was trying for this from few hour but until i get this post i was not able to fix my 5in1 surround speakers work. Now its working and cool.
August 15th, 2008 at 5:47 pm
Very cool!!! now I have 5.1 sound in ubuntu. 10 out of 10 set of instructions. thanks
August 29th, 2008 at 1:15 pm
Thanks a lot. You are the king.
October 27th, 2008 at 3:58 pm
I’ve been trying to get my 7.1 setup to work in Ubuntu but it usually involved some crude hack in asoundrc. Thanks for the instructions! I finally have full surround in Ubuntu ^^
November 3rd, 2008 at 4:53 pm
[...] [Update - finally found this - brilliant] http://www.automaticable.com/2008-05-28/how-to-enable-surround-sound-on-ubuntu-hardy/. [...]
November 3rd, 2008 at 9:42 pm
Thanks! These instructions worked for me, except for two problems: 1) no sound from LFE in speaker test, and 2) master volume control from keyboard no longer works, which it once did when I only had sound from the front 2 speakers.
November 15th, 2008 at 1:48 pm
You saved me man!!! Thanx a lot and keep up the good work!!! (This works also in Ubuntu 8.10)
November 24th, 2008 at 6:05 am
cheers mate, worked perfectly. works in ibex, too.
November 29th, 2008 at 4:34 am
Thanks man, now my surround works too, the only bad think is that I don’t have the same sound quality in linux like in win xp
, I think is something about sound driver, pulse audio never compares to original Creative’s SB driver
.
December 19th, 2008 at 8:37 am
thx mate, thx a lot, great howto
January 2nd, 2009 at 3:14 pm
Thank you *so* much–this works fine in Intrepid, too! I had surround sound in Hardy, but only 2-channel worked after I upgraded to Intrepid this morning. I remembered having to mess with something to get 5.1 working when I first installed Hardy, but forgot what I’d done. Whatever it was, it wasn’t anywhere near as simple as this!
January 19th, 2009 at 10:26 am
Thanks for the workaround, work perfectly on my Intrepid installation and Soundblaster Audigy ZS
January 23rd, 2009 at 2:45 am
I have been fighting audio problems in Ubuntu Hardy for days. I even did a complete reinstall to correct all the mistakes I made following others’ how-tos! In five minutes (including reboot), your instructions solved all of my issues! Got you bookmarked now!
Will subscribe to your email updates, too!
Thank you ever so much!
Yesterday’s a memory; tomorrow’s a dream; LIVE TODAY!
February 8th, 2009 at 9:26 am
Don’t work for me, i’m use Ubuntu 8.04 – Hardy Heron, in a motherboard Intel DG31pr. The line (66 in my file) “; default-sample-channels = 2″ in the file daemon.conf is modified by “default-sample-channels = 4″, but pavumeter still showing only two channels. Suggestions?
February 8th, 2009 at 10:39 am
@Paul: Did you restart your computer? This step is important, because PulseAudio will only read the new settings after it restarts.
February 9th, 2009 at 9:50 am
Ubuntu 8.10 kullanıcısı olarak sorunumu bu makale ile çözdüm.
Teşekkürler…
February 13th, 2009 at 2:58 am
Thank you mate. I also have same problem. But your How to is awesome!
February 16th, 2009 at 4:40 am
i installed ubuntue hardy heron .bt does not get sound in laptop. i have y410 model of lenovo ply help me
March 12th, 2009 at 9:53 am
Nice one mate. I shall try this with my laptop.
March 19th, 2009 at 9:36 am
Dude, you rock! Thanks a lot. Totally fixed my problem
.
March 29th, 2009 at 6:49 pm
Your how-to worked great except for one thing. I set up for 5.1 and when I run the twav file I get sound from front left, front right, rear right, and rear center. The sound for rear left comes out the rear right speaker. I can’t find any logical reason why this should be. Any ideas? BTW, I am running Hardy (8.04).
March 30th, 2009 at 8:24 am
@Baasha: Hmmm, have you checked that all of the cords are plugged into the correct ports, whether it be at the back of your computer and at the hub of your speakers? Aside from that, I’m not familiar with any issues. You may want to look through the thread here:
http://ubuntuforums.org/showthread.php?t=795525
It contains feedback from many users, and might have a mention of your problem.
April 14th, 2009 at 10:08 am
Thank you very much! works perfectly with Linux Mint/Ubuntu and Terratec 5.1 Fun
April 17th, 2009 at 8:30 am
its not working i’ve tried for many times my front speakers only working kindly suggest the same…
April 29th, 2009 at 8:48 am
THANK YOU!!!
ONLY with you intrucciont it worked! I have a REaltek and creative 5.1. And just changing the daemon.conf file it worked!!! thank you thank you!!
May 1st, 2009 at 11:35 am
THANKS! I have Logitech x-530 5.1 and a Realtek AC’97 the central speaker don’t work. please help me! Thanks
May 10th, 2009 at 11:31 pm
Hi, first thanks for the guide!
I have done all that and I hear all my speakers with the speaker-test command… But neither rhythmbox or the media player play in 5.1!!!! (Even after I set the media player to 5.1 surround… rhythmbox doesn’t have any setting.
Do you have any suggestion as to what else could I change?
Thanks in advance!
May 11th, 2009 at 11:50 pm
Haplo – you will need to go in to each audio / video application and set the output to ‘Surround’ or 5.1 … should be in the ‘Edit / Preferences/ …’ menu item(s)
Locky
May 12th, 2009 at 1:16 am
Hi.
I am getting only stereo output on my Creative X-Fi sound card which supports 7.1 surround.
I followed the instructions but it’s still not getting any surround.
The default output is ALSA(OSS).
Thanks in advance for your help!
May 12th, 2009 at 9:10 am
@Locky
Thank you for the advice but, as I’ve said, Rhythmbox doesn’t have any setting to choose surround sound. Movie Player does, but even if selected I only hear 2.0.
The speaker-test command does works and I hear soundcheck from every speaker.
Any other think I could do to make this work?
Thanks again!
May 12th, 2009 at 7:20 pm
Fixed!!!
I enabled the REALTEK audio card (never used it, I use my audigy) and logged in, then several mixers appeared that hadn’t before… Selected the Multichannel Playback ALSA one, from creative, and done!
Thanks anyway
May 13th, 2009 at 8:21 pm
Thanks man…. 5.1 work’s with the TEST speaker-test -Dplug:surround51 -c6 -l1 -twav
mp3 and sounds works..
but i have problems with DVD movies Avis, etc
UBUNTU 9 going into balck SCREEN and freez…
Any one knows how can i fix that problem?
June 1st, 2009 at 2:47 pm
This is a great guide, no doubt and everything went as per plan until the “speaker-test -Dplug:surround51 -c6 -l1 -twav”. The correct channel sound came out of the correct speakers. But Rhythmbox and VLC Player which I used could not figure out which channel was which. Front left came from the rear speaker, back left was muted and LFE was booming even when I kept the LFE volume in ALSA Mixer to zero… any ideas?
June 7th, 2009 at 9:52 am
Thank you for the post. This guide works on ubuntu jaunty (9.04) as well
The pavumeter is not installed by default in jaunty. If I install it via apt-get will I get any problems/conflicts will puslse and alsa mixer? I read somewhere installing pulse causes problems with alsa.
June 15th, 2009 at 11:52 am
Hi Buddy,
Thnx fr this guide, I tried all these things but still I am getting sound only from front speakers & centre one. I hav Dell-studio laptop with 3 sockets for sound one for mic & other 2 for speakers. I use 5.1 in windows successfully with this arrangement. I hav installed ubuntu 9 under Windows. When I run test command, its testing sound only from front left & front right speakers, but while playing music I can hear music from two front speakers & centre also. When I opened volume control & then preferences, there its showing only 3 required options as Master, Front, Surround & its not showing other required options as Centre & LFE & not also line In Oputput. Please give me some suggetions as I am very new to linux.
June 18th, 2009 at 1:43 am
hmmm, I can see line in as output, but thatś what I want because my output speaker is broken, and I need to have a sound through line-in. Do you know what else I have to change. More than this pavumeter dont work for me!
June 18th, 2009 at 1:44 am
I can not see line in as output, this is what I wanted to say.
August 25th, 2009 at 11:24 am
Works great, thanks for putting this up!
January 14th, 2010 at 9:59 am
how to enable 2.1 surround in ubuntu? I set default-sample-channels = 3. but doesn’t work. help me.please….
February 7th, 2010 at 2:37 am
I know this is a bit late considering the date this was posted but i have a bit of a problem with my system. I recently bought a Logitech x-530 5.1 surround set and Ive done every single thing you said on the how to but i still cant get the proper sound. Btw, i have Ubuntu 9.10 and i have a 7.1 surround sound
February 8th, 2010 at 6:03 pm
I have the same Logitech 5.1 speaker system and have the same problem. I have a suspicion that the speakers have nothing to do with it though, as I was able to get 5.1 sound in Ubuntu Hardy with no problem. But now that a lot of people have moved on to Ubuntu 9.10 (Karmic) we can no longer enjoy 5.1. Perhaps it is time to start a new thread about enabling 5.1 in Ubuntu 9.10, if such a thing is possible. I have read some comments in other forums that Pulse Audio is completely broken in 9.10. Is this true Scott?
February 18th, 2010 at 12:47 am
hy it works….but i got a problem after rebot have the setings but no more suround:( and nothing works…i tryed to make again the same thing but nope…don’t work can u help me pls?:D
June 6th, 2010 at 8:30 am
Just open Sound preferences and under the hardware tab, select the 4.x or 5.x profile for your sound card. It should work. Ubuntu has come a long way since Hardy Heron (where I used to fiddle with Alsamixer for hours, argghh)to make surround available.