[mythtv-users] Dual digital audio outputs
Stephen Worthington
stephen_agent at jsw.gen.nz
Tue Nov 6 07:51:35 UTC 2018
On Mon, 5 Nov 2018 12:02:37 -0800, you wrote:
>Does anyone know what is wrong with my asound.conf file? Did I put it in
>the wrong place? I think it should work, or would have worked at
>some point in the past at least.
>
>I did a test with an asound.conf file
>
>pcm.!default {
>type plug
>slave {
>pcm "hw:0,1"
>format S32_LE
>}
>}
>
>This file worked under mythbuntu8 so I know it is valid. But with this
>file in asound.conf and ASLA default selected, I still got HDMI audio and
>no spdif. Pretty much seems like my asound.conf file was ignored and Pulse
>just did its thing. Without the ability to have an alsa config file live, I
>don't see how I can get this to work on two digital outputs.
>
>Things change and stuff that used to work quits working. I find it
>frustrating and without this support group, MythTV would be unusable IMHO.
>
>Allen
I am far from an expert with ALSA, but I do know that the device names
change between systems, depending on what hardware is installed. So
directly copying an old asound.conf file will not work unless the
device names are the same. From my very limited knowledge of ALSA, I
think all that your asound.conf file is doing is overriding the format
of the data on one device to be 32-bit little endian format. It does
not look like something that would direct the input to two different
outputs.
Also, later versions of Ubuntu have become much more pedantic about
permissions on control files, especially those in /etc. Files with
the wrong ownership or permissions will be ignored, often without any
log message telling you what happened.
So I would recommend doing:
sudo chown root:root /etc/asound.conf
sudo chmod u=rw,g=r,o=r /etc/asound.conf
Then run:
aplay -l
aplay -L
to see all the devices and pcm names that ALSA sees on your system.
Test the devices with the "aplay -D" command so you know which ones
are connected to your audio outputs and which ones do nothing. Test
sound files can be found in /usr/share/sounds/alsa/. Testing with
mythfrontend makes it too complicated to work out where the problem
is. Only once you can get all the channels you want working on all
the outputs using aplay, then move on to testing with mythfrontend.
Then using the right device names, find an example /etc/asound.conf
that is supposed to do what you want, and substitute your device names
into it.
Here is an old /etc/asound.conf that worked on my old MythTV
motherboard back in 2012. As I do not have any surround speakers, it
is only for ordinary stereo:
##############################################################################
# Create an alsa device that sends audio to both the onboard IEC958
(S/PDIF)
# output and the Nvidia graphics card HDMI output.
# First, create a dual device that combines the onboard IEC958 device
and the
# Nvidia HDMI device into one 4 channel device.
pcm.dual {
type multi
slaves.a.pcm "plughw:CARD=SB,DEV=1"
slaves.a.channels 2
slaves.b.pcm "plughw:CARD=NVidia,DEV=3"
slaves.b.channels 2
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}
# Now create a two channel device that routes its source channels to
the
# destination channels on the dual device.
pcm.both {
type route
slave.pcm "dual"
ttable.0.0 1 #Left input to onboard IEC958 left output
ttable.1.1 1 #Right input to onboard IEC958 right output
ttable.0.2 1 #Left input to Nvidia HDMI left output
ttable.1.3 1 #Right input to Nvidia HDMI right output
}
##############################################################################
I just copied that from an example on the web, so I do not really know
how it works. Fortunately, when I made it, I did actually comment it,
so you can work out which fields to change.
Test your new /etc/asound.conf devices using "aplay -D". Then when
that works, test with mythfrontend.
Documentation on /etc/asound.conf can be found here:
http://www.alsa-project.org/main/index.php/Asoundrc
More information about the mythtv-users
mailing list