Sound Troubleshooting

From MythTV Official Wiki
Jump to: navigation, search

Sound problems fall into several categories:

  • Audio input problems associated with software-encoding video capture cards (the sort that require a cable between the capture card and the computer's sound card)
  • Audio output problems related to Linux drivers and software
  • Audio problems related to advanced or unusual hardware (Dolby Digital output, for instance)

Software-encoding video capture card problems

These problems can be very frustrating to troubleshoot. They're usually related to drivers and other software issues, although you should always check your cabling. Be sure the audio output from the capture card goes to the sound card's audio input jack!

If your ALSA setup works, but you still get no audio recorded it may be related to pulse audio. See this bug report. https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/633452

Only left channel is recording

If your sound card is intel8x0 or maybe others then its alsa's fault. Its failing to set both capture channels to linein. One is left on the mic channel to fix this run this command.

amixer cset iface=MIXER,name='Capture Source' 4,4 numid=24,iface=MIXER,name='Capture Source'

Another fix is to upgrade alsa, but some people have said this problem still continues.

More information here.

Echo on audio input

For the VIA 8237 chipset used on the Biostar PT880 Pro-A7C motherboard (and probably others), the audio external line input can produce an echo effect if the "Duplicate Front" mixer channel is enabled. This channel is easily disabled via alsamixer. Be sure to mute the channel, not just turn down the gain on it. For Yamaha DS-1 (YMF724F) you have to mute audio recording from "Wave Capture".

Distorted audio on input

Some audio chipsets' drivers have limited options concerning encoding, and sometimes playback, sample rates. For instance, as of the 2.6.19.1 kernel's ALSA drivers, the VIA 8237 chipset used in the Biostar PT880 Pro-A7C motherboard handles a 48,000Hz sample rate, but few or no others. Ubuntu 6.10's installation of MythTV 0.20 defaults to a 32,000Hz sample rate. The result is an unpleasant "razzing" effect, slightly reminiscent of a Dalek. This effect is amplified by the MP3 encoding that's also done to the audio. It can be further amplified by the echo effect noted earlier; the combined result is most unpleasant!

The solution is to modify the recording options. You'll need to do this for each of several recording profiles in the Utilities/Setup -> Setup -> TV Settings -> Recording Profiles -> Software Encoders area -- live TV, default, low quality, and high quality. It's easiest to adjust these options using the live TV option and then copy your best options to the other profiles.

Hardware encoding card problems

Hardware encoding cards (which deliver a precompressed data stream, typically MPEG-2, to the computer) don't require a sound card to work properly (although you will of course need a sound card for playback). Audio problems with these cards are therefore likely to be related to the capture card's drivers or to the way MythTV interacts with the hardware encoding device.

Muted audio on a CX88 "Blackbird" card

The combination of Conexant CX2388x and CX23416 chips is often found on cards that follow the "Blackbird" reference design. These cards use the cx88 and cx88-blackbird drivers in Linux. At least one such card, the AVerMedia M150-D, comes up with its volume muted by default. This problem can be rectified by using v4lctl:

v4lctl -c /dev/video1 volume mute off

Change the device filename reference for your system, if necessary, and enter this command in a local startup script, such as /etc/rc.local on Ubuntu.

"Razzy" audio on a CX88 "Blackbird" card

When using at least one "Blackbird" card, the AVerMedia M150-D, MythTV sometimes records "razzy" audio with earlier kernels (see the card's Wiki entry for details) -- voices sound as if the speakers had kazoos stuck in their throats. The solution in this case was to use an external tuning script:

#!/bin/bash
v4lctl -c /dev/video1 setchannel $1
v4lctl -c /dev/video1 volume mute off
#sleep 1

The device file reference must be checked, and perhaps changed, for your system. Launch mythtv-setup, enter the Input Connections area, select the input you're using, and enter the filename for the script in the External Channel Change Command field.

The above script also incorporates a volume-unmute command, as described earlier, obviating the need to use such a command in a startup script. I initially included a sleep command to insert a 1-second delay because I believed the problem might be related to timing issues (namely, MythTV attempting to open the MPEG device before it was ready). The sleep command appears to be unnecessary on my system, though; either my timing hypothesis was wrong or the rest of the script introduced enough of a delay to avoid problems. If the problem persists for you when using my script, uncomment the sleep command to see if it helps.

This solution does have a major drawback: Before implementing the solution, channel surfing on the M150-D was unreliable but did work at least some of the time, albeit usually with "razzy" audio. When using this channel-change script, though, the MythTV frontend seems to hang 100% of the time. Thus, channel surfing is impossible with the card. Scheduled recordings work fine, though.

Audio output driver problems

Audio output driver problems can be caused by buggy or incomplete drivers or by improper settings. A good starting point for debugging is the ALSA Project documentation. Locate your audio chipset and read the instructions for configuring it. Test your output first using the stereo output jack, even if you intend to use more advanced outputs; the 2-channel case is generally simpler and is therefore easier to get working.

Note that version 0.20 has a bug 2468 which can result in sound being absent during playback. Selecting an alternate audio track should work around this issue. This has manifested as absent audio on recordings scheduled with 0.20, while recordings scheduled with an earlier version but recorded using myth 0.20 had sound.

No sound

No sound from mythtv, but mplayer can play sound

Seen on Fedora 12 to 13 + MythTV 0.22 to 0.23, with analog sound: Fixed by setting mixer control to Master and entering ALSA:front as audio device. ALSA:front was not in the list of audio devices so it had to be entered manually with the onscreen keyboard. Mixer control is PCM by default.

ALSA device

To choose the correct ALSA device when multiple devices are present, follow these steps:

  1. Verify MythTV is able to use ALSA.
  2. Find the list of ALSA device names:
    aplay -L
  3. Prepend "ALSA:" to the name of the device, eg "ALSA:default:CARD=nForce2"
  4. Set it via the GUI or in the "settings" table for the "AudioDevice" and "AudioOutputDevice" values.

Sound is stuttering

Be sure that you checked "Big audio buffer" in Configuration Menu for TV page 1.

Else, might be caused by a bad driver. Try to switch to a different driver. Known examples and solutions:

  • System running Fedora 10 with sound to ALSA:Default stutters. Switching to /dev/dsp solved the problem.

Silence

  • MythTV Frontend, Setup, Audio

While it may seem obvious in hindsight, first one should see what the operating system thinks it is using for the current audio output. E.g. look at Preferences or Settings, Sound, Output .

Otherwise, one may invite the confusion of:

  • having the operating system's Test of sound succeeding (for e.g. Line Out), and
  • MythTV's Test of sound (for e.g. some HDMI output) succeeding,

but still have silence when attempting to watch MythTV or when using MythTV to Watch Recordings. The accompanying visual reward is:

Disabling Audio / Audio Player / Aborting Reconfigure

In at least one instance, unplugging a cable from the Line Out phono plug jack allowed MythTV to successfully route the sound via the HDMI connection upon the next attempt.

This same "Disabling Audio / Audio Player / Aborting Reconfigure" message can occur in other circumstances, possibly caused by:

  • starting or using a web browser, whether or not it produced any sound, then returning to MythTV where it is silenced with this error instead of continuing or resuming its use of the same HDMI audio path. Sometimes this sequential sharing of the audio path (or lack of sharing, when the web browser is silent as expected) succeeds without failing into silence, i.e. this does not seem to be deterministically reproducible. [ e.g. Ubuntu 20.04.3 LTS, MythTV fixes/31, Firefox Version 96.0, Chrome Version 95.0.4638.69 ]

Since e.g. even the commands:

  • sudo alsactl restore [following a prior successful sudo alsactl store when the MythTV sound configuration was working], or
  • sudo alsactl init

fail to be helpful, it seems unlikely that MythTV could be changed to overcome having the audio output PCM interface it was using reconfigured by another program which is keeping it busy, even though it is silent. The simplest recourse is to Close or Quit the other program which opened the audio output interface, and trust that this other program will properly drain and close the audio output interface as it exits. Gracefully closing the offending web browser can cure this MythTV silence, and subsequently choosing to have the web browser Restore the tabs it had previously open can prevent the loss of context.

If you cannot identify which application seized the idle PCM and reconfigured it, exiting and restarting MythTV Frontend, or both MythTV Backend and MythTV Frontend, does not clear this foul state of MythTV silence. Upon Restart of the operating system (which you probably wish to avoid if one or more programs are currently being recorded!), all is well once again, without any change in any configuration.

Advanced hardware problems

Advanced audio hardware can be problematic because of the comparitive rarity of the hardware, and therefore the lack of discussion of problems related to it in the Linux community.

Lack of appropriate 6-channel output hardware

Many sound cards and motherboards claim 6-channel (Dolby Digital 5.1) or better output, but lack obvious connectors (enough analog jacks or externally-accessible SPDIF connectors). Such hardware typically has internal three-pin SPDIF headers. You can connect an external SPDIF bracket to the internal header. You can build such a bracket yourself if you know how to solder and have the parts, or you can buy one -- if you can find one! They're extremely hard to track down. Two sources for such brackets are:

  • VidaBox, a company that specializes in high-end home entertainment equipment and DVRs. This bracket is one of the least expensive items they carry.
  • Atacom, a Web-based PC and components store.

Both brackets feature both optical and coaxial outputs, enabling you to connect your computer's output to most AV receivers. Unfortunately, by the time you add shipping, you'll spend almost as much on the bracket as you would on a sound card with appropriate output hardware. Depending on your case's design, though, you might be able to put the bracket in a socket that can't be used by an expansion card. On the other hand, if you intend to use the bracket with a motherboard's audio hardware, be sure to check the header's location -- it might just block an expansion card when in use!

Working SPDIF output but only 2-channel sound

the VIA 8237 chipset used on the Biostar PT880 Pro-A7C motherboard supports SPDIF output, and so should produce 5.1-channel sound from appropriate sources, once equipped with an output bracket. Unfortunately, this didn't work with MythTV 0.20 on an Ubuntu 6.10 system, which ships with the 2.6.17 kernel. The hardware produced sound, but it was of the 2-channel variety. Dolby Digital output was produced by mplayer, though. After upgrading to a 2.6.19.1 kernel, MythTV could produce 5.1-channel output from appropriate sources (DVDs or files ripped from them).

Another possible cause of too-few sound channels is mixer settings. Check in the alsamixer utility (or some other mixer) to be sure that the "Channel Mode" is set to "6," or higher if appropriate. (This option could have other names depending on your hardware.)

No Audio for DVD playback

I had a problem with DVD audio playback when all other Audio was working properly. Usually this problem appears to be caused by muted mixer channels, but in my case the problem was a missing decoder library a52lib required by ffmpeg for decoding the DVD audio. I fixed this by adding "a52" to my USE flags and recompiling ffmpeg.

Depending on the capabilities of your TV you may need to set the "Stereo PCM Only" flag in the Advanced Audio Settings. In at least one documented case this resolved the symptom whereby audio worked for playback of recordings and music but not DVDs. See the archives here: [1].

Digital Audio over HDMI cable

Digital audio over an HDMI cable will work, but it takes some setup. You must have the appropriate version of ALSA and of the drivers for your video card, both of which may not be installed by default with your distribution. After doing so, you should make sure that the HDMI audio device (which may be named IEC958) is not muted or turned off in alsamixer or the sound setting control panel for your distribution. Then, you must tell MythTV to use the HDMI output rather than the default analog or other digital output. The easiest? (or at least one way) to do this is to change the default audio output in alsa.conf.

  • Works with Gigabyte GA-M78SM-S2H motherboard with on-board NVIDIA 8200 video card, using ALSA-driver and ALSA-lib versions 1.0.18a and NVIDIA driver version 177.82.