zzhu8192
Still Fresh
I'm currently porting FCEU 0.98.12 to GP2X. I'm able to get about 57 FPS without
sound and 46-50 FPS with sound (depending on the game).
I'm using rlyehs-minimal-lib 0.A for video, sound, and input. compiled using gcc 4.1.0 -O3.
Everything works, but my sound output is choppy, and slightly out of sync.
If I do sound synchronusly, there's a bit a pause/choppiness in the sound.
I assume the pause is from the time write() system call for sound until the next one is done.
If I do sound asynchronusly (i.e. copy buffer in main thread, write() in sound loop thread), it's still choppy for some reason. I've validated the threading is working.
My questions:
1) Is the sound choppy because I can't get enough data to feed the sound write thread at the right
speed? Is it because I'm only getting 50fps?
I look at an emulator like fishyNes, which according to the frame rate is getting about 50FPS.
The sound sounds perfectly smooth though. How is it doing that if the above is the reason?
2) Has anyone used ryleh's sound example? Is using write() a good idea?
Instead of using the thread loop in rlyeh, I'm kind of using my own loop. It also seems that the nanosleep function is not behaving properly. I'm doing pthread_yield() instead.
3) I tried prolonging the sound slightly by interpolating, but obviously it decreases the pitch, and doesn't seem to help much
Any hints/suggestions would be appreciated!
sound and 46-50 FPS with sound (depending on the game).
I'm using rlyehs-minimal-lib 0.A for video, sound, and input. compiled using gcc 4.1.0 -O3.
Everything works, but my sound output is choppy, and slightly out of sync.
If I do sound synchronusly, there's a bit a pause/choppiness in the sound.
I assume the pause is from the time write() system call for sound until the next one is done.
If I do sound asynchronusly (i.e. copy buffer in main thread, write() in sound loop thread), it's still choppy for some reason. I've validated the threading is working.
My questions:
1) Is the sound choppy because I can't get enough data to feed the sound write thread at the right
speed? Is it because I'm only getting 50fps?
I look at an emulator like fishyNes, which according to the frame rate is getting about 50FPS.
The sound sounds perfectly smooth though. How is it doing that if the above is the reason?
2) Has anyone used ryleh's sound example? Is using write() a good idea?
Instead of using the thread loop in rlyeh, I'm kind of using my own loop. It also seems that the nanosleep function is not behaving properly. I'm doing pthread_yield() instead.
3) I tried prolonging the sound slightly by interpolating, but obviously it decreases the pitch, and doesn't seem to help much
Any hints/suggestions would be appreciated!