Record a 60fps movie (with sound) using Uzem
Re: Record a 60fps movie (with sound) using Uzem
I saw your comment about not merging too late and tried to revert and I don't really understand the state now. Asked to create another pull request...
Re: Record a 60fps movie (with sound) using Uzem
Sorry! It looks like you created another branch based off the previous commit, rather than reverting the change. The change is still inside the uzem140 branch, so I can just create another pull request that can go on top of that, because it may end up being mostly the same, just with some constants changed.uze6666 wrote:I saw your comment about not merging too late and tried to revert and I don't really understand the state now. Asked to create another pull request...
I'm still trying to wrap my head around how to get the synchronization perfect. It's just a pain to test things, because each test lasts 25 minutes while I wait for the entire video to be recorded.
Re: Record a 60fps movie (with sound) using Uzem
Since you have a fast PC, try commenting out these lines:Artcfox wrote: I'm still trying to wrap my head around how to get the synchronization perfect. It's just a pain to test things, because each test lasts 25 minutes while I wait for the entire video to be recorded.
Code: Select all
if (enableSound && TCCR2B)
{
// raw pcm sample at 15.7khz
//while (audioRing.isFull())SDL_Delay(1);
//SDL_LockAudio();
//audioRing.push(value);
//SDL_UnlockAudio();
Re: Record a 60fps movie (with sound) using Uzem
Cool! I'll try that after the current recording in progress has finished.
But if that's the case, then what keeps the emulation speed limited when you run it with the -n flag to disable sound?
But if that's the case, then what keeps the emulation speed limited when you run it with the -n flag to disable sound?
Re: Record a 60fps movie (with sound) using Uzem
Good point, I never use this flag. Does the speed remain constant??Artcfox wrote:Cool! I'll try that after the current recording in progress has finished.
But if that's the case, then what keeps the emulation speed limited when you run it with the -n flag to disable sound?
Re: Record a 60fps movie (with sound) using Uzem
I didn't use that flag, because then it would disable audio recording, but when I commented those lines like you suggested, along with these:uze6666 wrote:Good point, I never use this flag. Does the speed remain constant??Artcfox wrote:Cool! I'll try that after the current recording in progress has finished.
But if that's the case, then what keeps the emulation speed limited when you run it with the -n flag to disable sound?
Code: Select all
// SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
// SDL_RenderClear(renderer);
// SDL_RenderCopy(renderer, texture, NULL, NULL);
// SDL_RenderPresent(renderer);
Code: Select all
"ffmpeg -y -f rawvideo -s 640x240 -pix_fmt rgba -r 59.94 -i - -vf scale=960:720 -sws_flags neighbor -an -preset ultrafast -qp 0 -tune animation uzemtemp.mp4"
What a great tip! Thank you, this will save me much time!
I'm thinking that another flag called fastRecording would be a good idea. That would disable both sound and video playback in the window and let the rendering of both proceed as fast as the CPU will allow. I'm going to have to get this up and running on my fast desktop, just to see how many MHz I can push the emulation up to!
Re: Record a 60fps movie (with sound) using Uzem
I just tried it on my desktop, and it can run Uzem in recording mode (including the video scaling) without local audio/video display at around 90 MHz +/- 4 MHz, depending on how complex the video frames it's recording are. Without the recording flag (and with no sound or video) the emulator itself will run at a solid 97 MHz.
And to answer your question about the -n flag, if I put everything back so it displays the video and plays the audio, but then run it with the -n option to not play sound, it runs at over 70 MHz, and it was really tricky for me to even beat the first level of BUGZ.
I also submitted another pull request (to be merged into your uzem140 branch) with the proper a/v sync code. It is meant to be applied on top of my previous patch, so you should probably delete the revert-33-uzem140 branch, since that's just cruft now, and you'll also want to close (without merging) the pull request you made to yourself to merge the revert-33-uzem140 branch into uzem140 since that would just screw things up if that got merged at this point.
According to this stackoverflow post, assuming the name of your github remote is "origin", you would do:
Full disclaimer: I have not tried those commands myself with a Github remote, so only run them after you fully understand them, and at your own risk.
will explain what each of those options do.
And to answer your question about the -n flag, if I put everything back so it displays the video and plays the audio, but then run it with the -n option to not play sound, it runs at over 70 MHz, and it was really tricky for me to even beat the first level of BUGZ.
I also submitted another pull request (to be merged into your uzem140 branch) with the proper a/v sync code. It is meant to be applied on top of my previous patch, so you should probably delete the revert-33-uzem140 branch, since that's just cruft now, and you'll also want to close (without merging) the pull request you made to yourself to merge the revert-33-uzem140 branch into uzem140 since that would just screw things up if that got merged at this point.
According to this stackoverflow post, assuming the name of your github remote is "origin", you would do:
Code: Select all
git push origin --delete revert-33-uzem140
git branch -D revert-33-uzem140
git branch --delete --remotes origin/revert-33-uzem140
Code: Select all
git help push
git help branch
Re: Record a 60fps movie (with sound) using Uzem
Replying again, since I get different results depending on which flags I use when I create the window.uze6666 wrote:Good point, I never use this flag. Does the speed remain constant??Artcfox wrote:Cool! I'll try that after the current recording in progress has finished.
But if that's the case, then what keeps the emulation speed limited when you run it with the -n flag to disable sound?
With the
Code: Select all
SDL_RENDERER_PRESENTVSYNC
Code: Select all
SDL_RenderPresent(renderer);
I tried to remove the call to SDL_Delay(1) from this line of code:
Code: Select all
while (audioRing.isFull())SDL_Delay(1);
At the very least size and avail of the ringBuffer class need to be declared volatile, since they are being accessed simultaneously by multiple threads, and each thread needs to fetch the latest value.