libretro / vba-next

Optimized port of VBA-M to Libretro.
GNU General Public License v2.0
94 stars 88 forks source link

Samplerate is not 32000?! #111

Open JustMeDaFaq opened 5 years ago

JustMeDaFaq commented 5 years ago

Hey,

the outputted samplerate is not 32000?! Cant acutally get it to work to play with the right speed, tho, had no issue with TGBDual Core for example

JustMeDaFaq commented 5 years ago

EDIT: Just measured of much values (of type short) il get per frame.

One frame its 640, than next frame 1280 and again 640 and so on on the next frames :S

EDIT2: Cutting the first 640 from those frames where im getting 1280 short values works! :)

negativeExponent commented 4 years ago

i dont know why vba_next and any other vba-based gba are sending audio at a rate of about 1/100 of a second. https://github.com/libretro/vba-next/blob/master/src/sound.cpp#L50 Changing this to 280896 cycles will send audio at about 1 frame rate which should give about 1074 samples per frame, instead of partial samples, which should even be better for libretro.

negativeExponent commented 3 years ago

RE: this might need some bit of timing tweaks. audio and video should return in retro_run at the same time aka similar to beetle gba implementation.

might work with just the audio sampling cycle rate change as i've stated above

LibretroAdmin commented 1 year ago

@negativeExponent Pushed this change through - https://github.com/libretro/vba-next/commit/38a855b995242c5f19921d914f61d9ad74da8ca2

let me know if it improves things on your end