Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
hatari
Commits
7be3f922
Unverified
Commit
7be3f922
authored
Oct 16, 2020
by
Libretro-Admin
Committed by
GitHub
Oct 16, 2020
Browse files
Merge pull request #59 from bbbradsmith/missing_sample_fix
fix the missing sample issue (was causing constant 30hz buzz/crackle)
parents
aa30fe97
70c35e4d
Pipeline
#2536
passed with stages
in 2 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/sound.c
View file @
7be3f922
...
...
@@ -1533,10 +1533,16 @@ Retro_Audio_CallBack(CurrentSamplesNb*4);
CurrentSamplesNb
=
0
;
/* VBL is complete, reset counter for next VBL */
/*Compute a fractional equivalent of SamplesPerFrame for the next VBL, to avoid rounding propagation */
SamplesPerFrame_unrounded
+=
(
yms64
)
ClocksTimings_GetSamplesPerVBL
(
ConfigureParams
.
System
.
nMachineType
,
nScreenRefreshRate
,
nAudioFrequency
);
SamplesPerFrame
=
SamplesPerFrame_unrounded
>>
28
;
/* use integer part */
SamplesPerFrame_unrounded
&=
0x0fffffff
;
/* keep fractional part in the lower 28 bits */
//SamplesPerFrame_unrounded += (yms64) ClocksTimings_GetSamplesPerVBL ( ConfigureParams.System.nMachineType ,
// nScreenRefreshRate , nAudioFrequency );
//SamplesPerFrame = SamplesPerFrame_unrounded >> 28; /* use integer part */
//SamplesPerFrame_unrounded &= 0x0fffffff; /* keep fractional part in the lower 28 bits */
// Hatari's audio system seems to be able to deal with a variable number of samples per frame, keeping aligned with the Atari's not-quite-50/60 Hz,
// but our RetroArch interface does not seem to be able to handle it (pads with 0 to fill the rest, creating a constant buzz).
// Forcing it to generate all samples every frame:
SamplesPerFrame
=
nAudioFrequency
/
nScreenRefreshRate
;
SamplesPerFrame_unrounded
=
0
;
/* Reset sound buffer if needed (after pause, fast forward, slow system, ...) */
if
(
Sound_BufferIndexNeedReset
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment