[pulseaudio-tickets] [PulseAudio] #837: A52 (ac3/Dolby Digital) encoding for SPDIF / Pulseaudio

PulseAudio trac-noreply at tango.0pointer.de
Mon Jul 12 04:26:11 PDT 2010


#837: A52 (ac3/Dolby Digital) encoding for SPDIF / Pulseaudio
----------------------+-----------------------------------------------------
  Reporter:  mcarans  |       Owner:  lennart      
      Type:  defect   |      Status:  new          
 Milestone:           |   Component:  module-alsa-*
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------

Comment(by mcarans):

 Finally I got it all working including a52 Pulseaudio profiles!

 These are the steps on Ubuntu Lucid 10.04 LTS:
 {{{
 1. Open from Pulse source code: src/modules/alsa/alsa-sink.c
 2. Replace: pa_sink_set_max_rewind(u->sink, u->hwbuf_size);      with:
     if(strcmp(u->device_name, "a52") == 0) {
         pa_sink_set_max_rewind(u->sink, 0);
     } else {
         pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
     }
 3. Add Colin's patch:
              if (PA_UNLIKELY((sframes = snd_pcm_mmap_commit(u->pcm_handle,
 offset, frames)) < 0)) {

 +                if (!after_avail && (int) sframes == -EAGAIN)
 +                    break;
 +
                  if ((r = try_recover(u, "snd_pcm_mmap_commit", (int)
 sframes)) == 0)
                      continue;
 4. Compile and install Pulseaudio with udev support: make and sudo make
 install
 5. Edit /usr/local/share/pulseaudio/alsa-mixer/profile-sets/default.conf:
 change a52:%f to a52
 6. Copy /etc/pulse/daemon.conf to ~/.pulse/daemon.conf and ensure it has
 uncommented: default-sample-rate = 48000
 7.  Edit ~/.asoundrc
 8.  Put in it:
 # Encode AC3 -> Directly on hardware
 pcm.Filter_A52Encode {
     type a52
     bitrate 448
     channels 6
     card NVidia
 }

 # Rate Converter to 48kHz, needed for some applications
 pcm.a52 {
     type rate
     slave {
         pcm "Filter_A52Encode"
         rate 48000
     }
 }
 9. Change NVidia to your card's name from: cat /proc/asound/cards
 10. sudo alsa reload
 11. Make sure you do not have a ~/.pulse/default.pa or if you do, that it
 is using load-module module-udev-detect to load Alsa sinks not load-module
 module-alsa-sink ...

 12. pulseaudio -k
 13. pulseaudio -D
 }}}

-- 
Ticket URL: <http://pulseaudio.org/ticket/837#comment:13>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list