[mythtv] [mythtv-commits] Ticket #10396: Periodical, short audio artifacts in one the channels when upmixing to 5.1
Mark Spieth
mark at digivation.com.au
Thu Mar 8 00:03:39 UTC 2012
On 08/03/12 10:38, MythTV wrote:
> #10396: Periodical, short audio artifacts in one the channels when upmixing to 5.1
> ------------------------------------------+--------------------------------
> Reporter: blazej.lewcio@… | Owner: jyavenard
> Type: Bug Report - General | Status: infoneeded_new
> Priority: minor | Milestone: unknown
> Component: MythTV - Audio Output | Version: Unspecified
> Severity: medium | Resolution:
> Keywords: upmixing | Ticket locked: 0
> ------------------------------------------+--------------------------------
>
> Comment (by blazej.lewcio@…):
>
> Additional info: the distortion clearly happens when the if condition at
> line 1246 (in my code) in libmyth/audio/audiooutputbase.cpp is entered.
>
> {{{
> 1243 bdFrames = (kAudioRingBufferSize - org_waud) / bpf;
> 1244 printf("BufSize=%d, org_waud=%d, bpf=%d\n",
> kAudioRingBufferSize, org_waud, bpf);
> 1245
> 1246 if (bdFrames< nFrames)
> 1247 {
> 1248 puts(" xxxx");
> 1249 upmixer->receiveFrames((float *)(WPOS), bdFrames);
> 1250 nFrames -= bdFrames;
> 1251 org_waud = 0;
> 1252 }
> }}}
>
Thats a big clue
try this at the bottom of this section. org_waud shouldnt be set twice.
The wrap is the reason for setting to 0.
--- a/mythtv/libs/libmyth/audio/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputbase.cpp
@@ -1249,9 +1249,10 @@ int AudioOutputBase::CopyWithUpmix(char *buffer,
int frames, uint &org_waud)
org_waud = 0;
}
if (nFrames > 0)
+ {
upmixer->receiveFrames((float *)(WPOS), nFrames);
-
- org_waud = (org_waud + nFrames * bpf) % kAudioRingBufferSize;
+ org_waud = (org_waud + nFrames * bpf) % kAudioRingBufferSize;
+ }
}
return len;
}
In fact all 3 sections in this function have the same bug.
I also suspect this may be the cause of various avsync issues too (
which Ive seen)
Mark
More information about the mythtv-dev
mailing list