About this blog

Saturday, January 9, 2010

Configure 5.1 Channel Sound on Ubuntu-Karmic Koala (for dummies like me!)


UPDATE: The following tutorial also helps set up 5.1 channel audio in Ubuntu Maverick Meerkat as well.
Intro
I recently upgraded to the new Karmic Koala after nearly a year of using Intrepid Ibex (with which I had become quite comfy and so I hadn´t upgraded to Jaunty).
A common problem with most of the earlier Ubuntu versions (previous to Karmic Koala) was the setting up of the sound systems with channels more than 2 (or 2.1 for that matter). This was easily solved by adding a couple of lines in the daemon file for pulseaudio and the alsa-base configuration file for ALSA. With the advent of Karmic Koala, this problem was to be fixed with all the sound profiles etc. which would provide an ¨easier-than-windows¨ approach to setting up your sound.
Hmmm, seems great to read, but it lasted only till I heard/read this stuff, ´cause when I setup Karmic Koala, and changed the sound profile to my setup of 5.1 channel sound, Bam!... still no sound from the rear, center and LFE speakers. So, yet again with this version too, I rolled up my sleeves and set out to...
¨Configure 5.1 Channel Speaker system on Karmic Koala¨ ......

Though the article looks long, the steps are really short cos most of the text is for explaining the steps to myself and keep me from forgetting them ;)
Setup 5.1 channel sound in 5.1 steps (a.k.a. cut to the chase, enough with the intro babble!)
1) Take a backup of the files daemon.conf and alsa-base.conf. (In case you mess something up, cos not everyoneƛ as smart as me.. Most are more! :P)
Daemon.conf is located in the path ¨/etc/pulse/¨
alsa-base.conf is located in ¨/etc/modprobe.d/¨


And yeah, before I move onto the next steps, make sure that you have alsamixer installed in the system
(gtk+ version was found to be more convenient, u can get it from the software center or synaptic or add/remove programs)


2) Open a terminal window and type:
sudo gedit /etc/pulse/daemon.conf

This will open the pulse audio file for editing after you provide your password
Look for the line

;default-sample-channels=2

Remove the ; (this is to uncomment the line) and put the number of speakers which you have after the equals sign and save the file.
In my case, the line looked something like this:




default-sample-channels=6



3) Find the sound card which u have. For that, in the terminal window

cat /proc/asound/card0/codec#* | grep Codec



For me it gave

Codec: Realtek ALC883



4) In the terminal window, type the follwong command:
sudo gedit /etc/modprobe.d/alsa-base.conf

This will open the ALSA configuration file for editing after you provide your password.
Go to the end of the file and add the line

options snd-hda-intel model=3stack-6ch

and save the file.
The value entered after the word model is specific to the configuration which I have i.e Realtek ALC883 with 3 jack setup at the back of the cabinet. If you have a different model or configuration of jacks then you might want to look in the list given at the end of the post for whatever value suits your model.
5) Restart your computer.
5.1) After restart, if you find the sound is still not coming from all your speakers, then open the alsa mixer from under applications--> Sound & Video -->ALSA Mixer, select the 6ch in the channel mode section and make sure none of the output volume controls are muted or turned very low. Type the following command in the terminal command line:
      speaker-test -Dplug:surround51 -c6 -l1 -twav

Conclusion:
Well, your 5.1 channel sound should be up and running by now. If it isn´t, then, theres some other problem with your setup and you might consider giving it a serious diagnostic check up.
As, for the Karmic Koala Ubuntu, it promises a lot of things and in most cases ..it does deliver ...but having labor like this every time I setup my system is downright irritating ..hope u folks at Canonical are listening and righting these wrongs.
I have also made a video tutorial of the steps so as to better illustrate the entire operation.
Video tutorial





List of soundcard model/settings
Soundcard
--------------
Model name Description
---------- -----------
ALC880
3stack 3-jack in back and a headphone out
3stack-digout 3-jack in back, a HP out and a SPDIF out
5stack 5-jack in back, 2-jack in front
5stack-digout 5-jack in back, 2-jack in front, a SPDIF out
6stack 6-jack in back, 2-jack in front
6stack-digout 6-jack with a SPDIF out
w810 3-jack
z71v 3-jack (HP shared SPDIF)
asus 3-jack (ASUS Mobo)
asus-w1v ASUS W1V
asus-dig ASUS with SPDIF out
asus-dig2 ASUS with SPDIF out (using GPIO2)
uniwill 3-jack
fujitsu Fujitsu Laptops (Pi1536)
F1734 2-jack
lg LG laptop (m1 express dual)
lg-lw LG LW20/LW25 laptop
tcl TCL S700
clevo Clevo laptops (m520G, m665n)
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)


ALC260
hp HP machines
hp-3013 HP machines (3013-variant)
fujitsu Fujitsu S7020
acer Acer TravelMate
will Will laptops (PB V7900)
replacer Replacer 672V
basic fixed pin assignment (old default model)
auto auto-config reading BIOS (default)


ALC262
fujitsu Fujitsu Laptop
hp-bpc HP xw4400/6400/8400/9400 laptops
hp-bpc-d7000 HP BPC D7000
benq Benq ED8
benq-t31 Benq T31
hippo Hippo (ATI) with jack detection, Sony UX-90s
hippo_1 Hippo (Benq) with jack detection
sony-assamd Sony ASSAMD
basic fixed pin assignment w/o SPDIF
auto auto-config reading BIOS (default)


ALC268
3stack 3-stack model
toshiba Toshiba A205
acer Acer laptops
auto auto-config reading BIOS (default)


ALC662
3stack-dig 3-stack (2-channel) with SPDIF
3stack-6ch 3-stack (6-channel)
3stack-6ch-dig 3-stack (6-channel) with SPDIF
6stack-dig 6-stack with SPDIF
lenovo-101e Lenovo laptop
auto auto-config reading BIOS (default)


ALC882/885
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
arima Arima W820Di1
targa Targa T8, MSI-1049 T8
asus-a7j ASUS A7J
asus-a7m ASUS A7M
macpro MacPro support
mbp3 Macbook Pro rev3
imac24 iMac 24'' with jack detection
w2jc ASUS W2JC
auto auto-config reading BIOS (default)


ALC883/888
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
3stack-6ch 3-jack 6-channel
3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
6stack-dig-demo 6-jack digital for Intel demo board
acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
acer-aspire Acer Aspire 9810
medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI
targa-2ch-dig Targs/MSI with 2-channel
laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE)
lenovo-101e Lenovo 101E
lenovo-nb0763 Lenovo NB0763
lenovo-ms7195-dig Lenovo MS7195
haier-w66 Haier W66
6stack-hp HP machines with 6stack (Nettle boards)
3stack-hp HP machines with 3stack (Lucknow, Samba boards)
auto auto-config reading BIOS (default)


ALC861/660
3stack 3-jack
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack with SPDIF I/O
3stack-660 3-jack (for ALC660)
uniwill-m31 Uniwill M31 laptop
toshiba Toshiba laptop support
asus Asus laptop support
asus-laptop ASUS F2/F3 laptops
auto auto-config reading BIOS (default)


ALC861VD/660VD
3stack 3-jack
3stack-dig 3-jack with SPDIF OUT
6stack-dig 6-jack with SPDIF OUT
3stack-660 3-jack (for ALC660VD)
3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD)
lenovo Lenovo 3000 C200
dallas Dallas laptops
hp HP TX1000
auto auto-config reading BIOS (default)


CMI9880
minimal 3-jack in back
min_fp 3-jack in back, 2-jack in front
full 6-jack in back, 2-jack in front
full_dig 6-jack in back, 2-jack in front, SPDIF I/O
allout 5-jack in back, 2-jack in front, SPDIF out
auto auto-config reading BIOS (default)


AD1882
3stack 3-stack mode (default)
6stack 6-stack mode


AD1884
N/A


AD1981
basic 3-jack (default)
hp HP nx6320
thinkpad Lenovo Thinkpad T60/X60/Z60
toshiba Toshiba U205


AD1983
N/A


AD1984
basic default configuration
thinkpad Lenovo Thinkpad T61/X61


AD1986A
6stack 6-jack, separate surrounds (default)
3stack 3-stack, shared surrounds
laptop 2-channel only (FSC V2060, Samsung M50)
laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J)
laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
ultra 2-channel with EAPD (Samsung Ultra tablet PC)


AD1988
6stack 6-jack
6stack-dig ditto with SPDIF
3stack 3-jack
3stack-dig ditto with SPDIF
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)


Conexant 5045
laptop Laptop config
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y


Conexant 5047
laptop Basic Laptop config
laptop-hp Laptop config for some HP models (subdevice 30A5)
laptop-eapd Laptop config with EAPD support
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y


STAC9200
ref Reference board
dell-d21 Dell (unknown)
dell-d22 Dell (unknown)
dell-d23 Dell (unknown)
dell-m21 Dell Inspiron 630m, Dell Inspiron 640m
dell-m22 Dell Latitude D620, Dell Latitude D820
dell-m23 Dell XPS M1710, Dell Precision M90
dell-m24 Dell Latitude 120L
dell-m25 Dell Inspiron E1505n
dell-m26 Dell Inspiron 1501
dell-m27 Dell Inspiron E1705/9400


STAC9205/9254
ref Reference board
dell-m42 Dell (unknown)
dell-m43 Dell Precision
dell-m44 Dell Inspiron


STAC9220/9221
ref Reference board
3stack D945 3stack
5stack D945 5stack + SPDIF
intel-mac-v1 Intel Mac Type 1
intel-mac-v2 Intel Mac Type 2
intel-mac-v3 Intel Mac Type 3
intel-mac-v4 Intel Mac Type 4
intel-mac-v5 Intel Mac Type 5
macmini Intel Mac Mini (equivalent with type 3)
macbook Intel Mac Book (eq. type 5)
macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3)
macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3)
imac-intel Intel iMac (eq. type 2)
imac-intel-20 Intel iMac (newer version) (eq. type 3)
dell-d81 Dell (unknown)
dell-d82 Dell (unknown)
dell-m81 Dell (unknown)
dell-m82 Dell XPS M1210


STAC9202/9250/9251
ref Reference board, base config
m2-2 Some Gateway MX series laptops
m6 Some Gateway NX series laptops
pa6 Gateway NX860 series


STAC9227/9228/9229/927x
ref Reference board
3stack D965 3stack
5stack D965 5stack + SPDIF
dell-3stack Dell Dimension E520


STAC9872
vaio Setup for VAIO FE550G/SZ110
vaio-ar Setup for VAIO AR

3 comments:

  1. superb tutorial, just what i wanted. thx for making my ubuntu more awesome. u are cool man. thx again

    ReplyDelete
  2. thnx dude!.. glad to be of help ...keep spreading the word on linux :)

    ReplyDelete
  3. thank u for the wonderful information.

    ReplyDelete