[mythtv-users] Audio Woes

Michael T. Dean mtdean at thirdcontact.com
Thu Aug 19 03:42:18 EDT 2004

(Just a heads up...  Only send your message to the one list you feel is 
most appropriate--in this case mythtv-users.  If you choose the wrong 
list, you'll likely be told.  ;)  If you cross-post to multiple lists 
(dev and users), it makes tracking the thread difficult and causes many 
subscribers to get multiple copies of your message.)

On 08/19/2004 02:13 AM, Ben Matthew wrote:

>OK; when using the OSS sound system that comes with 2.6.7
Are you sure you were using OSS drivers?  They've been deprecated in 
favor of ALSA for the 2.6 kernel series.  Usually, you want to use ALSA 
drivers with ALSA's OSS emulation support.

>my audio
>chipset is detected fine; normal audio players work fine and mplayer is
>more than happy to play back my video files in stereo sound.  I
>originally built mythtv from the tar ball distro (0.18), enabling DVB
>support, ALSA support, CLE266 support and LIRC support.  Under this
>environment mythtv plays back sound fine but whenever I go to exit back
>from either live tv or a recorded program approximately half a second's
>worth of samples seem to get stuck in a loop jamming the system for
>about 5 seconds; "dah-dah-dah-dah-dah..." to be scientific.  Then
>mythfrontend reappears and everything returns to normal.
Most sounds cards do not provide hardware "direct mixing" support.  
Therefore, when you open a "hardware" sound device, all other I/O to the 
device blocks.  That means while you're watching your MythTV recordings 
or LiveTV, the other programs on your system are piling up all their 
clicks, beeps, and pops in the queue.  When you finish watching the show 
and exit the player, the sound device is released and a flood of noise 
comes blaring out of your sound card.  Since there are so many sounds 
with no spacing between, it sounds like an error (i.e. you can't resolve 
the individual sounds to realize their normal sounds your computer 
makes, just played back all at once and bunched together).

>I then experiemented with ALSA because, ideally, I want the sound to be
>coming out of the SPDIF anyway and, even more ideally, to enable the AC3
>passthrough as I have a DVB tuner.  I installed the latest stable ALSA
>drivers and library, 1.0.5, and then configured mythtv to use
>"ALSA:iec958" as its audio device.  Now whenever I select live tv or
>attempt to watch a recording I get the first frame appear followed by
>the same problem as above, a loop of around half a second of audio.
>However this time the whole system freezes totally, I can't even exit.
Most S/P-DIF hardware on today's sound cards can only accept audio at a 
specific rate (i.e. 48000Hz) and in a specific format (i.e. PCM).  Any 
other input could cause audio problems--which, as you mentioned, can 
cause problems in Myth.

>As a test I played back a video file with mplayer using "-ao
>ALSA:driver=iec958" and everything played back fine through the SPDIF
If you used "-ao ALSA:driver=iec958" MPlayer should not have given you 
sound; "-ao alsa1x:iec958" (or "-ao alsa9:iec958" depending on your 
version of MPlayer) might have worked...

>In fact I have had mplayer playing back full 6 channel audio in
>this way.  No audio issues at all.
>When I upgraded mythtv to the latest from CVS this behaviour altered.
>Now when outputing with ALSA:iec958 everything plays back fine and dandy
>through SPDIF for 10 seconds; then I lose audio.  The output from
>mythfrontend tells me that the audio device opened ok; then 10 seconds
>later it reports "broken pipe".  I also changed the output to
>ALSA:hw:0,0 which outputs to the normal analog stereo output and the
>effect is the same as with the digital.
>If anyone has any suggestions how I can sort this I'd be very grateful
>as it's so frustrating to be so close and yet still have a practically
>unusable system.  The thing I don't get is why ALSA works so perfectly
>with mplayer and yet is such an issue with myth.
So, how can you fix this?  I recommend first creating a proper .asoundrc 
so you don't have to use "hardware" devices for playback.  Instead, 
create virtual devices using plug-ins (like the plug plug-in for 
automatic conversion and the dmix plug-in for direct mixing).  See my 
post at http://www.gossamer-threads.com/lists/mythtv/users/61265#61265 
for information on creating an .asoundrc (although the details are 
specific to the nForce2 SoundStorm sound card, the information is 
applicable to all sound cards).  Once you have a good .asoundrc and can 
verify that the problem is not due to sending the wrong input to your 
sound card (because the ALSA subsystem is doing all required 
conversions), let us know if you still have problems.



More information about the mythtv-users mailing list