﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
8365	[BUG FIX] White noise on PulseAudio frontend output	Carlos Azevedo <geral@…>	Janne Grunau	"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.
"	defect	closed	minor	unknown	MythTV - Video Playback	Master Head	medium	duplicate			0
