You are here

MythTV Audio Buffers

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.

Comments

This configuration was common with early 0.25. I would like to ask you what version you are using?

Current 0.27, I've been using this configuration for a few MythTV releases on Mythbuntu 12.04.

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.

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
randomness