Fixing things…
So, a while back I set up my MythTV system to use PulseAudio because I thought that’s what I needed to get mulitple audio outputs happening on my HTPC. Turns out I was wrong. You see, ALSA is perfectly fine for software mixing. Even though I’m still not sure whether I actually need to use software mixing, it’s what’s working for me at the moment.
The troubles I had with PulseAudio were numerous, and I should really have figured this out sooner, though I think I was too lazy to really think about it properly. I had setup PulseAudio with mpd; that was easy. With MythTV it wasn’t so easy. MythTV doesn’t support PA, and rightly so: compared to ALSA, for what MythTV wants to get done, PA plainly sucks. PA does not support AC3/Dolby Digital/DTS passthrough. PA also adds a lot of latency to the audio – depending on your hardware of course. On my system it was somewhere in the range of 100ms, or a little more. Which was too much for my A/V receivers built-in A/V sync function to deal with, anyway. The result of this? Any audio I got out of MythTV through PA to my A/V receiver worked normally ~80% of the time (though only stereo, so no DVD audio or 5.1 from digital television). The other 20% of the time, you’d get no audio at all, or you’d get extremely loud static hissing. It wasn’t very pleasant. All my Linux-bashing friends made sure to note this problem each and every time it occured while they were trying to watch something on my HTPC.
No more! The solution I have found is simple. After doing a little bit of reading and copying and pasting, ALSA is now correctly configured to handle AC3/DTS passthrough AND all other audio. The only drawback that I can see, which really isn’t that bad at all, is that MythTV cannot be in playback mode while mpd is trying to output, and vice-versa. I can’t think of a usecase of wanting to have music playing while a television show is on, so that’s OK by me.
I’ll dump my various config files below for future reference.
/etc/asound.conf
pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0666 # mixing for all users
slave {
pcm “hw:0,1″
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}pcm.dsp0 {
type plug
slave.pcm “dmixer”
}pcm.!default {
type plug
slave.pcm “dmixer”
}pcm.default {
type plug
slave.pcm “dmixer”
}ctl.mixer0 {
type hw
card 0
}
/etc/mpd.conf is simple:
audio_output {
type “alsa”
name “My ALSA Device”
}
And my MythTV settings:
Audio output device: ALSA:default
Speakers configuration: 5.1
Upconvert stereo to 5.1 surround (unticked; this is at your preference however)
Digital output device: ALSA:iec958:{ AES0 0×02 } (autodetected/populated by MythTV, yours should be too, otherwise use ‘aplay -l’ on commandline to get your device name/number)
Dolby Digital and DTS boxes both ticked
Advanced Audio Configuration ticked; Overried SRC quality ticked, Sample Rate Conversion: best
Aggressive Sound card buffering ticked
The other issue I had with MythTV which I fixed today was that the menu button on my remote never seemed to work. I was puzzled and hunted through my MythTV lircrc. This is another thing which I’ve been wanting to fix for ages but never really put any effort into. The fix, again, was simple: the autogenerated lircrc file for MythTV had two identical entries for what MythTV was meant to do when the menu button was pushed. Erasing the duplicate entry in the file made it work. Wha-la!
And all this greatness achieved while being severely hungover. It’s amazing what you can do when you put your mind to it.
About this entry
You’re currently reading “Fixing things…,” an entry on if it's owən
- Published:
- 03.07.10 / 5pm
- Category:
- Blog












4 Comments
Jump to comment form | comments rss [?] | trackback uri [?]