S/Pdif / digital output not available in pulseaudio

Bug #205717 reported by Ari
52
This bug affects 5 people
Affects Status Importance Assigned to Milestone
PulseAudio
Fix Released
Unknown
pulseaudio (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: pulseaudio

Hardy beta, clean install.

ALSA sees the integrated sound card in my system and its analog and digital outputs, with no problem:

 aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

However, pulseaudio is only using the Analog output.
Also, pavucontrol only shows the analog output device (ALC883 Analog).

I think this is a bug, there seems to be no way to have pulseaudio output to the digital (s/pdif / ie958) sink.

This: http://www.pulseaudio.org/ticket/139
may have something to do with this.
 I followed the instructions:
           - added the following line to /etc/pulse/default.pa:
               load-module module-alsa-sink device=hw:0,1 ## Card 0, Device 1
           - Kill and restart the audio server:
               pulseaudio -k
               pulseaudio -D

Now the digital output shows up in pavucontrol, and the applications that use pulse also use the digital output. All this shouldn't be needed (output to digital by default) or at least an easier digital output activation is necessary.

Thanks

Revision history for this message
murphy2 (murphy-murphynet) wrote :

Same problem here -> confirmed.

Changed in pulseaudio:
status: New → Confirmed
Changed in pulseaudio:
status: Unknown → New
Revision history for this message
Sébastien Valette (sebastien-valette) wrote :

Hi,

similar proble on my NFORCE2 board. The difference with Ari is that I had to add:

load-module module-alsa-sink device=hw:0,2 ## Card 0, Device 2

instead (my spdif out is on device 2....)

Revision history for this message
murphy2 (murphy-murphynet) wrote :

Hi,

Allthough I can see my Digital Subdevice now, I still don't hear any sound, when I move the stream from the Analog to the Digital Card.

A fix or even a working workaround would be great..

Revision history for this message
Victor Engmark (victor-engmark) wrote :

I'm having similar problems. Here's some relevant shell output:

I'm trying to play on the digital device:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: AD198x Digital [AD198x Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

So I set up Pulseaudio:
$ grep alsa-sink /etc/pulse/default.pa
load-module module-alsa-sink device=hw:0,1

But now I can't start the daemon:
$ pulseaudio -vD
I: main.c: Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:
I: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us priviliges. Dropping SUID again.
I: main.c: For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
I: main.c: Note that real-time/high-priority scheduling is NOT normally required. If you experience crackling or other sound anomalies, consider one or more of the above solutions.
I: main.c: High-priority scheduling enabled in configuration but now allowed by policy. Disabling forcibly.
E: main.c: daemon startup failed.

OK, adding group:
$ sudo addgroup username pulse-rt
Adding user `username' to group `pulse-rt' ...
Adding user username to group pulse-rt
Done.

But no luck:
$ pulseaudio -vD
[same error as before]

If I change /etc/pulse/default.pa to use device "0,0" the daemon starts, but of course I don't get any digital output.

PS: Using the "AD198x Digital" device in gnome-sound-properties kinda works, but with no sound mixing (yes, ESD is turned on).

Revision history for this message
Victor Engmark (victor-engmark) wrote :

The fix is in! http://ubuntuforums.org/showthread.php?p=4451132 worked for me - Playing 5.1 Dolby Digital sound via S/PDIF with hardware mixing right now (DVD in SMplayer and MP3 in Rhythmbox).

Revision history for this message
mario64 (nzekwe) wrote :

I have problems with my audio. I can't hear audio from youtube and the video gets stuck and doesn't play. And also i cannot simultaneously play audio on hardy and online. Just won't work. i've tried changing the sound settings but nothing works.

Revision history for this message
Matt LaPaglia (mlapaglia) wrote :

I don't think Ubuntu sees the Digital part because of this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/216563

I'm not sure.

Revision history for this message
f4hy (bmfahy+bug) wrote :

The linked bug for pulseaudio http://www.pulseaudio.org/ticket/139 is indeed the problem.

It does not seem to be a high priority for the team over there, so if anyone knows anything about SPDIF adding support to pulseaudio would be great.

In the mean time there should be an easy way for users to opt out of using pulseaudio either at install or a way to revert back to restore support for the many users with digital sound.

Revision history for this message
Achim (ach1m) wrote :

You can follow this discussion to see were the problems are.

https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-May/001863.html

If you use SPDIF for AC3 decoding then you don't need pulseaudio.
For example you can configure VLC to use ALSA and SPDIF. That is no problem.
If you use pulseaudio you only get a 2 channel signal if you put a stream on the digital output.
The Multichannel support in pulseaudio is working great for me.
Totem and Gstreamer are doing the rest.

I have followed the instructions above to see my digital output in pulseaudio but I don't really need it.
So there should be no problems, that couldn't be solved.

regards
Achim

Daniel T Chen (crimsun)
Changed in pulseaudio:
importance: Undecided → Wishlist
Changed in pulseaudio:
status: New → Fix Released
Daniel T Chen (crimsun)
Changed in pulseaudio:
status: Confirmed → Fix Committed
Revision history for this message
Achim (ach1m) wrote :

This is fixed in karmic with the latest pulseaudio and gnome-audio-properties.

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Rogerio (rogeriodiver-ubuntu) wrote :

Sorry, but it isn't fixed. :-(

Pulseaudio has only "digital stereo output". It still doesn't support the SPDIF passthrough.

*****************************************************************

Extra information:
---------------------

1) lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

2) apt-cache policy pulseaudio
pulseaudio:
  Instalado: 1:0.9.18-0ubuntu3
  Candidato: 1:0.9.18-0ubuntu3
  Tabela de versão:
 *** 1:0.9.18-0ubuntu3 0
        500 http://archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

3) aplay -l
**** Lista de Dispositivos PLAYBACK Hardware ****
placa 0: Intel [HDA Intel], dispositivo 0: ALC888 Analog [ALC888 Analog]
  Dispositivo secundário: 1/1
  Dispositivo secundário #0: subdevice #0
placa 0: Intel [HDA Intel], dispositivo 1: ALC888 Digital [ALC888 Digital]
  Dispositivo secundário: 1/1
  Dispositivo secundário #0: subdevice #0
placa 0: Intel [HDA Intel], dispositivo 3: INTEL HDMI [INTEL HDMI]
  Dispositivo secundário: 1/1
  Dispositivo secundário #0: subdevice #0

Changed in pulseaudio (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Achim (ach1m) wrote :

Rogerio,

the bug description was never talking about passthrough. So I would say you should fill a new bug.
The problem, that you wasn't able to choose the output at all is now fixed.

Also take a look at Lennarts blog.
http://0pointer.de/blog/projects/lpc-bluez-maemo-2009.html

Codec handling is one of the features that is on his todo list.

Regards
Achim

Changed in pulseaudio (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Rogerio (rogeriodiver-ubuntu) wrote :

Achim,

Thanks for your explanation!

I will create a new bug about the SPDIF passthrough.

Regards,
Rogerio

Revision history for this message
Id2ndR (id2ndr) wrote :

Achim,

I read you explanation but I can't get it working like expected.

I run my tests on Ubuntu 9.10 and 10.04 alpha2.
I configure VLC with "use S/PDIF if possible" and totem with "direct AC3 output".
I chose "analog duplex" profile for my usb terratec MKII sound card on gnome-volume-control.

When I play a dolby-digital sample vob file, I get stereo sound trough my optical connexion. This is strange because this happen even when "digital output" profile isn't used. Is it my sound card that create a digital stereo stream ?

Is there a way to get more information about what kind of stream is sended by the system through the digital output ?

Revision history for this message
Achim (ach1m) wrote : Re: [Bug 205717] Re: S/Pdif / digital output not available in pulseaudio

> Achim,
>
> I read you explanation but I can't get it working like expected.
>
> I run my tests on Ubuntu 9.10 and 10.04 alpha2.
> I configure VLC with "use S/PDIF if possible" and totem with "direct AC3 output".
> I chose "analog duplex" profile for my usb terratec MKII sound card on gnome-volume-control.
>
> When I play a dolby-digital sample vob file, I get stereo sound trough
> my optical connexion. This is strange because this happen even when
> "digital output" profile isn't used. Is it my sound card that create a
> digital stereo stream ?

If you only get stereo sound, this can have several reasons.
1. the vob file only has Dolby Digital 2.0.
2. the sound gets resampled by pulseaudio.

Totem with gstreamer is not able to pass-through dolby-digital.
VLC with "use S/PDIF if possible" and Alsa should work.

Make sure that you don't use PulseAudio as output in VLC.

I also had to restart VLC to get it working.

> Is there a way to get more information about what kind of stream is
> sended by the system through the digital output ?

You can use this file as test.
http://www.lynnepublishing.com/surround/www_lynnemusic_com_surround_test.ac3

I hope this information is helpful

Regards
Achim

Revision history for this message
Id2ndR (id2ndr) wrote :

I trouble to solve several troubles :

1/ When I kill pulseaudio, it is launch by applications that need sound. I managed to get a "working alsa output" by removing vlc-plugin-pulse package, set output to alsa in VLC, kill gnome-volume-control-applet, pulseaudio -k, and the run VLC again. At this step I think the next trouble prevent me to get it working.

2/ I have 2 sound cards in my system so by disabling pulseaudio the first sound card is used (a stereo intergrated card). So I removed the module used by integrated sound card to get only this $ LANG=C aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Aureon51MkII [Aureon5.1MkII], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

=> Running VLC with your sample file give me no sound output at all on my amplifier.
I ran these tests on Ubuntu 10.04 alpha2 only.

The informations you've added helped me to understand what happened, even if I can't get it working yep, so thanks.

Is there a way to check how alsa detect my optical output ?

Revision history for this message
Achim (ach1m) wrote :

Am Montag, den 18.01.2010, 23:06 +0000 schrieb Id2ndR:
> I trouble to solve several troubles :
>
> 1/ When I kill pulseaudio, it is launch by applications that need sound.
> I managed to get a "working alsa output" by removing vlc-plugin-pulse
> package, set output to alsa in VLC, kill gnome-volume-control-applet,
> pulseaudio -k, and the run VLC again. At this step I think the next
> trouble prevent me to get it working.
>
> 2/ I have 2 sound cards in my system so by disabling pulseaudio the first sound card is used (a stereo intergrated card). So I removed the module used by integrated sound card to get only this $ LANG=C aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 1: Aureon51MkII [Aureon5.1MkII], device 0: USB Audio [USB Audio]
> Subdevices: 1/1
> Subdevice #0: subdevice #0
>
> => Running VLC with your sample file give me no sound output at all on my amplifier.
> I ran these tests on Ubuntu 10.04 alpha2 only.
>
> The informations you've added helped me to understand what happened,
> even if I can't get it working yep, so thanks.
>
> Is there a way to check how alsa detect my optical output ?

I think at this point it is better to ask the question at the alsa ML or
Pulseaudio ML.

Regards
Achim

Revision history for this message
Id2ndR (id2ndr) wrote :

I managed to get it working on a sample by doing this :

1/ Download the smallest file from examples at http://www.sr.se/multikanal/english/e_index.stm
2/ $ aplay -D iec958:CARD=Aureon51MkII,DEV=0 dolby/SURROUNDTEST_011212.wav
=> My amplifier correctly displayed that it is an DTS sample and I get surround sound.

I founded more information on this page: http://alsa.opensrc.org/index.php/DigitalOut

I keep trying to get better results (playing a movie sample) an I will report here the explanations if it success.

Revision history for this message
Id2ndR (id2ndr) wrote :

As the title of this bug is about digital output but not especially AC3 output (surround sound with dolby digital or DTS), I just created a new bug for this : bug #520157

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.