Mailing List Archive

AC3 Passthrough Problems
I'm having some problems getting surround sound out of MythTV and into
my receiver.

The following command will put out AC3 surround sound audio:
mplayer -ac hwac3 -ao alsa:device=analog

If I change the device over to "digital" I get static:
mplayer -ac hwac3 -ao alsa:device=digital

Both of the following will put out analog 2-channel audio:
mplayer -ao alsa:device=analog
mplayer -ao alsa:device=digital
But the latter one has static mixed in with the sound

Neither of the following will work in MythTV when "Pass AC3 To SPDIF" is
checked:
ALSA:analog
ALSA:digital

But ALSA:analog will work as long as "Pass AC3 To SPDIF" is not checked.

Xine works just fine for AC3 surround sound. All I had to do was change
the speaker arrangement to Passthrough.

Any idea why both xine and mplayer will work but MythTV won't?

I have an Intel HDA audio device on my D915PBL motherboard. All of my
recordings have AC3 sound.

Thanks!

Matt






My /etc/asound.conf:
# ALSA configuration file

##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound
configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify
ALSA
# device names ad described in the next section.


##### DEVICE NAMES #####
# This configuration file defines four devices for use by the user.
Those
# devices are "analog", "mixed-analog", "digital", and "mixed-digital".
The
# user may also re-define "default" to be identical to one of the
above-named
# devices (i.e. to send all sound output to the digital output unless
otherwise
# specified). Use the device names as described below:
# - "analog" outputs to the analog output directly and (at least on
software
# sound cards) blocks other audio output. After playback completes,
"queued"
# sounds are output in sequence.
# - "mixed-analog" mixes audio output from multiple programs into the
analog
# output (so you can hear beeps, alerts, and other noises while playing
back
# an audio stream).
# - "digital" outputs to the digital output directly. Since most
(all?)
# digital outputs expect 48kHz PCM audio, this may not work for some
playback
# (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from
TV
# recordings, etc.).
# - "mixed-digital"

# All other devices created within this file are used only by the
configuration
# file itself and should /not/ be used directly. In other words, do not
use
# the devices "analog-hw", "dmix-analog", "digital-hw", or
"dmix-digital".


##### IMPORTANT #####
# To make this ALSA configuration file work with your sound card, you
will need
# to define the appropriate card and device information for the
"analog-hw" and
# "digital-hw" devices below. You can find the card and device
information
# using "aplay -l".


##### Configuration File #####

# Override the default output used by ALSA. If you do not override the
# default, your default device is identical to the (unmixed) "analog"
device
# shown below. If you prefer mixed and/or digital output, uncomment the
# appropriate four lines below (only one slave.pcm line).
#
# Note, also, that as of ALSA 1.0.9, "software" sound cards have been
modified
# such that their default "default" device is identical to the
"mixed-analog"
# device. Whether using an ALSA version before or after 1.0.9, it does
no harm
# and has no affect on performance to redefine the device (even if the
# redefinition does not change anything). Also, by using this ALSA
# configuration file, you once again have access to unmixed analog
output using
# the "analog" device.
pcm.!default {
type plug
## Uncomment the following to use "mixed-analog" by default
# slave.pcm "dmix-analog"
## Uncomment the following to use (unmixed) "digital" by default
# slave.pcm "digital-hw"
## Uncomment the following to use "mixed-digital" by default
slave.pcm "dmix-digital"
}

# Control device (mixer, etc.) for the card
ctl.!default {
type hw
card 0
}

# Alias for (converted) analog output on the card
# - This is identical to the device named "default"--which always exists
and
# refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog" to access
analog
# output on the card
# - Note that as of ALSA 1.0.9, "software" sound card definitions
redefine
# "default" to do mixing, meaning this device is different from
"default" and
# allows playback while blocking other sound sources (until playback
# completes).
pcm.analog {
type plug
slave.pcm "analog-hw"
}

# Control device (mixer, etc.) for the card
ctl.analog {
type hw
card 0
}

# Alias for (converted) mixed analog output on the card
# - This will accept audio input--regardless of rate--and convert to the
rate
# required for the dmix plugin (in this case 48000Hz)
# - Note that as of ALSA 1.0.9, "software" sound card definitions
redefine
# "default" to do mixing, meaning this device is identical to "default"
for
# "software" sound cards.
pcm.mixed-analog {
type plug
slave.pcm "dmix-analog"
}

# Control device (mixer, etc.) for the card
ctl.mixed-analog {
type hw
card 0
}

# Alias for (converted) digital (S/PDIF) output on the card
# - This will accept audio input--regardless of rate--and convert to the
rate
# required for the S/PDIF hardware (in this case 48000Hz)
pcm.digital {
type plug
slave.pcm "digital-hw"
}

# Control device (mixer, etc.) for the card
ctl.digital {
type hw
card 0
}

# Alias for mixed (converted) digital (S/PDIF) output on the card
# - This will accept audio input--regardless of rate--and convert to
the rate
# required for the S/PDIF hardware (in this case 48000Hz)
pcm.mixed-digital {
type plug
slave.pcm "dmix-digital"
}

# Control device (mixer, etc.) for the card
ctl.mixed-digital {
type hw
card 0
}

# The following devices are not useful by themselves. They require
specific
# rates, channels, and formats. Therefore, you probably do not want to
use
# them directly. Instead use of of the devices defined above.

# Alias for analog output on the card
# Do not use this directly--it requires specific rate, channels, and
format
pcm.analog-hw {
type hw
card 0
# The default value for device is 0, so no need to specify
# - Uncomment one of the below or create a new "device N" line as
appropriate
# for your sound card or
# device 1
# device 4
}

# Control device (mixer, etc.) for the card
ctl.analog-hw {
type hw
card 0
}

# Alias for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and
format
pcm.digital-hw {
type hw
card 0
# device 1
# - Comment out "device 1" above and uncomment one of the below or
create a
# new "device N" line as appropriate for your sound card or
device 2
# device 4
}

# Control device (mixer, etc.) for the card
ctl.digital-hw {
type hw
card 0
}

# Direct software mixing plugin for analog output on the card
# Do not use this directly--it requires specific rate, channels, and
format
pcm.dmix-analog {
type dmix
ipc_key 1234
slave {
pcm "analog-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 48000
}
}

# Control device (mixer, etc.) for the card
ctl.dmix-analog {
type hw
card 0
}

# Direct software mixing plugin for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and
format
pcm.dmix-digital {
type dmix
ipc_key 1235
slave {
pcm "digital-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 48000
}
}

# Control device (mixer, etc.) for the card
ctl.dmix-digital {
type hw
card 0
}

-----------------------------------------------

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

-----------------------------------------------

aplay -L
PCM list:
hw {
@args.0 CARD
@args.1 DEV
@args.2 SUBDEV
@args.CARD {
type string
default {
@func getenv
vars {
0 ALSA_PCM_CARD
1 ALSA_CARD
}
default {
@func refer
name 'defaults.pcm.card'
}
}
}
@args.DEV {
type integer
default {
@func igetenv
vars {
0 ALSA_PCM_DEVICE
}
default {
@func refer
name 'defaults.pcm.device'
}
}
}
@args.SUBDEV {
type integer
default {
@func refer
name 'defaults.pcm.subdevice'
}
}
type hw
card $CARD
device $DEV
subdevice $SUBDEV
}
plughw {
@args.0 CARD
@args.1 DEV
@args.2 SUBDEV
@args.CARD {
type string
default {
@func getenv
vars {
0 ALSA_PCM_CARD
1 ALSA_CARD
}
default {
@func refer
name 'defaults.pcm.card'
}
}
}
@args.DEV {
type integer
default {
@func igetenv
vars {
0 ALSA_PCM_DEVICE
}
default {
@func refer
name 'defaults.pcm.device'
}
}
}
@args.SUBDEV {
type integer
default {
@func refer
name 'defaults.pcm.subdevice'
}
}
type plug
slave.pcm {
type hw
card $CARD
device $DEV
subdevice $SUBDEV
}
}
plug {
@args.0 SLAVE
@args.SLAVE {
type string
}
type plug
slave.pcm $SLAVE
}
shm {
@args.0 SOCKET
@args.1 PCM
@args.SOCKET {
type string
}
@args.PCM {
type string
}
type shm
server $SOCKET
pcm $PCM
}
tee {
@args.0 SLAVE
@args.1 FILE
@args.2 FORMAT
@args.SLAVE {
type string
}
@args.FILE {
type string
}
@args.FORMAT {
type string
default raw
}
type file
slave.pcm $SLAVE
file $FILE
format $FORMAT
}
file {
@args.0 FILE
@args.1 FORMAT
@args.FILE {
type string
}
@args.FORMAT {
type string
default raw
}
type file
slave.pcm null
file $FILE
format $FORMAT
}
null {
type null
}
cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phoneline'
dmix 'cards.pcm.dmix'
dsnoop 'cards.pcm.dsnoop'
default {
type plug
slave.pcm dmix-digital
}
analog {
type plug
slave.pcm analog-hw
}
mixed-analog {
type plug
slave.pcm dmix-analog
}
digital {
type plug
slave.pcm digital-hw
}
mixed-digital {
type plug
slave.pcm dmix-digital
}
analog-hw {
type hw
card 0
}
digital-hw {
type hw
card 0
device 2
}
dmix-analog {
type dmix
ipc_key 1234
slave {
pcm analog-hw
period_time 0
period_size 1024
buffer_size 4096
rate 48000
}
}
dmix-digital {
type dmix
ipc_key 1235
slave {
pcm digital-hw
period_time 0
period_size 1024
buffer_size 4096
rate 48000
}
}

-----------------------------------------

Relevant section of modprobe.conf:
# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-hda-intel
# OSS/Free portion
alias char-major-14 soundcore
# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: AC3 Passthrough Problems [ In reply to ]
> Any idea why both xine and mplayer will work but MythTV won't?
>
> I have an Intel HDA audio device on my D915PBL motherboard. All of
> my recordings have AC3 sound.

I won't be too much help, but I am having the exact same problem on
my nforce4-based board. It is extremely annoying!

I am using the same asoundrc that was working perfectly on my old
P4 system, but on my new one it only works with mplayer (haven't
tried xine).

Mark

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: AC3 Passthrough Problems [ In reply to ]
On 8/15/06, Mark Lehrer <mark@knm.org> wrote:
>
> > Any idea why both xine and mplayer will work but MythTV won't?
> >
> > I have an Intel HDA audio device on my D915PBL motherboard. All of
> > my recordings have AC3 sound.
>
> I won't be too much help, but I am having the exact same problem on
> my nforce4-based board. It is extremely annoying!
>
> I am using the same asoundrc that was working perfectly on my old
> P4 system, but on my new one it only works with mplayer (haven't
> tried xine).

http://www.mythtv.org/wiki/index.php/Configuring_Digital_Sound

http://www.mythtv.org/wiki/index.php/Enabling_nForce4_optical_SPDIF_output

Mark, what sound chip is your nForce4 board using? Most use an ALC
chip family (850,etc)

--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: AC3 Passthrough Problems [ In reply to ]
On 8/16/06, Mark Lehrer <mark@knm.org> wrote:
> On Wed, Aug 16, 2006 at 12:15:33PM -0400, Steven Adeff wrote:
> > http://www.mythtv.org/wiki/index.php/Enabling_nForce4_optical_SPDIF_output
> >
> > Mark, what sound chip is your nForce4 board using? Most use an ALC
> > chip family (850,etc)
>
> Cool, thanks for the reply. The weird part is that S/PDIF works
> perfectly with mplayer (-ac hwac3). Unfortunately, mplayer is
> horrible at both deinterlacing and keeping audio & video in sync.

first person I've ever seen utter those words...

odd that -ac hwac3 works but mythtv doesn't... you sure you have AC3
passthrough enabled?

--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: AC3 Passthrough Problems - snd_hda_intel users [ In reply to ]
Any ideas? If you are making use of the snd_hda_intel driver to deliver
digital surround sound, could you post your asound.conf/.asoundrc,
modprobe.conf, alsa version, etc?

Thanks!

On Mon, 2006-08-14 at 22:34 -0700, Matt Redmon wrote:
> I'm having some problems getting surround sound out of MythTV and into
> my receiver.
>
> The following command will put out AC3 surround sound audio:
> mplayer -ac hwac3 -ao alsa:device=analog
>
> If I change the device over to "digital" I get static:
> mplayer -ac hwac3 -ao alsa:device=digital
>
> Both of the following will put out analog 2-channel audio:
> mplayer -ao alsa:device=analog
> mplayer -ao alsa:device=digital
> But the latter one has static mixed in with the sound
>
> Neither of the following will work in MythTV when "Pass AC3 To SPDIF" is
> checked:
> ALSA:analog
> ALSA:digital
>
> But ALSA:analog will work as long as "Pass AC3 To SPDIF" is not checked.
>
> Xine works just fine for AC3 surround sound. All I had to do was change
> the speaker arrangement to Passthrough.
>
> Any idea why both xine and mplayer will work but MythTV won't?
>
> I have an Intel HDA audio device on my D915PBL motherboard. All of my
> recordings have AC3 sound.
>
> Thanks!
>
> Matt
>
>
>
>
>
>
> My /etc/asound.conf:
> # ALSA configuration file
>
> ##### USAGE #####
> # Save this file as "~/.asoundrc" (for user-specific sound
> configuration) or
> # "/etc/asound.conf" (for system-wide sound configuration) and specify
> ALSA
> # device names ad described in the next section.
>
>
> ##### DEVICE NAMES #####
> # This configuration file defines four devices for use by the user.
> Those
> # devices are "analog", "mixed-analog", "digital", and "mixed-digital".
> The
> # user may also re-define "default" to be identical to one of the
> above-named
> # devices (i.e. to send all sound output to the digital output unless
> otherwise
> # specified). Use the device names as described below:
> # - "analog" outputs to the analog output directly and (at least on
> software
> # sound cards) blocks other audio output. After playback completes,
> "queued"
> # sounds are output in sequence.
> # - "mixed-analog" mixes audio output from multiple programs into the
> analog
> # output (so you can hear beeps, alerts, and other noises while playing
> back
> # an audio stream).
> # - "digital" outputs to the digital output directly. Since most
> (all?)
> # digital outputs expect 48kHz PCM audio, this may not work for some
> playback
> # (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from
> TV
> # recordings, etc.).
> # - "mixed-digital"
>
> # All other devices created within this file are used only by the
> configuration
> # file itself and should /not/ be used directly. In other words, do not
> use
> # the devices "analog-hw", "dmix-analog", "digital-hw", or
> "dmix-digital".
>
>
> ##### IMPORTANT #####
> # To make this ALSA configuration file work with your sound card, you
> will need
> # to define the appropriate card and device information for the
> "analog-hw" and
> # "digital-hw" devices below. You can find the card and device
> information
> # using "aplay -l".
>
>
> ##### Configuration File #####
>
> # Override the default output used by ALSA. If you do not override the
> # default, your default device is identical to the (unmixed) "analog"
> device
> # shown below. If you prefer mixed and/or digital output, uncomment the
> # appropriate four lines below (only one slave.pcm line).
> #
> # Note, also, that as of ALSA 1.0.9, "software" sound cards have been
> modified
> # such that their default "default" device is identical to the
> "mixed-analog"
> # device. Whether using an ALSA version before or after 1.0.9, it does
> no harm
> # and has no affect on performance to redefine the device (even if the
> # redefinition does not change anything). Also, by using this ALSA
> # configuration file, you once again have access to unmixed analog
> output using
> # the "analog" device.
> pcm.!default {
> type plug
> ## Uncomment the following to use "mixed-analog" by default
> # slave.pcm "dmix-analog"
> ## Uncomment the following to use (unmixed) "digital" by default
> # slave.pcm "digital-hw"
> ## Uncomment the following to use "mixed-digital" by default
> slave.pcm "dmix-digital"
> }
>
> # Control device (mixer, etc.) for the card
> ctl.!default {
> type hw
> card 0
> }
>
> # Alias for (converted) analog output on the card
> # - This is identical to the device named "default"--which always exists
> and
> # refers to hw:0,0 (unless overridden)
> # - Therefore, we can specify "hw:0,0", "default", or "analog" to access
> analog
> # output on the card
> # - Note that as of ALSA 1.0.9, "software" sound card definitions
> redefine
> # "default" to do mixing, meaning this device is different from
> "default" and
> # allows playback while blocking other sound sources (until playback
> # completes).
> pcm.analog {
> type plug
> slave.pcm "analog-hw"
> }
>
> # Control device (mixer, etc.) for the card
> ctl.analog {
> type hw
> card 0
> }
>
> # Alias for (converted) mixed analog output on the card
> # - This will accept audio input--regardless of rate--and convert to the
> rate
> # required for the dmix plugin (in this case 48000Hz)
> # - Note that as of ALSA 1.0.9, "software" sound card definitions
> redefine
> # "default" to do mixing, meaning this device is identical to "default"
> for
> # "software" sound cards.
> pcm.mixed-analog {
> type plug
> slave.pcm "dmix-analog"
> }
>
> # Control device (mixer, etc.) for the card
> ctl.mixed-analog {
> type hw
> card 0
> }
>
> # Alias for (converted) digital (S/PDIF) output on the card
> # - This will accept audio input--regardless of rate--and convert to the
> rate
> # required for the S/PDIF hardware (in this case 48000Hz)
> pcm.digital {
> type plug
> slave.pcm "digital-hw"
> }
>
> # Control device (mixer, etc.) for the card
> ctl.digital {
> type hw
> card 0
> }
>
> # Alias for mixed (converted) digital (S/PDIF) output on the card
> # - This will accept audio input--regardless of rate--and convert to
> the rate
> # required for the S/PDIF hardware (in this case 48000Hz)
> pcm.mixed-digital {
> type plug
> slave.pcm "dmix-digital"
> }
>
> # Control device (mixer, etc.) for the card
> ctl.mixed-digital {
> type hw
> card 0
> }
>
> # The following devices are not useful by themselves. They require
> specific
> # rates, channels, and formats. Therefore, you probably do not want to
> use
> # them directly. Instead use of of the devices defined above.
>
> # Alias for analog output on the card
> # Do not use this directly--it requires specific rate, channels, and
> format
> pcm.analog-hw {
> type hw
> card 0
> # The default value for device is 0, so no need to specify
> # - Uncomment one of the below or create a new "device N" line as
> appropriate
> # for your sound card or
> # device 1
> # device 4
> }
>
> # Control device (mixer, etc.) for the card
> ctl.analog-hw {
> type hw
> card 0
> }
>
> # Alias for digital (S/PDIF) output on the card
> # Do not use this directly--it requires specific rate, channels, and
> format
> pcm.digital-hw {
> type hw
> card 0
> # device 1
> # - Comment out "device 1" above and uncomment one of the below or
> create a
> # new "device N" line as appropriate for your sound card or
> device 2
> # device 4
> }
>
> # Control device (mixer, etc.) for the card
> ctl.digital-hw {
> type hw
> card 0
> }
>
> # Direct software mixing plugin for analog output on the card
> # Do not use this directly--it requires specific rate, channels, and
> format
> pcm.dmix-analog {
> type dmix
> ipc_key 1234
> slave {
> pcm "analog-hw"
> period_time 0
> period_size 1024
> buffer_size 4096
> rate 48000
> }
> }
>
> # Control device (mixer, etc.) for the card
> ctl.dmix-analog {
> type hw
> card 0
> }
>
> # Direct software mixing plugin for digital (S/PDIF) output on the card
> # Do not use this directly--it requires specific rate, channels, and
> format
> pcm.dmix-digital {
> type dmix
> ipc_key 1235
> slave {
> pcm "digital-hw"
> period_time 0
> period_size 1024
> buffer_size 4096
> rate 48000
> }
> }
>
> # Control device (mixer, etc.) for the card
> ctl.dmix-digital {
> type hw
> card 0
> }
>
> -----------------------------------------------
>
> aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: Intel [HDA Intel], device 0: ALC880 Analog [ALC880 Analog]
> Subdevices: 1/1
> Subdevice #0: subdevice #0
> card 0: Intel [HDA Intel], device 2: ALC880 Digital [ALC880 Digital]
> Subdevices: 1/1
> Subdevice #0: subdevice #0
>
> -----------------------------------------------
>
> aplay -L
> PCM list:
> hw {
> @args.0 CARD
> @args.1 DEV
> @args.2 SUBDEV
> @args.CARD {
> type string
> default {
> @func getenv
> vars {
> 0 ALSA_PCM_CARD
> 1 ALSA_CARD
> }
> default {
> @func refer
> name 'defaults.pcm.card'
> }
> }
> }
> @args.DEV {
> type integer
> default {
> @func igetenv
> vars {
> 0 ALSA_PCM_DEVICE
> }
> default {
> @func refer
> name 'defaults.pcm.device'
> }
> }
> }
> @args.SUBDEV {
> type integer
> default {
> @func refer
> name 'defaults.pcm.subdevice'
> }
> }
> type hw
> card $CARD
> device $DEV
> subdevice $SUBDEV
> }
> plughw {
> @args.0 CARD
> @args.1 DEV
> @args.2 SUBDEV
> @args.CARD {
> type string
> default {
> @func getenv
> vars {
> 0 ALSA_PCM_CARD
> 1 ALSA_CARD
> }
> default {
> @func refer
> name 'defaults.pcm.card'
> }
> }
> }
> @args.DEV {
> type integer
> default {
> @func igetenv
> vars {
> 0 ALSA_PCM_DEVICE
> }
> default {
> @func refer
> name 'defaults.pcm.device'
> }
> }
> }
> @args.SUBDEV {
> type integer
> default {
> @func refer
> name 'defaults.pcm.subdevice'
> }
> }
> type plug
> slave.pcm {
> type hw
> card $CARD
> device $DEV
> subdevice $SUBDEV
> }
> }
> plug {
> @args.0 SLAVE
> @args.SLAVE {
> type string
> }
> type plug
> slave.pcm $SLAVE
> }
> shm {
> @args.0 SOCKET
> @args.1 PCM
> @args.SOCKET {
> type string
> }
> @args.PCM {
> type string
> }
> type shm
> server $SOCKET
> pcm $PCM
> }
> tee {
> @args.0 SLAVE
> @args.1 FILE
> @args.2 FORMAT
> @args.SLAVE {
> type string
> }
> @args.FILE {
> type string
> }
> @args.FORMAT {
> type string
> default raw
> }
> type file
> slave.pcm $SLAVE
> file $FILE
> format $FORMAT
> }
> file {
> @args.0 FILE
> @args.1 FORMAT
> @args.FILE {
> type string
> }
> @args.FORMAT {
> type string
> default raw
> }
> type file
> slave.pcm null
> file $FILE
> format $FORMAT
> }
> null {
> type null
> }
> cards 'cards.pcm'
> front 'cards.pcm.front'
> rear 'cards.pcm.rear'
> center_lfe 'cards.pcm.center_lfe'
> side 'cards.pcm.side'
> surround40 'cards.pcm.surround40'
> surround41 'cards.pcm.surround41'
> surround50 'cards.pcm.surround50'
> surround51 'cards.pcm.surround51'
> surround71 'cards.pcm.surround71'
> iec958 'cards.pcm.iec958'
> spdif 'cards.pcm.iec958'
> modem 'cards.pcm.modem'
> phoneline 'cards.pcm.phoneline'
> dmix 'cards.pcm.dmix'
> dsnoop 'cards.pcm.dsnoop'
> default {
> type plug
> slave.pcm dmix-digital
> }
> analog {
> type plug
> slave.pcm analog-hw
> }
> mixed-analog {
> type plug
> slave.pcm dmix-analog
> }
> digital {
> type plug
> slave.pcm digital-hw
> }
> mixed-digital {
> type plug
> slave.pcm dmix-digital
> }
> analog-hw {
> type hw
> card 0
> }
> digital-hw {
> type hw
> card 0
> device 2
> }
> dmix-analog {
> type dmix
> ipc_key 1234
> slave {
> pcm analog-hw
> period_time 0
> period_size 1024
> buffer_size 4096
> rate 48000
> }
> }
> dmix-digital {
> type dmix
> ipc_key 1235
> slave {
> pcm digital-hw
> period_time 0
> period_size 1024
> buffer_size 4096
> rate 48000
> }
> }
>
> -----------------------------------------
>
> Relevant section of modprobe.conf:
> # ALSA portion
> alias char-major-116 snd
> alias snd-card-0 snd-hda-intel
> # OSS/Free portion
> alias char-major-14 soundcore
> # card #1
> alias sound-service-0-0 snd-mixer-oss
> alias sound-service-0-1 snd-seq-oss
> alias sound-service-0-3 snd-pcm-oss
> alias sound-service-0-8 snd-seq-oss
> alias sound-service-0-12 snd-pcm-oss
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 19/09/06, Scott <list-mythtv@bluecamel.eml.cc> wrote:
> I'd like to ask for some help, and sanity checking, trying to get AC3
> passthrough to work in 0.20. My video source is OTA ATSC and a Fusion
> HDTV5 RT. Audio is typically Dolby Digital 2 channel (stereo) or 5.1
> channel surround. I also have this card working with mplayer DVB and
> can confirm that my a/v receiver connected to the spdif correctly
> sees and accepts both DD 2.0 and DD 5.1 source from OTA ATSC
> broadcasts using "mplayer -ao alsa -afm hwac3 dvb://" So I'm fairly
> sure my alsa setup is configured correctly
>
> I found http://mythtv.org/wiki/index.php/Configuring_Digital_Sound
> which looks very helpful. I tried to set ALSA:default for my sound
> device but that doesn't work. Any suggestions on how I can get MythTV
> to send the raw AC3 stream out the spdif and to my A/V receiver?

If you specify ALSA:default as your MythTV passthrough sound device
and your default ALSA device is not your SPDIF, passthrough will not
work. You either need to specify your SPDIF directly in MythTV (like
ALSA:iec958 or ALSA:spdif) or you need to follow through the HOWTO
fully and adjust your asound.conf file to set your default ALSA device
to your SPDIF.

> See attached mplayer.log and mythtv.log. These two logs are of the
> same dvb stream which has DD 2.0 sound.

With mplayer, you are specifying the passthrough option in the run
command and it's working, which is good.

> Here is what aplay -l says about my Intel HDA audio:
>
> 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: 1/1
> Subdevice #0: subdevice #0

If you do configure your asound.conf (or .asoundrc if using per user
settings) using the HOWTO you need to make sure you specify the
digital device as device 1 on card 0.

Note that aplay -L will give a list of PCM devices - towards the
bottom of the list of these devices will be the definition of the
'default' PCM device which usually the front analog output unless you
have specified otherwise.

--
Nick

MythTV Official wiki:
http://mythtv.org/wiki/
MythTV users list archive:
http://www.gossamer-threads.com/lists/mythtv/users
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On Sep 19, 2006, at 11:24 PM, Nick wrote:
> If you specify ALSA:default as your MythTV passthrough sound device
> and your default ALSA device is not your SPDIF, passthrough will not
> work. You either need to specify your SPDIF directly in MythTV (like
> ALSA:iec958 or ALSA:spdif) or you need to follow through the HOWTO
> fully and adjust your asound.conf file to set your default ALSA device
> to your SPDIF.

Sure, make it sound easy. :) Here are the settings I have for MythTV -
> Settings -> General -> Audio

Audio output device: ALSA:digital
Passthrough output device: Default
Enable AC3 to SPDIF passthrough: [checked]
Enable DTS to SPDIF passthrough: [not checked]
Aggressive Sound card Buffering: [not checked]
Use internal volume controls: [checked]
Mixer Device: digital
Mixer Controls: PCM
Master Mixer Volume: 70
PCM Mixer Volume: 70
Independent Muting of Left and Right Audio Channels: [not checked]

> If you do configure your asound.conf (or .asoundrc if using per user
> settings) using the HOWTO you need to make sure you specify the
> digital device as device 1 on card 0.

See my attached .asoundrc which is based on the HOWTO. The default is
set to dmix-digital. The ALSA:digital option is just a nice way to
say iec958 or spdif. Using this .asoundrc file, I expect that
anything sent to an unspecified ALSA control will end getting
properly mixed to the correct rate and sent out my SPDIF and into my
A/V. This is the way it seems to be working at any rate. In these
cases I _expect_ to seem my receiver decode the input as PCM 48kHz.

In my MythTV config I have configured Audio to use the ALSA:digital
control for all output. I expect this should tell MythTV to send all
output out my SPDIF "as is". In the case of AC3 and DTS my A/V
receiver should be picking them up and decoding the formats. This is
not happening correctly.

With the config shown above, I get a nasty stuttering sound that
might sound like a helicopter whirling it's blades :) If I do not
check the "enable AC3/DTS passthrough" options then I get normal
sounding audio but not DD or DTS format. My receiver says I'm instead
receiving a PCM 48kHz signal from the SPDIF. Using mplayer on the
same test clip shows DD 5.1 with the -afm hwac3 pass through option.

Also attached is an audio.debug file. I see MythTV does detect and
select the 5.1 sound track but I'm not so sure it's actually passing
it to ALSA correctly. Is there a way I can see even more debug info
so I know exactly what the ALSA driver is receiving? I'm hoping to
see something like I can with mplayer -v.

Bonus question: Since I have an external A/V receiver for decoding
and volume control, shouldn't I be not checking the "Use internal
volume controls" option?

The help is much appreciated.

--
Scott
Re: ac3 passthrough problems [ In reply to ]
HI!

Scott wrote:

> With the config shown above, I get a nasty stuttering sound that might
> sound like a helicopter whirling it's blades :) If I do not check the
> "enable AC3/DTS passthrough" options then I get normal sounding audio
> but not DD or DTS format. My receiver says I'm instead receiving a PCM
> 48kHz signal from the SPDIF. Using mplayer on the same test clip shows
> DD 5.1 with the -afm hwac3 pass through option.

Apparently, Myth sends raw AC3 data to Alsa and Alsa does not switch
your receiver to DD.

I have wrestled with this for several days and now it works. Try this:

First throw away your .asoundrc and restart mythfrontend.

Set this in Myth:
Normal device: ALSA:default
Passthrough device: ALSA:spdif
AC3 passthrough: Checked

With these settings, you should:
- get DS sound for MP2 and AC3 2.0
- get DD sound for AC3 5.1

Now, for mixing 44 KHz audio to 48 KHz, you need some special .asoundrc.
Using the .asoundrc from the HowTo, you should be able to set normal
device to ALSA:dmix-digital and passthrough device to ALSA:digital-hw.
BUT, you have to set the right device number in the digital-hw section
of the .asoundrc, otherwise your receiver won't switch to DD. Try "aplay
-l" to see the devices. For me (SB Live 5.1), it was device 2.

Also, for AC3 5.1 working, you have to switch OFF "Use video as
timebase" in the frontend/tv/playback settings.

Thomas

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/21/06 02:17, Thomas Börkel wrote:

>Using the .asoundrc from the HowTo, you should be able to set normal
>device to ALSA:dmix-digital and passthrough device to ALSA:digital-hw
>
From the .asoundrc:

##### DEVICE NAMES #####
# This configuration file defines four devices for use by the user. Those
# devices are "analog", "mixed-analog", "digital", and "mixed-digital".
...
# All other devices created within this file are used only by the
configuration
# file itself and should /not/ be used directly. In other words, do not use
# the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
HI!

Michael T. Dean wrote:

>> Using the .asoundrc from the HowTo, you should be able to set normal
>> device to ALSA:dmix-digital and passthrough device to ALSA:digital-hw
>>
> From the .asoundrc:
>
> ##### DEVICE NAMES #####
> # This configuration file defines four devices for use by the user. Those
> # devices are "analog", "mixed-analog", "digital", and "mixed-digital".
> ...
> # All other devices created within this file are used only by the
> configuration
> # file itself and should /not/ be used directly. In other words, do not use
> # the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".

From the .asoundrc:

pcm.!default {
type plug
## Uncomment the following to use "mixed-analog" by default
slave.pcm "dmix-analog"
## Uncomment the following to use (unmixed) "digital" by default
# slave.pcm "digital-hw"
## Uncomment the following to use "mixed-digital" by default
# slave.pcm "dmix-digital"
}


If I use ALSA:default in MythTV and use slave.pcm "digital-hw" in the
pcm.!default section, do I not use digital-hw then?

Thomas


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/21/06 05:49, Thomas Börkel wrote:

>Michael T. Dean wrote:
>
>>>Using the .asoundrc from the HowTo, you should be able to set normal
>>>device to ALSA:dmix-digital and passthrough device to ALSA:digital-hw
>>>
>>From the .asoundrc:
>>
>>##### DEVICE NAMES #####
>># This configuration file defines four devices for use by the user. Those
>># devices are "analog", "mixed-analog", "digital", and "mixed-digital".
>>...
>># All other devices created within this file are used only by the
>>configuration
>># file itself and should /not/ be used directly. In other words, do not use
>># the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".
>>
>>
>From the .asoundrc:
>
>pcm.!default {
> type plug
>## Uncomment the following to use "mixed-analog" by default
> slave.pcm "dmix-analog"
>## Uncomment the following to use (unmixed) "digital" by default
># slave.pcm "digital-hw"
>## Uncomment the following to use "mixed-digital" by default
># slave.pcm "dmix-digital"
>}
>
>
>If I use ALSA:default in MythTV and use slave.pcm "digital-hw" in the
>pcm.!default section, do I not use digital-hw then?
>

/You/ shouldn't use digital-hw; it's OK for the .asoundrc to use it (in
the definition of the default device). Once you've done that, you use
"default" (or, for some applications (not Myth), just don't specify a
device and the default device will be used).

If you don't have it now, get the updated config file from the wiki (
http://mythtv.org/wiki/index.php/Configuring_Digital_Sound#Setting_up_ALSA.27s_.asoundrc.2C_Properly
). It has much more descriptive (and instructive) comments.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
HI!

>> If I use ALSA:default in MythTV and use slave.pcm "digital-hw" in the
>> pcm.!default section, do I not use digital-hw then?
>>
>
> /You/ shouldn't use digital-hw; it's OK for the .asoundrc to use it (in

OK, but what is the difference between specifying ALSA:digital-hw and
specifying ALSA:default (and using digital-hw in the default def)?

Thomas

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
Re: ac3 passthrough problems [ In reply to ]
On Sep 21, 2006, at 2:17 AM, Thomas Börkel wrote:

>> With the config shown above, I get a nasty stuttering sound that
>> might
>> sound like a helicopter whirling it's blades :) If I do not check the
>> "enable AC3/DTS passthrough" options then I get normal sounding audio
>> but not DD or DTS format. My receiver says I'm instead receiving a
>> PCM
>> 48kHz signal from the SPDIF. Using mplayer on the same test clip
>> shows
>> DD 5.1 with the -afm hwac3 pass through option.
>
> Apparently, Myth sends raw AC3 data to Alsa and Alsa does not switch
> your receiver to DD.

Not necessarily. It's perfectly possible to send analog format
signals out the spdif and for the receiver to decode them. Again,
with the -afm hwac3 option, mplayer sends the raw AC3 sound track out
to alsa and my receiver does decode it correctly. This is easily seen
by running "mplayer -v -ao alsa -afm hwac3 dvd://1" Note that you
would think that the alsa default device gets used here but mplayer
is smarter than that. Instead it uses the iec958 (aka spdif) of my
sound card. This all works regardless of if I'm using an asoundrc
file or not.

> I have wrestled with this for several days and now it works. Try this:
> First throw away your .asoundrc and restart mythfrontend.

Gladly :)

> Set this in Myth:
> Normal device: ALSA:default
> Passthrough device: ALSA:spdif
> AC3 passthrough: Checked
>
> With these settings, you should:
> - get DS sound for MP2 and AC3 2.0
> - get DD sound for AC3 5.1

So, with no asoundrc file in place, I changed my MythTV setting to
reflect what you wrote. Here the are:

Audio output device: ALSA:default
Passthrough output device: ALSA:spdif
Enable AC3 to SPDIF passthrough: [checked]
Enable DTS to SPDIF passthrough: [not checked]
Aggressive Sound card Buffering: [not checked]
Use internal volume controls: [not checked]

The options for mixer and pcm aren't available because Use Internal
volume controls was not checked. With this config audio from MythTV
makes a nasty stuttering sound that might sound similar helicopter
blades or such. If I uncheck "enable AC3 to SPDIF" then I get normal
sound but it's not DD. It comes through as PCM 48kHz which I think is
just an analog format.

I tested this using "-v audio" and attached an audio.debug file.
Looking at the log, why does MythTV detect the audio twice? Is this
expected?

2006-09-21 15:20:36.529 AFD: Opened codec 0x82ed910, id(MPEG2VIDEO)
type(Video)
2006-09-21 15:20:36.529 AFD: Opened codec 0x834d580, id(AC3) type(Audio)
2006-09-21 15:20:36.529 AFD: Audio Track #1 is A/V stream #1 and has
6 channels in the English language(6647399).
2006-09-21 15:20:36.529 AFD: Selected track 1: English AC3 5.1ch (A/V
Stream #1)
2006-09-21 15:20:36.529 AFD: Initializing audio parms from audio
track #1
2006-09-21 15:20:36.529 AFD: Audio format changed
from id(NONE) -1Hz -1ch 0bps ; id(NONE) -1Hz -1ch 0bps
to id( AC3) 48000Hz 6ch 16bps pt ; id( AC3) 48000Hz 2ch
16bps pt
2006-09-21 15:20:38.012 TV: Attempting to change from None to
WatchingPreRecorded
0: start_time: 7715.966 duration: 323.686
1: start_time: 7715.929 duration: 323.698
stream: start_time: 85732.539 duration: 3596.929 bitrate=15960 kb/s
2006-09-21 15:20:38.056 AFD: Opened codec 0x83a6cc0, id(MPEG2VIDEO)
type(Video)
2006-09-21 15:20:38.056 AFD: Opened codec 0x83a72c0, id(AC3) type(Audio)
2006-09-21 15:20:38.057 AFD: Audio Track #1 is A/V stream #1 and has
5 channels in the English language(6647399).
2006-09-21 15:20:38.057 AFD: Selected track 1: English AC3 5ch (A/V
Stream #1)
2006-09-21 15:20:38.057 AFD: Initializing audio parms from audio
track #1
2006-09-21 15:20:38.057 AFD: Audio format changed
from id(NONE) -1Hz -1ch 0bps ; id(NONE) -1Hz -1ch 0bps
to id( AC3) 48000Hz 5ch 16bps pt ; id( AC3) 48000Hz 2ch
16bps pt
2006-09-21 15:20:38.058 AO: Killing AudioOutputDSP
2006-09-21 15:20:38.058 Opening ALSA audio device 'spdif'.
2006-09-21 15:20:38.062 in SetParameters(format=2, channels=2,
rate=48000, buffer_time=500000, period_time=125000)
2006-09-21 15:20:38.062 get_buffer_size returned 16384
2006-09-21 15:20:38.062 set_period_time_near returned 170666
2006-09-21 15:20:38.062 get_period_size returned 8192
2006-09-21 15:20:38.098 AO: Audio fragment size: 6144
2006-09-21 15:20:38.099 AO: Audio Stretch Factor: 1
2006-09-21 15:20:38.099 AO: Ending reconfigure
2006-09-21 15:20:38.099 AO: kickoffOutputAudioLoop: pid = 24504
2006-09-21 15:20:38.099 AO: OutputAudioLoop: Play Event

> Also, for AC3 5.1 working, you have to switch OFF "Use video as
> timebase" in the frontend/tv/playback settings.

Confirmed this setting is off before I tested the above.

The help is much appreciated. I'm really at the end of my rope on
this one. What is so frustrating is seeing both xine and mplayer pass
the AC3 correctly but having MythTV fail on the same exact sources.

--
Scott
Re: ac3 passthrough problems [ In reply to ]
HI!

Scott wrote:

>>> With the config shown above, I get a nasty stuttering sound that might
>>
>> Apparently, Myth sends raw AC3 data to Alsa and Alsa does not switch
>> your receiver to DD.
>
> Not necessarily. It's perfectly possible to send analog format signals
> out the spdif and for the receiver to decode them. Again, with the -afm

Yes, I know. But I was talking about 5.1 data.

> hwac3 option, mplayer sends the raw AC3 sound track out to alsa and my

That's good.

> Instead it uses the iec958 (aka spdif) of my sound card. This all works
> regardless of if I'm using an asoundrc file or not.

OK.

> Audio output device: ALSA:default
> Passthrough output device: ALSA:spdif
> Enable AC3 to SPDIF passthrough: [checked]
> Enable DTS to SPDIF passthrough: [not checked]
> Aggressive Sound card Buffering: [not checked]
> Use internal volume controls: [not checked]
>
> The options for mixer and pcm aren't available because Use Internal
> volume controls was not checked. With this config audio from MythTV

I have this checked and "default" as mixer.

> makes a nasty stuttering sound that might sound similar helicopter
> blades or such. If I uncheck "enable AC3 to SPDIF" then I get normal
> sound but it's not DD. It comes through as PCM 48kHz which I think is
> just an analog format.

This sound to me as if ALSA:spdif does not switch your receiver to DD.

> I tested this using "-v audio" and attached an audio.debug file. Looking
> at the log, why does MythTV detect the audio twice? Is this expected?

This I do not know.

> The help is much appreciated. I'm really at the end of my rope on this
> one. What is so frustrating is seeing both xine and mplayer pass the AC3
> correctly but having MythTV fail on the same exact sources.

This is all strange. Could you try with the .asoundrc from the Wiki,
setting digital-hw in the default section and using ALSA:default as
passthrough device? You already tried that, IIRC, but please check, if
the device in the .asoundrc in the digital-hw section is the correct
one. It is NOT the same, as in the analog section for me. For analog, I
use device 0 and for digital, I use device 2. At one point, I has the
wrong device for digital and then I also had stuttering sound and the
receiver did not switch to DD.

Thomas

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/21/06 06:16, Thomas Börkel wrote:

>>>If I use ALSA:default in MythTV and use slave.pcm "digital-hw" in the
>>>pcm.!default section, do I not use digital-hw then?
>>>
>>/You/ shouldn't use digital-hw; it's OK for the .asoundrc to use it (in
>>
>>
>OK, but what is the difference between specifying ALSA:digital-hw and
>specifying ALSA:default (and using digital-hw in the default def)?
>

Channel/rate/format conversion to those required by the underlying
hardware. In other words, digital-hw will only work for some sound
streams on some cards. However, default (when redefined as per the
wiki's ALSA configuration) will always work.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/21/06 15:36, Scott wrote:

> On Sep 21, 2006, at 2:17 AM, Thomas Börkel wrote:
>
> >> With the config shown above, I get a nasty stuttering sound that
> >> might sound like a helicopter whirling it's blades :) If I do not
> >> check the "enable AC3/DTS passthrough" options then I get normal
> >> sounding audio but not DD or DTS format. My receiver says I'm
> >> instead receiving a PCM 48kHz signal from the SPDIF. Using
> >> mplayer on the same test clip shows DD 5.1 with the -afm hwac3
> >> pass through option.
> >
> > Apparently, Myth sends raw AC3 data to Alsa and Alsa does not
> > switch your receiver to DD.
>
> Not necessarily. It's perfectly possible to send analog format
> signals out the spdif and for the receiver to decode them.


It is not the responsibility of the underlying driver to tell the
receiver to switch modes when the application changes audio
formats--it's the application's responsibility. Some receivers are
better at "auto-detecting" formats than others. Some sound cards are
better at creating specification-compliant data streams which enhance
the receiver's ability to auto-detect.

Myth doesn't yet do well at informing the receiver of the audio stream
type (because all previous attempts to add functionality to do so have
broken more systems than they've fixed--and not just because of bad
configurations).

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On Sep 21, 2006, at 5:00 PM, Michael T. Dean wrote:

> On 09/21/06 15:36, Scott wrote:
>
>> On Sep 21, 2006, at 2:17 AM, Thomas Börkel wrote:
>>> Apparently, Myth sends raw AC3 data to Alsa and Alsa does not
>>> switch your receiver to DD.
>>
>> Not necessarily. It's perfectly possible to send analog format
>> signals out the spdif and for the receiver to decode them.
>
> It is not the responsibility of the underlying driver to tell the
> receiver to switch modes when the application changes audio
> formats--it's the application's responsibility. Some receivers are
> better at "auto-detecting" formats than others. Some sound cards are
> better at creating specification-compliant data streams which enhance
> the receiver's ability to auto-detect.
>
> Myth doesn't yet do well at informing the receiver of the audio stream
> type (because all previous attempts to add functionality to do so have
> broken more systems than they've fixed--and not just because of bad
> configurations).


Mike, are you implying, or saying, that when I use mplayer -vfm hwac3
to pass data to my spdif, that mplayer is putting some sort of header
on the stream to inform my A/V receiver to switch to the proper mode?
I really don't think you're saying this but I want to confirm.

Going back to the AC3 sound saga at hand, I plan to update to alsa
1.0.13-rcX and see if it makes a difference. I suspect it will not
since it appears only MythTV is having an issue. From there, if that
fails I'll try disabling on board sound and seeing if MythTV and a
Audiogy 2 ZS do any better. I hate to that as the "extra" pci slot
was going to be used for a future tuner.

--
Scott


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/21/06 22:28, Scott wrote:

>On Sep 21, 2006, at 5:00 PM, Michael T. Dean wrote:
>
>>On 09/21/06 15:36, Scott wrote:
>>
>>>On Sep 21, 2006, at 2:17 AM, Thomas Börkel wrote:
>>>
>>>
>>>>Apparently, Myth sends raw AC3 data to Alsa and Alsa does not
>>>>switch your receiver to DD.
>>>>
>>>>
>>> Not necessarily. It's perfectly possible to send analog format
>>> signals out the spdif and for the receiver to decode them.
>>>
>>>
>>It is not the responsibility of the underlying driver to tell the
>>receiver to switch modes when the application changes audio
>>formats--it's the application's responsibility. Some receivers are
>>better at "auto-detecting" formats than others. Some sound cards are
>>better at creating specification-compliant data streams which enhance
>>the receiver's ability to auto-detect.
>>
>>Myth doesn't yet do well at informing the receiver of the audio stream
>>type (because all previous attempts to add functionality to do so have
>>broken more systems than they've fixed--and not just because of bad
>>configurations).
>>
>Mike, are you implying, or saying, that when I use mplayer -vfm hwac3
>to pass data to my spdif, that mplayer is putting some sort of header
>on the stream to inform my A/V receiver to switch to the proper mode?
>
>

I don't know the specifics of MPlayer's "-vfm hwac3", but basically, yes
it should do exactly that.

>I really don't think you're saying this but I want to confirm.
>
>Going back to the AC3 sound saga at hand, I plan to update to alsa
>1.0.13-rcX and see if it makes a difference. I suspect it will not
>since it appears only MythTV is having an issue.
>
Because informing the receiver of the type of sound data is the
responsibility of the application not of the driver...

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On Sep 22, 2006, at 12:42 AM, Michael T. Dean wrote:
> On 09/21/06 22:28, Scott wrote:
>> Mike, are you implying, or saying, that when I use mplayer -vfm hwac3
>> to pass data to my spdif, that mplayer is putting some sort of header
>> on the stream to inform my A/V receiver to switch to the proper mode?
>
> I don't know the specifics of MPlayer's "-vfm hwac3", but
> basically, yes
> it should do exactly that.
>
>> I really don't think you're saying this but I want to confirm.
>>
>> Going back to the AC3 sound saga at hand, I plan to update to alsa
>> 1.0.13-rcX and see if it makes a difference. I suspect it will not
>> since it appears only MythTV is having an issue.
> Because informing the receiver of the type of sound data is the
> responsibility of the application not of the driver...

I think this was the final clue I needed to crack the nut. I had
noticed with mplayer -v -vfm hwac3 that the following was logged:

alsa-init: requested format: 48000 Hz, 2 channels, 100
alsa-spdif-init: playing AC3, 2 channels
alsa-init: using device iec958:{CARD 0 AES0 0x02 AES1 0x82 AES2 0x00
AES3 0x02}

The iec958 device from a default xine config looks like
iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2.

As it turns out, all those hex numbers do something! I'm still
digesting it but see this post for what looks like a reasonable
explanation: http://sourceforge.net/mailarchive/message.php?
msg_id=8560868. Note that mplayer sets AES0=0x02 instead of AES0-0x6
like xine does. I don't know what the difference is yet or if it
really matters. I stumbled onto this solution when I decided to test
mplayer as "-vo digital-hw -vfm hwac3" which basically mimic the
MythTV recommended settings from the HOWTO for passing AC3 sound.
That test produced the _same_ stuttering sound that I was hearing
from MythTV. Clearly mplayer and xine were doing something special
with the spdif device and the "magic" seems to be in the hex codes.

So my final MythTV settings that enabled my A/V receiver to see and
decode DD/DTS from the SPDIF

Audio output device:
ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
Passthrough output device: Default
Enable AC3 to SPDIF passthrough: [checked]
Enable DTS to SPDIF passthrough: [checked]
Aggressive Sound card Buffering: [not checked]
Use internal volume controls: [not checked]

Because the Internal Volume controls are not enable, no mixer device
is setup. A few caveats about this config. it seems most people get
by just fine following the howto in the wiki. For Intel HDA Audio
onboard the Asus P5B using the RCA-SPDIF connection to my A/V
receiver I needed the above iec958 definition. If I didn't use it
then sound would either be garbled (stuttering or helicopter blade
like sound) or I would get analog 2 channel PCM at my A/V receiver.
This config was tested under ALSA 1.0.13rc2 but it should also work
on 1.0.11 and later.

All my TV sources are OTA ATSC signals. Even with two channel sound,
I expect that AC3 format will always be present. I haven't tested,
and would not expect, the above config to work for anything but 48kHz
AC3 sound. I don't use MythMusic so I don't expect this to be a
problem for me.

Also, not tested, but the above settings could most likely work
better by swapping the values for Audio output device and Passthrough
output device. I would expect that one day MythTV would be smart
enough to detect AC3/DTS formats and route them through the
Passthrough device only as needed. I could be wrong but I thought I
read that currently MythTV 0.20 doesn't do things this way. Maybe one
day soon? :)

Thanks to everyone for the help on this!

--
Scott

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
HI!

Scott wrote:

> Audio output device:
> ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
> Passthrough output device: Default
> Enable AC3 to SPDIF passthrough: [checked]
> Enable DTS to SPDIF passthrough: [checked]
> Aggressive Sound card Buffering: [not checked]
> Use internal volume controls: [not checked]

It is funny, that this actually works, because with these setting,
MythTV uses the "Default" device for AC3, not the one with the hex codes.

Thomas

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On Sep 22, 2006, at 5:31 AM, Thomas Börkel wrote:

> HI!
>
> Scott wrote:
>
>> Audio output device:
>> ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
>> Passthrough output device: Default
>> Enable AC3 to SPDIF passthrough: [checked]
>> Enable DTS to SPDIF passthrough: [checked]
>> Aggressive Sound card Buffering: [not checked]
>> Use internal volume controls: [not checked]
>
> It is funny, that this actually works, because with these setting,
> MythTV uses the "Default" device for AC3, not the one with the hex
> codes.

Yes. But, my understanding of the "Passthrough output device" is that
if it is set to "Default" (case sensitive) then it simply refers to
the device defined by "Audio output device". This can be confirmed by
running with mythtvfrontend -v audio > audio.debug.txt and looking at
the device MythTV opens with ALSA.

So you're correct that mythtv uses the "Passthrough output device"
when AC3/DTS passthrough is enabled. However, setting "Passthrough
output device" to "Default" is a special case that tells MythTV to
use the "Audio output device". Using the HOWTO asoundrc file the
following alternative setup should work as well:

Audio output device: ALSA:digital-dmix
Passthrough output device:
ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
Enable AC3 to SPDIF passthrough: [checked]
Enable DTS to SPDIF passthrough: [checked]
Aggressive Sound card Buffering: [not checked]
Use internal volume controls: [not checked]

This config would be useful if MythTV was able to detect and route
AC3/DTS sound through the "Passthrough output device" only as needed.
For example, if in MythMusic sound would not be 48kHz AC3 format and
get routed via the "Audio output device". During OTA ATSC playback
where AC3 formats are present MythTV would route sound via the
"Passthrough output device" instead.

Of course, I have no idea if MythTV actually works this way. I'm just
saying, based on the definition of the two fields that it would be
nice if it MythTV could work this way! :)

--
Scott

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
HI!

Scott wrote:

>> It is funny, that this actually works, because with these setting,
>> MythTV uses the "Default" device for AC3, not the one with the hex
>> codes.
>
> Yes. But, my understanding of the "Passthrough output device" is that
> if it is set to "Default" (case sensitive) then it simply refers to
> the device defined by "Audio output device". This can be confirmed by

You're right. I had forgotten that.

> Audio output device: ALSA:digital-dmix
> Passthrough output device:
> ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
> Enable AC3 to SPDIF passthrough: [checked]
> Enable DTS to SPDIF passthrough: [checked]
> Aggressive Sound card Buffering: [not checked]
> Use internal volume controls: [not checked]
>
> This config would be useful if MythTV was able to detect and route
> AC3/DTS sound through the "Passthrough output device" only as needed.

It does that already. It only uses the passthrough device for AC3. For
MP2, it uses the normal device.

What I would like is, that it only uses the passthrough device for AC3 5.1.

> For example, if in MythMusic sound would not be 48kHz AC3 format and
> get routed via the "Audio output device". During OTA ATSC playback
> where AC3 formats are present MythTV would route sound via the
> "Passthrough output device" instead.

MythMusic can be configured to use another device, so no problem there.

Thomas

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
On 09/22/06 15:54, Thomas Börkel wrote:

>Scott wrote:
>
>>>It is funny, that this actually works, because with these setting,
>>>MythTV uses the "Default" device for AC3, not the one with the hex
>>>codes.
>>>
>>>
>>Yes. But, my understanding of the "Passthrough output device" is that
>>if it is set to "Default" (case sensitive) then it simply refers to
>>the device defined by "Audio output device". This can be confirmed by
>>
>>
>You're right. I had forgotten that.
>
>>Audio output device: ALSA:digital-dmix
>>Passthrough output device:
>>ALSA:iec958:CARD=0,AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
>>
>>

Actually, it looks like MythTV completely ignores the Placebo--I mean
Passthrough output device. ;)

(The only occurrence of "PassThroughOutputDevice" in
myth{tv,plugins,themes} is in the settings page.)

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: ac3 passthrough problems [ In reply to ]
HI!

Michael T. Dean wrote:


> Actually, it looks like MythTV completely ignores the Placebo--I mean
> Passthrough output device. ;)
>
> (The only occurrence of "PassThroughOutputDevice" in
> myth{tv,plugins,themes} is in the settings page.)

That's strange, because it actually works for me, as intended.

I have no .asoundrc. I have configured ALSA:default (which is analog in
Alsa 1.06) as normal device and ALSA:spdif as passthrough device.

Now, when I have NOT checked AC3 passthrough and play a AC3 5.1
recording, I get only Dolby Surround on my receiver. And I get analog
sound on my TV (using soundcard's analog output), too.

When I check AC3 passthrough and play AC3 5.1, then I get Dolby Digital
5.1 on my receiver, but silence on my TV.

When I play MP2 sound, then the AC3 passthrough switch does not change
anything. I always get Dolby Surround on my receiver and sound on my TV.

So, if the passthrough device is being ignored by Myth, then it must use
ALSA:spdif by it's own choice.

Thomas


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

1 2  View All