Sound Problems

For HDMI sound, see the following section.

If you have problems with sound volume, from prior experience with other sound cards it is usually due to the master volume being muted (a number of sound drivers are installed with the master volume muted), the master volume being set too low, the PCM volume being set too low or the switches, such as the number of channels available, being set incorrectly. For example, selecting 2-channel sound when 4-, or 6-channel sound has to be selected, even though only two speakers are actually used.

Also, another common problem caused by the sound card not being set up properly is that the frontend will not restart properly after you view a recorded video or live TV. Instead, when you exit from viewing the video, you will simply see a black screen and the frontend will have to be killed and restarted to get the Myth menu back. So, if you have this problem, especially after you install a new sound card, mess with the sound settings or clone a machine to new hardware, check all of the steps outlined here for fixing sound problems.

You can often overcome problems with the master volume being set too low or the PCM volume being set too low, directly through the setup pages of the Mythbuntu frontend. Enter through the "Utils/Setup" menu choice and then navigate through the menus via the "Setup" and "General" choices or directly via "Setup" and then "Audio", on later versions. Then, page forward until you reach the "Audio/Mixer" page. Set these settings as follows:

     Mixer Controls: PCM
     Master Mixer Volume: 100
     PCM Mixer Volume: 100

If changing these settings in the Mythbuntu frontend still doesn't work, try experimenting with the settings in alsamixer:

     alsamixer

Typically, the master volume, PCM volume and particularly the front speaker volume (the front speaker volume is not settable from the Mythbuntu frontend) should all be set to 100 and the three controls not muted. The up/down arrows raise/lower the volume and the 'M' toggles mute. If "MM" is shown for the control, it is muted.

Or, if you prefer a nicer GUI, for earlier versions of Mythbuntu (up to 9.04) you can try aumix, if the aumix-gtk package is installed like so:

     sudo apt-get install aumix-gtk

The mixer can be run from the Multimedia menu or by typing:

     aumix &

For later versions of Mythbuntu (9.10 and beyond), you can run the "GNOME ALSA Mixer" from the Multimedia menu, if the gnome-alsamixer package is installed thusly:

     sudo apt-get install gnome-alsamixer

Once you set the volume levels in the aforementioned manner, they should stick each time the system is rebooted (i.e. you only have to set them once). If they don't, you could use the command line program "amixer" in the "rc.local" startup script to set the mixer volume each time the system reboots but, so far, we haven't had to resort to this.

A couple of commands that may be useful to test the sound are:

     speaker-test
     aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav

If there isn't any sound, you can try running the following script to see what sound cards are installed and activated, and how they named. You should pick one of the names enumerated as the output device of MythTV.

RecognizeAudio

     #!/bin/sh
     #
     # Script to find the sound cards installed in the system and give some
     # useful information about them.
     #
     # This script can be useful in debugging ALSA sound problems.  It will find
     # all of the sound cards installed in the system by querying the PCI bus and
     # looking for sound card models.  It will then scan the ALSA modules loaded
     # into the kernel and see which sound cards are recognized by ALSA.  Of the
     # recognized modules, it checks which ones are activated (i.e. capable of
     # playing sound).  Finally, a list of the sound playback devices (according
     # to ALSA) are enumerated, followed by the names used to select these
     # devices.
     #
     # If you run this script and you don't see all of the following headings,
     # there is probably something wrong with your ALSA setup:
     #
     #      Sound cards recognized by the system:
     #      Sound cards recognized by ALSA:
     #      Sound cards recognized by ALSA, and activated:
     #      ALSA playback devices:
     #      Names used to reference ALSA playback devices:
     #
     # Find all of the sound cards on the PCI bus.
     echo "Sound cards recognized by the system:"
     lspci -nn | grep --color=none '\[04[80][13]\]'
     # For each of the sound cards on the PCI bus, see which ones have an ALSA
     # kernel module loaded.
     Module=`lspci -nnk | grep -A 3 '\[04[80][13]\]' | while read Line; do
         if ( echo $Line | grep -q '\[04[80][13]\]' ); then
             Card=$Line
         else
             if ( echo $Line | grep -q 'Kernel module' ); then
                 echo $Card
             fi
         fi
     done`
     if [ "$Module"x != x ]; then
         echo
         echo "Sound cards recognized by ALSA:"
         echo $Module
     fi
     # Now, for each of the sound cards on the PCI bus, see which ones have an
     # ALSA device driver.
     Driver=`lspci -nnk | grep -A 3 '\[04[80][13]\]' | while read Line; do
         if ( echo $Line | grep -q '\[04[80][13]\]' ); then
             Card=$Line
         else
             if ( echo $Line | grep -q 'Kernel driver' ); then
                 echo $Card
             fi
         fi
     done`
     if [ "$Driver"x != x ]; then
         echo
         echo "Sound cards recognized by ALSA, and activated:"
         echo $Driver
     fi
     # Give a list of all of the ALSA playback devices and a list of their names.
     if [ "$Driver"x != x ]; then
         echo
         echo "ALSA playback devices:"
         aplay -l | tail -n +2
      echo
      echo "Names used to reference ALSA playback devices:"
      aplay -L

fi

One solution for fixing missing or misconfigured ALSA devices is to reinstall the ALSA package as follows:

     sudo apt-get remove --purge alsa-base
     sudo apt-get install alsa-base
     sudo alsa force-reload

If you still experience problems, the Comprehensive Sound Problem Solutions Thread, which can be found at this URL, may prove helpful with a solution:

     http://ubuntuforums.org/showthread.php?t=1885240
     https://docs.google.com/document/d/
       1iTlJ8BfqXUjaHO__TEdlkvuqB1WLOkGaudngc5SFLMI/edit

However, before you start out on any sound debugging procedure, make sure that your system's BIOS settings are set so that sound is enabled. On some motherboards with built-in sound, the sound can be disabled or set to high-definition audio in the BIOS. This may preclude the sound from working and no end of monkeying with the ALSA/mixer settings will have any effect. So, check out the BIOS settings first.

Also, there are known problems with the dreaded ALC887 chipset (either from Realtek, or emulated by Nvidia). If your motherboard or soundcard has one of these on it (you should probably throw it in the trash, return it, or get another model), the ALSA drivers don't handle detection of the headphone signal correctly and consequently turn the speakers off all the time. This problem is reported to be fixed by adding this line to the end of the /etc/modprobe.d/alsa-base.conf file:

     options snd_hda_intel model=auto position_fix=3

If that doesn't work, some users have reported that the sledge hammer approach works, when you add this line to the end of the /etc/modprobe.d/alsa-base.conf file:

     options snd_hda_intel model=generic

In either case, a reboot is required.

Finally, you should check your MythTV sound settings, either through MythTV itself or by listing the pertinent rows in the settings table:

     mysql -uroot -p mythconverg
       select * from settings where hostname='mrfrntend'
         and value in ('AudioOutputDevice', 'PassThruOutputDevice',
           'MaxChannels', 'AudioUpmixType', 'AC3PassThru', 'DTSPassThru',
           'AggressiveSoundcardBuffer', 'MythControlsVolume');

For analog sound, the following settings seem to work well:

     mysql -uroot -p mythconverg
       update settings set data='ALSA:default'
         where value='AudioOutputDevice' and hostname='mrfrntend';
       update settings set data='Default'
         where value='PassThruOutputDevice' and hostname='mrfrntend';
       update settings set data=2
         where value='MaxChannels' and hostname='mrfrntend';
       update settings set data=0
         where value='AudioUpmixType' and hostname='mrfrntend';
       update settings set data=0 where
         value='AC3PassThru' and hostname='mrfrntend';
       update settings set data=0
         where value='DTSPassThru' and hostname='mrfrntend';
       update settings set data=0
         where value='AggressiveSoundcardBuffer' and hostname='mrfrntend';
       update settings set data=1
         where value='MythControlsVolume' and hostname='mrfrntend';