MythTV Audio Buffers

Recent comments

Who's new

  • rhpot1991

MythTV Audio Buffers

Submitted by rhpot1991 on Mon, 01/14/2013 - 13:39

Most people will never know that their MyhTV frontend may be throwing errors after trying to increase audio buffer sizes. You can normally hear clicks or pops in the sound if your audio buffers are too low. I've only ever noticed this myself on sources with DTS-HD sound, but the errors are there for my normal cable sources as well.

First check your logs (normally in /var/log/mythtv/mythfrontend.log). You should see something like this:

Dec 14 01:31:31 mythlogserver: mythfrontend[2610]: E CoreContext audio/audiooutputalsa.cpp:242 (IncPreallocBufferSize) ALSA: Try to manually increase audio buffer with: echo 128 | sudo tee /proc/asound/card1/pcm9p/sub0/prealloc

You can simply run this line by hand if you would like, but the audio buffers are reset on boot, so an automated method would be preferred. First gather a list of all of the different errors from your logs, there may be errors for several different devices depending upon your system's hardware and types of audio sources that you have. On two of my systems I have a single buffer to set, on another system I have to set two of them.

Now create the following upstart config in /etc/init/mythtv-sound.conf, make sure you replace the device and size with the proper values for your system:

description "MythTV Sound Fix"
author "John Baab "

start on started desktop-session-start

post-start script
echo 192 | tee /proc/asound/card1/pcm3p/sub0/prealloc
echo 1536 | tee /proc/asound/card1/pcm9p/sub0/prealloc
end script

Alternately you can download it with the following command and then edit:

sudo wget -O /etc/config/mythtv-sound.conf http://www.baablogic.net/mythbuntu/mythtv-sound.conf

This configuration will run the script portion after lightdm is started. If you are using something other than lightdm you may need to modify this as well.

Anonymous (not verified)

Wed, 03/12/2014 - 06:30

I have never noticed with whether my MyhTV is loading with the DTS sound or not as usually there will be error in the audio buffers and the buffers will take too many times to load the audio visuals.