[mythtv-users] Desperately need help with digital audio

Shane Ludwig thierry at wru.org
Sun Oct 26 22:16:48 UTC 2008


Hello,

I'm new to MythTV, new to Ubuntu, and fairly new to Linux in general, although
I've been an AIX and Solaris admin for about 16 years.  A friend introduced me
to the wonder of MythTV, and I excitedly dove in.  However, after *months* of
trying to get this blasted thing to work, if it weren't for the fact that I've
already sunk so much time, energy, and money into it, I'd throw it out the
window.

The latest issue is sound.  I have a Barracuda Razer card and it works to
varying degrees, but I can't seem to get all the pieces together at once.
I'm sure it can be remedied by setting the proper values, but after reading
umpteen tutorials, wiki sites, docs, etc., and trying every combination I can
think of, I still can't get it to work the way I'd like it to, and I'm lost
and frustrated.

I want everything to come out of one cable, the S/PDIF connector, and go into
my receiver.  Certainly sounds simple enough. :-)  

I'm hoping someone can look at my configuration below and tell me *exactly* 
and clearly what needs to be put where to make that happen, because I've tried
so many bloody tutorials, I don't know which way is up anymore.

In the MythTV General settings options for Audio, I have tried setting
"Audio output device" to ALSA:default, ALSA:iec958, ALSA:spdif, ALSA:spdif:0,
ALSA:digital, ALSA:mixed-digital, /dev/dsp, and /dev/adsp, all to no avail.  

In combination, I tried setting the next option for "Passthrough output device"
to Default, default, ALSA:default, ALSA:spdif, ALSA:spdif:0, ALSA:iec958:{
AES0 0x02 }, ALSA:iec958:{ AES0 0x04 } and ALSA:iec958:{ AES0 0x06 }.

I have tried setting the "Max audio channels" to Stereo and 5.1.  "Upmix" is
set to Active Linear.  I tried Passive as well.  I have tried checking and
unchecking the AC3 passthrough option, as well as the DTS passthrough
option.  I have tried setting the Use internal volume controls off and on.

Outside of MythTV, I can get sound out of the analog output (via 1/8" mini
headphone <--> RCA cable) for files with mp3 audio (48000 Hz,  2 channels,
0x55 = MPEG Layer-3) using:  
mplayer -fs -zoom -quiet -vo x11 file.avi

For files with AC3 (48000 Hz,  2 channels,  0x2000 = AC-3 ACM Codec), I can 
get sound of of the spdif connector by using:
mplayer -fs -zoom -quiet -vo x11 -ao alsa:device=spdif -afm hwac3 file.mkv

However, when using that set of options, I don't get any sound out of any 
output for video files with mp3 audio.

I tried setting both of those as options command line options to mplayer
in MythTV under "Player Settings" with similar results as running mplayer
directly from the command line, so that bit works.

Likewise, 
# aplay -D plug:spdif:0 /usr/share/sounds/alsa/*.wav
works beautifully and sends the sound out the spdif connector.

So how do I get myth (or mplayer within myth) to play both AC3 and non-AC3
out of the spdif connector ?  And how do I set it so that I don't have to
go in and change my mplayer settings every time I want to play a video
depending on what audio codec it uses ?  That's a major PITA.

As an aside, DVDs played via the "Optical Disks" menu in MythTV don't give me
any sound at all.  Myth is apparently using xine to play DVDs.  After digging
around on the net, I tried setting the following in my ~/.xine/config:
audio.output.speaker_arrangement:Pass Through 
but I still get errors in the mythfrontend.log.  

However, I'd first like to get files playing correctly as that's what I would
like to use Myth for the most.

My configuration is as follows:
Compaq Presario SR2020NX
Mythbuntu Latest Hardy Heron

# uname -a
Linux binky 2.6.24-19-generic #1 SMP Wed Aug 20 17:53:40 UTC 2008 x86_64 GNU/Linux

Audio details from lshw:
        *-multimedia
             description: Multimedia audio controller
             product: CMI8788 [Oxygen HD Audio]
             vendor: C-Media Electronics Inc
             physical id: a
             bus info: pci at 0000:03:0a.0
             version: 00
             width: 32 bits
             clock: 33MHz
             capabilities: pm bus_master cap_list
             configuration: driver=CMI8788 latency=32 maxlatency=24 mingnt=2 module=snd_oxygen

# cat /proc/asound/pcm
00-01: Digital : Digital : playback 1 : capture 1
00-00: Analog : Analog : playback 1 : capture 1

I ran alsactl names and got...

# cat asound.names:

ctl {
        alsactl1 {
                name hw:0
                comment 'Physical Device - C-Media Oxygen HD Audio (rev 2) at 0xac00, irq 18'
        }
}
pcm {
        alsactl1 {
                name default:0
                comment 'Abstract Device - Default Device (Duplex)'
        }
        alsactl2 {
                name plug:default:0
                comment 'Abstract Device With Conversions - Default Device (Duplex)'
        }
        alsactl3 {
                name front:0
                comment 'Abstract Device - Front Speakers (Duplex)'
        }
        alsactl4 {
                name plug:front:0
                comment 'Abstract Device With Conversions - Front Speakers (Duplex)'
        }
        alsactl5 {
                name 'hw:0,0'
                comment 'Physical Device - Analog (Duplex)'
        }
        alsactl6 {
                name 'plughw:0,0'
                comment 'Physical Device With Conversions - Analog (Duplex)'
        }
        alsactl7 {
                name 'hw:0,1'
                comment 'Physical Device - Digital (Duplex)'
        }
        alsactl8 {
                name 'plughw:0,1'
                comment 'Physical Device With Conversions - Digital (Duplex)'
        }
        alsactl9 {
                name surround40:0
                comment 'Abstract Device - Front and Rear Speakers (Duplex)'
        }
        alsactl10 {
                name plug:surround40:0
                comment 'Abstract Device With Conversions - Front and Rear Speakers (Duplex)'
        }
        alsactl11 {
                name surround51:0
                comment 'Abstract Device - Front, Rear, Center and Woofer (Duplex)'
        }
        alsactl12 {
                name plug:surround51:0
                comment 'Abstract Device With Conversions - Front, Rear, Center and Woofer (Duplex)'
        }
        alsactl13 {
                name surround71:0
                comment 'Abstract Device - Front, Rear, Side, Center and Woofer (Duplex)'
        }
        alsactl14 {
                name plug:surround71:0
                comment 'Abstract Device With Conversions - Front, Rear, Side, Center and Woofer (Duplex)'
        }
        alsactl15 {
                name spdif:0
                comment 'Abstract Device - S/PDIF (IEC958) Optical or Coaxial Wire (Duplex)'
        }
        alsactl16 {
                name plug:spdif:0
                comment 'Abstract Device With Conversions - S/PDIF (IEC958) Optical or Coaxial Wire (Duplex)'
        }
}
rawmidi {
        alsactl1 {
                name virtual
                comment 'Virtual Device - Sequencer (Duplex)'
        }
        alsactl2 {
                name 'virtual:MERGE=0'
                comment 'Virtual Device - Sequencer (No Merge) (Duplex)'
        }
}
timer {
        alsactl1 {
                name 'hw:CLASS=1,SCLASS=0,CARD=-1,DEV=0,SUBDEV=0'
                comment 'Physical Device - system timer'
        }
}
seq {
        alsactl1 {
                name default
                comment 'Default Device - Sequencer (Duplex)'
        }
        alsactl2 {
                name hw
                comment 'Physical Device - Sequencer (Duplex)'
        }
}

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

# aplay -L
default:CARD=CMI8788
    C-Media CMI8788, Analog
    Default Audio Device
front:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    Front speakers
surround40:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CMI8788,DEV=0
    C-Media CMI8788, Analog
    IEC958 (S/PDIF) Digital Audio Output
null
    Discard all samples (playback) or generate zero samples (capture)

# amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB] [on]
  Front Right: Playback 255 [100%] [0.00dB] [on]
  Rear Left: Playback 255 [100%] [0.00dB] [on]
  Rear Right: Playback 255 [100%] [0.00dB] [on]
  Front Center: Playback 255 [100%] [0.00dB] [on]
  Woofer: Playback 255 [100%] [0.00dB] [on]
  Side Left: Playback 255 [100%] [0.00dB] [on]
  Side Right: Playback 255 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Line',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 23 [74%] [0.00dB] [on]
  Front Right: Capture 23 [74%] [0.00dB] [on]
Simple mixer control 'CD',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 25 [81%] [3.00dB] [off]
  Front Right: Capture 25 [81%] [3.00dB] [off]
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 0 [0%] [-34.50dB] [off]
  Front Right: Capture 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Boost (+20dB)',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Loopback',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Aux',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 23 [74%] [0.00dB] [off]
  Front Right: Capture 23 [74%] [0.00dB] [off]
Simple mixer control 'Stereo Upmixing',0
  Capabilities: enum
  Items: 'Front' 'Front+Surround' 'Front+Surround+Back'
  Item0: 'Front+Surround'

# iecset audio 0
Mode: consumer
Data: non-audio
Rate: 44100 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm

# iecset -x
AES0=0x06,AES1=0x82,AES2=0x00,AES3=0x00

# iecset audio 1
Mode: consumer
Data: audio
Rate: 44100 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm

# iecset -x
AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00

I have neither an /etc/asound.conf nor a ~/.asoundrc file.  I tried creating
one using a wiki page, but that resulted in no sound at all out of anything,
so I removed it and restarted the box.

# cat /etc/modprobe.d/alsa-base
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; : ; }
install snd-pcm /sbin/modprobe --ignore-install snd-pcm && { /sbin/modprobe --quiet snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer && { /sbin/modprobe --quiet snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq && { /sbin/modprobe --quiet snd-seq-midi ; /sbin/modprobe --quiet snd-seq-oss ; : ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe -Qb snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe -Qb snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe -Qb saa7134-alsa ; : ; }

# Load snd-seq for devices that don't have hardware midi;
#   Ubuntu #26283, #43682, #56005; works around Ubuntu #34831 for
#   non-Creative Labs PCI hardware
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe -Qb snd-seq ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-usx2y index=-2
options snd-usb-caiaq index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388

HELP! :-)  Please! :-)

-Shane

--
Shane Ludwig            thierry at wru.org
*************************************************************************
* Nadie quiere comer pollo feo.  -- Libro de notas, 11 de Junio de 2002 *
*************************************************************************


More information about the mythtv-users mailing list