Mythbuntu 12.04 MythTV audio buffering issue

I was noticing in my mythfrontend logs, this warning:
ALSA: Setting hardware audio buffer size to 128
ALSA: Error opening /proc/asound/card2/pcm9p/sub0/prealloc: Permission denied.
ALSA: Try to manually increase audio buffer with: echo 128 | sudo tee /proc/asound/card2/pcm9p/sub0/prealloc
ALSA: Unable to sufficiently increase ALSA hardware buffer size - underruns are likely

I've read in multiple places that as long as you have sound, and no problems it is safe to ignore. But I personally do not like to see random errors. There was a reason that the developers are telling you to manually run that line. So... off searching I did. I read in a few places that your user account (the main account you log into MythTV with) should be part of the audio group, welp simple enough run
sudo usermod -a -G audio username

But, that doesn't seem to be good enough. It appears that the /proc/asound directory's are all owned by root. So if I do a little chown -R root:audio /proc/asound; bam the error is gone. But if I reboot that front end, it resets it back to root:root. So I need to make the change stick on startup.

First I wrote a small script that will make the change, and make it stick on reboot. I put all my scripts in one place in my home directory called "scripts" (witty, I know).
So I created a file called ~/scripts/asound.sh
nano ~/scripts/asound.sh

Then I add...
#!/bin/sh
/bin/chmod -R ug+rw      /proc/asound
/bin/chown -R root:audio /proc/asound
exit 0

Let's make that file executable
chmod +x ~/scripts/asound.sh

Now add this to /etc/rc.local
/home/username/scripts/asound.sh

This has solved one of my issues where one of my front end's would stutter when you were on the guide screen, and scrolling up/down.

No comments:

Post a Comment