[mythtv-users] System sound issues

John and Holly Klug j.h.klug at gmx.net
Tue Sep 23 07:53:56 UTC 2008


Allen Edwards wrote:
> On Mon, Sep 22, 2008 at 1:56 PM, Jim Marshall
> <jim_marshall2268 at yahoo.com> wrote:
>   
>> Hello,
>>  I am using mythdora 5.0, I have an ASUS P4S800D-X mobo which has an "ADI AD1888 SoundMax 6 channel audio codec S/PDIF out". I have it hooked up via a coaxial to an Onkyo stereo.
>>
>> In Myth I have it configured to use ALSA:spdif and ALSA: IEC{...}. Sound works fine for Live TV and recorded programs. However; if I try to listen to any Streams or system sounds I hear nothing. The streams play fine (visually) but I hear no sound.
>>
>> Any thoughts on what I can do to get the sound to work in the system?
>>
>> Thanks
>>
>>
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>>
>>     
I use a combination of ALSA, pulseaudio, and iec958/spdif.  I am using 
AMD64.  I use no analog, just SPDIF, and I get flash/youtube to work via 
swfdec (I gave up on Adobe/Macromedia flash with AMD64).  Pulseaudio is 
my default ALSA driver.

Pulseaudio basically moves the sound in real time from iec958/spdif 2 
channel 44KHz to other frequencies and back.  Pulseaudio won't do AC3, 
but at least my stereo AMP understands both AC3 and stereo CD at 44KHz, so 
you will need passthrough for AC3.  Hopefully your receiver plays CD 
sound as well over SPDIF.  My Kenwood does both.  The AC3 light goes on 
and off depending on the source.

Some applications like audacious and VLC can be set to use pulseaudio 
directly.  VLC has an option for passthrough like Myth, so you can skip 
pulseaudio for AC3.  Others packages like swfdec seem to only work with 
ALSA default, and are not configurable.  MythTV won't work with 
Pulseaudio, but will work with the ALSA pulse driver.

I am using gentoo, and these are my programs with sound that I use the most:
pulseaudio 0.9.9
alsa-utils 1.0.16
mythtv 0.21
vlc-0.9.2
swfdec-0.6.6-r1
swfdec-mozilla-0.6.0
audacious-1.4.6

For /etc/pulse/daemon.conf and /etc/pulse/default.pa I only list what I 
changed.  I have the complete /etc/asound.conf file here.

=============
# cat /etc/asound.conf
pcm.pulse {
        type pulse
}

ctl.pulse {
        type pulse
}

pcm.!default {
        type pulse
}

ctl.!default {
        type pulse
}
============
# cat /etc/pulse/daemon.conf
daemonize = yes
    ...
high-priority = yes
nice-level = -11
  ...
realtime-scheduling = yes
realtime-priority = 5
===================================
# cat /etc/pulse/default.pa
  ...
load-module module-alsa-sink device=iec958:0
load-module module-alsa-source device=iec958:0
  ...
### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle
  ...
set-default-sink alsa_output.iec958_0
set-default-source alsa_input.iec958_0
===================================

Myth frontend setup I chose:

Audio output device: ALSA:pulse
Pass through device: ALSA:iec958:{AES0 0x06}

 From what I understand, the default.pa stuff must be determined by 
examining the pulse audio daemon.  The pulseaudio HAL driver is too 
stupid to figure out iec958 on its own, nor will pulseaudio work with 
iec958 without ALSA.

Their is a pulseaudio command called pactl list to get the devices.

On my system:
$ pactl list
klugja at tvscribe /usr/bin $ pactl list
*** Module #0 ***
Name: module-alsa-sink
Argument: device=iec958:0
Usage counter: n/a
Auto unload: no
*** Module #1 ***
Name: module-alsa-source
Argument: device=iec958:0
Usage counter: n/a
Auto unload: no
  ...
*** Sink #0 ***
Name: alsa_output.iec958_0
Driver: modules/module-alsa-sink.c
Description: ALSA PCM on iec958:0 (ALC883 Digital) via DMA
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 0
Volume: 0: 100% 1: 100%
Monitor Source: 0
Latency: 91360 usec
Flags: LATENCY HARDWARE
 ...
*** Source #1 ***
Name: alsa_input.iec958_0
Driver: modules/module-alsa-source.c
Description: ALSA PCM on iec958:0 (ALC883 Digital) via DMA
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 1
Volume: 0: 100% 1: 100%
Monitor of Sink: no
Latency: 0 usec
Flags: LATENCY HARDWARE


 From the output of pactl, we can see the devices are iec958:0 for both 
source and sink.  This gives us the load module device names in default.pa.

The driver names are found under "Name:" in the Sink and source 
descriptions for ICE958.  These must be used to set the default drivers
 in default.pa.  The defaults in pulse audio are for CD quality sound.  
This must not change, or the output of pulseaudio will not be compatible 
with iec958.

The 2nd tricky part is how to get the "AES0 0x02" part.  This is found 
via iecset:

# iecset -c0 audio 1
Mode: consumer
Data: audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm
# iecset -c0 -x
AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x02
# iecset -c0 audio 0
Mode: consumer
Data: non-audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm
# iecset -c0 -x
AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x02

You wan to use the audio 0 or audio off value of AES0 from what I 
understand.

Flash is about half CD frequency (22KHz), so it requires pulseaudio.

Hopefully I have all the details here.



More information about the mythtv-users mailing list