How to fix a range of sounds problems in Linux / Ubuntu and enable Dolby / DTS over SPDIF

For the record I am trying to persuade Ubuntu 10.04 to spit out Dolby ac3 compressed digital signal via the SPDIF at the back of my Asus R1F tablet laptop. The spdif works out of the box!! An amazing achievement! However, I cant for the life of my persuade any content to be sent to my receiver as Dolby Digital. I have not quite given up yet but the answer still eludes me. The SPDIF will only send a sterio signal and will only reproduce a 5.1 setup when the compressed stream to sent to an external receiver. As far as I am aware there is no way to encode information on the fly and then send as 5.1.. which is a shame. I have the alc6660vd chip in the R1F.

One of the many things I have tried is to reinstall the ALSA sound system and associated utilities. This is a major pain in the ass. Just about every guide I found required a new google at every step to over come the next difficulties.

Having finally reinstalled the whole system I then stumbled across a post which explained everything and pre-empts all the gotchas that I had to battle through.

the post in its original setting can be found here : http://ohioloco.ubuntuforums.org/showpost.php?p=4136189&postcount=2

Please note that none of this is required with ubuntu 10.04 as SPDIF works out of the box.

A useful command to test your speakers

speaker-test speaker-test -Dplug:iec958 -c6 -t wav -f40

UPDATE – I have finally got it all working.. Following this information I was able to listen to fully Dolby and DTS surround sound.

The problem was that i did not get surround sound from my Toslink optical cable. Only stereo. My soundcard is Xplosion 7.1 something..
Well first i didn’t get sound at all but then i enabled IEC958 output from ALSA mixer that i installed from ubuntu software center.
Now i hear stereo sound.

Now for 5.1 passthrough.
Before you remove anything and mess up everything try this. Launch VLC, go to options -> Audio. Enable”Use S/PDIF when available” AND select Output device. “Default” is NOT okay here. You need to choose ALSA audio output. Default is something else i don’t know. This will probably work for other players if they let you choose the output. But for example the normal “movie player” doesn’t work with DTS or DD for me.
This is how i got it working.. other stuff i did was:
I removed the pulseaudio stuff from my system by launching “Ubuntu Software Center” and searched for pulseaudio and removed all packages i saw.
This step might not be necessary.
And in GNOME ALSA Mixer i have enabled IEC958 5V, IEC958 Copyright and IEC958 Output.
And if you go to System -> Pref -> Sound -> Hardware tab . It is okay that it says “Digital output Stereo”. VLC will still play in 5.1 DTS or DD because its passtrough, and youtube clips will play in stereo but also through optical cable.

If this didn’t work, reeboot and try in VLC again.

————————————————————
RJ Hythloday,

I used this to get SPDIF output working on my laptop in Gusty… Here’s the procedure for installing version 4.07a of the driver in Ubuntu 7.10. NOTE: Be careful not to paste commas or periods into the terminal.

1. Go System => Administration => Software Sources => Updates and put a checkmark next to Pre-released Updates. Check for and install any updates.

2. Then restart your computer, just to be safe.

3. Download the Realtek HD audio driver for Linux to your desktop (click on link). From here

4. Right-Click on the downloaded archive and choose Extract Here.

5. Open a terminal window and type sudo apt-get install linux-backports-modules-generic build-essential gettext libcunit1-ncurses libcunit1-ncurses-dev libncurses5 libncurses5-dev, and press enter.

6. Just to be safe, restart your computer again.

7. Open the terminal again and type cd /home/YOURUSERNAME/Desktop/realtek-linux-audiopack-4.07a, then press enter. Obviously, substitute your own username where I have written YOURUSERNAME. This will move you inside the driver folder.

8. Type sudo /etc/init.d/alsa-utils stop, then press enter. Then type sudo /etc/init.d/alsasound stop, and press enter. The first one should definitely work. The second may not work now, but it will eventually. NOTE: If asked to reload your speaker icon during either of these steps, say no.

9. Type sudo ./install, and press enter. Watch your computer as it installs the driver.

10. If there are not any errors in the installation process, you should be greeted by a screen asking you to select you audio device. Choose the one the talks about Intel HD Audio (ICH7), or similar.

11. Restart your computer.

12. Open the terminal again and type cat /proc/asound/card0/codec#* | grep Codec, and press enter. This should tell you what kind of sound you have. In my case, the result was Realtek ALC660-VD. WARNING: Your modem may also show up in these results. So be sure that you are about to choose the sound and not the modem by doing some research online.

13. Look at the list below to determine the abbreviation for your sound card. For example, my Realtek ALC660-VD is represented by 3stack-660-digout.

14. Type sudo gedit /etc/modprobe.d/alsa-base, and press enter. A file with some text should open.

15. Go to the last line of text and type options snd-hda-intel model=YOURMODEL. So for example, I have typed options snd-hda-intel model=3stack-660-digout. Be sure to save your changes by going File => Save!

16. Restart your computer so that your sound can reload itself.

17. I had to do steps 7-16 twice in order to get a successful installation of the audio driver.

18. To get your speaker icon back on your panel (also called a taskbar), Right-Click on the top panel and choose Add to Panel => System & Hardware => Volume Control => left-click on the Add button. Right-Clicking on a pane icon will allow you to move it around, or lock it into position.

19. THIS OPTION IS ONLY IF YOUR COMPUTER SUPPORTS SPDIF. Now, right-click on the speaker icon and choose Open Volume Control. The title of the Volume Control window should either have ALSA or OSS in it. Either way, go Edit => Preferences. If you are in ALSA, look for an option like IEC958. Choosing that will place on option in the Switches tab; placing a checkmark in the box there will activate SPDIF sound. It’s fine to leave SPDIF on at all times if you want to do so. If you ever need to know about OSS, you can get there by going File => Change Device in Volume Control. On my computer, OSS calls SPDIF Digital-1. If selected, it will appear in the Playback tab of OSS.

20. Each program will behave differently with SPDIF audio. Movie Player (Totem) behaves very well. In Movie Player, you can activate full digital surround sound (Dolby Digital, DTS, etc) by going Edit => Preferences => Audio and choosing AC3 Passthrough from the drop-down menu. On the other hand, some audio-related options within the VLC media player can wreck the sound on your entire system! The good news is, you can always fix any damaged caused by VLC by repeating the above steps. Just be careful…

The following are webpages where I found all of this information:

Here is a list of audio devices: Please note that in my case none of this was required with Ubuntu 10.04
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

Tags: , , , , , , , , , , , , ,

September 17th, 2010 | linux

Leave a Reply