[mythtv-commits] Ticket #8365: [BUG FIX] White noise on PulseAudio frontend output

MythTV mythtv at cvs.mythtv.org
Sun Apr 18 18:05:34 UTC 2010


#8365: [BUG FIX] White noise on PulseAudio frontend output
-------------------------------------------------+--------------------------
 Reporter:  Carlos Azevedo <geral@…>             |       Owner:  janne     
     Type:  defect                               |      Status:  new       
 Priority:  minor                                |   Milestone:  unknown   
Component:  MythTV - Video Playback              |     Version:  Trunk Head
 Severity:  medium                               |     Mlocked:  0         
-------------------------------------------------+--------------------------
 Problem:
 When watching LiveTV audio plays for a bit then turns to white noise (like
 a out-of-tune TV set).
 Cause:
 Line 558 of file libs/libmyth/audiooutputpulse.cpp reads as :


 {{{
     fragment_size = (float)sample_rate * 0.020f * // 20msec
         (float)(audio_bits / 8 * audio_channels);

 }}}

 For whatever reason GCC compiles this and with values sample_rate=48000,
 audio_bits=16 and audio_channels=2 the computed result is 3839 (should be
 3840).
 The result is not divisible by (audio_bits / 8 * audio_channels) so on
 buffer resets the audio stream will get 'out of phase', playing white
 noise instead.

 Fix:
 Change line 558 to :


 {{{
     fragment_size = (sample_rate * 20 *                          // 20
 msec x 1000
                      (audio_bits / 8) * audio_channels) / 1000;  // base
 on msec ( div 1000 )
 }}}


 Since this is a two-liner and I'm still tracking other issues I didn't
 write a proper patch. If that's a problem let me know.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/8365>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list