[mythtv-users] No audio after upgrading video card

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Dec 10 05:49:06 UTC 2021

On Thu, 9 Dec 2021 20:51:39 -0800, you wrote:

>On 12/9/21 2:35 PM, Hika van den Hoven wrote:
>> Nowadays you have a lot of audio devices in your system:
>> - the on board audio device, possibly in analog and in digital
>> - the on board hdmi video device, possibly mono and stereo
>> - your analog capturecard(s) one for each tuner
>> - add-on hdmi video device
>> - add-on audio device
>> - the build in mic in your camera
>> and possibly more and all possibly in several variations
>  One thing that I think can be complicated is what encodings are enabled for the audio device.  If you are using HDMI, this is now digital audio, and there are a bunch of different things that may or may not be supported depending on the receiver (dolby, ac3, etc).
>  My recollection is that doing the audio test works even if non supported formats are specified in the audio settings because the testing uses the most basic of the codex.  But when you play actual content, it will use more sophisticated codecs.  I'm not sure if this is just passing through what is in the stream being played back, or mythtv is doing the encoding but is now choosing a codec to give best results, which may not be something the receiver supports.
>  In the audio settings there is something that says what codecs will be used.  I believe it will auto probe those, but you can try disabling some to see if it makes it work.

Here in New Zealand, there can be a choice of two different audio
streams on some recordings - AAC or AC3, with AC3 being better quality
and it usually has 5.1 instead of stereo.  MythTV seems to pick the
better quality stream automatically (or maybe I set an option to do
that many years ago).  I am not sure what format the test option uses,
but it might well be uncompressed PCM as you get from some DVDs - very
simple to decode as it is just the digital audio data in separate
words with no compression.

I do not use the HDMI audio as my TV speakers are terrible.  I send my
audio to my DAC via a TOSLINK optical cable.  The DAC, preamp, amp and
speakers are proper hifi equipment and give excellent sound, but are
only stereo.  Sending via TOSLINK causes the audio to be converted to
PCM by the PC audio drivers (ALSA) and is normally 48k (DVD) samples
per second.  So the compressed AAC or AC3 stereo channels are
uncompressed to PCM, at the same sample rate, with no loss of quality.

When sending to HDMI, the audio needs to be converted to a format
supported by the HDMI standards.  All HDMI devices are required to
support PCM format, but they will usually have a range of other
formats they support.  I believe there is a negotiation process that
occurs so the HDMI output will ask the TV or AV amp what formats it
will support.  If a format matches the audio stream from the
recording, that data will just be sent to the HDMI port unaltered.
Otherwise, it will have to be converted to a format the HDMI device
can use, and in the ultimate case that will be PCM as all HDMI devices
support that.

MythTV has a number of options controlling all this, and then the
audio drivers do also.  If you are using PulseAudio, it has a whole
lot of options too, but if you select an ALSA output in MythTV then
you bypass PulseAudio and only have to deal with the ALSA options. The
most common problem with the ALSA options is that the output you are
trying to send to is muted (which is the default for the SPDIF/TOSLINK
outputs usually), or one or other of the various volume controls is
set to 0 volume or something very small.  So when you set up a new
ALSA audio output, you should always run alsamixer (from a command
line) and check its settings.  You normally want all the volume
settings except the master volume to be set to maximum, and set MythTV
to control the master volume from its volume control.

If you have to use the various settings in the ALSA config files (for
example if you want the output to go to two different outputs at the
same time), you usually need the help of an expert.  Fortunately,
those config files are not needed to get one output running properly -
just alsamixer.

I should also mention that PulseAudio is actually very useful
sometimes.  I have MythTV on another Ubuntu PC where I test things. It
is on a KVM switch with other PCs, including my Windows box which is
connected to my monitor's speakers.  So I am running a copy of
PulseAudio on my Windows box, and the Ubuntu PC uses PulseAudio for
its sound output, with the output set to a TCP network connection the
PulseAudio on the Windows PC.

More information about the mythtv-users mailing list