Hacking [RELEASE] PFBA: Portable Final Burn Alpha - official thread

  • Thread starter Thread starter cpasjuste
  • Start date Start date
  • Views Views 367,916
  • Replies Replies 733
  • Likes Likes 38
Last edited by haojiezhu,
Thanks, KOF '97 now works with the latest build. Will test more Neogeo games later. Also, I found configuration file changed from "ux0:/data/pfba/pfba.cfg" to "ux0:/data/pfbapfba.cfg". Is this intended or you just missed a forward slash in the source code?
Crap, of course this is not intended. I have to fix that right now.

Edit: fixed, new build uploaded.
 
Last edited by cpasjuste,
new build load perfect the king of fighters series
thanks
only less sterring wheel for racing games(outrun,hang on...)and full speed for sega games and konami(turtles in time...)
 
@cpasjuste I tried to build myself again and found that for some reason I had to add two lines to CMakelists.txt in the build_psp2 section:

set(CMAKE_AR "${VITASDK}/bin/arm-vita-eabi-ar")
set(CMAKE_RANLIB "${VITASDK}/bin/arm-vita-eabi-ranlib")

It might just be because I build on MacOS, but cannot hurt to add them in general.

EDIT: I noticed that PFba has quite substantial audiolag, I'd say almost 0.4-0.5 seconds. Easily tested with Street Fighter 2. The punch sound should play almost immediately after pressing the punch button, but in PFba there's this noticable delay between pressing the button and the sound. I originally noticed it in Bomb Jack Twin when collecting bombs. Maybe there's an audio buffer that could be reduced?
 
Last edited by rsn8887,
@cpasjuste I tried to build myself again and found that for some reason I had to add two lines to CMakelists.txt in the build_psp2 section:

set(CMAKE_AR "${VITASDK}/bin/arm-vita-eabi-ar")
set(CMAKE_RANLIB "${VITASDK}/bin/arm-vita-eabi-ranlib")

It might just be because I build on MacOS, but cannot hurt to add them in general.

EDIT: I noticed that PFba has quite substantial audiolag, I'd say almost 0.4-0.5 seconds. Easily tested with Street Fighter 2. The punch sound should play almost immediately after pressing the punch button, but in PFba there's this noticable delay between pressing the button and the sound. I originally noticed it in Bomb Jack Twin when collecting bombs. Maybe there's an audio buffer that could be reduced?
Thanks for the reports. I was not sure if it was normal or not (for the sound). I did tweak a lot the audio part, but I guess I did not succeed :) The sound is buffered in sdl2_audio.cpp and the code seems good, I will take a closer look with this game (sf2 cps1 ?) and different settings (audio quality, desktop/vita etc.)
By the way, did you try the " sfml" version on osx ? Also I hope all the changes/refractoring I made recently was not a problem for you :)
Edit: of course I/wee will add thoses two lines in cmakelist.
 
Last edited by cpasjuste,
@cpasjuste I tried to build myself again and found that for some reason I had to add two lines to CMakelists.txt in the build_psp2 section:

set(CMAKE_AR "${VITASDK}/bin/arm-vita-eabi-ar")
set(CMAKE_RANLIB "${VITASDK}/bin/arm-vita-eabi-ranlib")

It might just be because I build on MacOS, but cannot hurt to add them in general.

EDIT: I noticed that PFba has quite substantial audiolag, I'd say almost 0.4-0.5 seconds. Easily tested with Street Fighter 2. The punch sound should play almost immediately after pressing the punch button, but in PFba there's this noticable delay between pressing the button and the sound. I originally noticed it in Bomb Jack Twin when collecting bombs. Maybe there's an audio buffer that could be reduced?
Just uploaded a new version which seems to fix the audio delay/desync issue (by lowering the audio buffer like you suggested). It will need more testing/reports.
 
  • Like
Reactions: Count Duckula
Just uploaded a new version which seems to fix the audio delay/desync issue (by lowering the audio buffer like you suggested). It will need more testing/reports.

Thanks! However, I just tried Street Fighter 2 Hyper Fighting and now I just get a lot of audio distortion / stutter. The audio issue might be more complex.

EDIT: I think I found the fix:
sample_size/=4; // fix audio delay
buf_size = sample_size * channels * 2 * 8;

instead of
buf_size = sample_size * channels * 4;

Pull request made. And preliminary version uploaded to www.github.com/rsn8887/pfba/releases if anybody wants to test it RIGHT NOW.
 
Last edited by rsn8887,
Thanks! However, I just tried Street Fighter 2 Hyper Fighting and now I just get a lot of audio distortion / stutter. The audio issue might be more complex.

EDIT: I think I found the fix:
sample_size/=4; // fix audio delay
buf_size = sample_size * channels * 2 * 8;

instead of
buf_size = sample_size * channels * 4;

Pull request made. And preliminary version uploaded to www.github.com/rsn8887/pfba/releases if anybody wants to test it RIGHT NOW.

See this : https://github.com/Cpasjuste/pfba/commit/1a816d8261f2d368825840f78c3916a2259d4819 , no more audio delay or worst audio crack at 48khz (it seems). Did a lot of testing on the computer and headsets, this does indeed fix dropped frames (https://github.com/Cpasjuste/pfba/blob/master/pfba/deps/libcross2d/src/sdl2/sdl2_audio.cpp#L36)
This "fix" was found here : https://github.com/libretro/fbalpha/commit/4abd5e2721f892e359eb0368d702e6cc7c28450c
 
I haven't had yet the time to test it, but it seems very interesting.
I don't know if it's possible, but could speedhacks (for example for SF3) be used, like on Snes emulator for Psp?
 
  • Like
Reactions: MKKhanzo
See this : https://github.com/Cpasjuste/pfba/commit/1a816d8261f2d368825840f78c3916a2259d4819 , no more audio delay or worst audio crack at 48khz (it seems). Did a lot of testing on the computer and headsets, this does indeed fix dropped frames (https://github.com/Cpasjuste/pfba/blob/master/pfba/deps/libcross2d/src/sdl2/sdl2_audio.cpp#L36)
This "fix" was found here : https://github.com/libretro/fbalpha/commit/4abd5e2721f892e359eb0368d702e6cc7c28450c

Awesome! This works extremely well. I think my "hack" with the
sample_size /= 4;
is not needed anymore! It works even without that. I have a suspicion the above "/= 4" could cause occasional crackle, or skips, because now the sdl buffer is shorter than the pfba buffer. I removed it in my unofficial test build and tested for a while and it seems fine without it, no delay still.

I uploaded my test version to www.github.com/rsn8887/pfba/releases if anybody wants to test it. The thing to look out for is audio delay and/or crackles or skips. I think they are all gone.
 
Last edited by rsn8887,
This works extremely well. I think my "hack" with the "sample_size /= 4" is not needed anymore! It works even without that.
I found something else. The sound is perfect in almost every games, but games like SF2 and another cave i tested does still have some little cracking sounds. If you set "AUDIO_INTERP" (interpolation) to MIN and "AUDIO_FMINTERP" to OFF, then the sound is 100% perfect :) I added this options because it's available on the windows version, but even there it say it can slow down emulation and such. I think i should remove this option from gui and such definitively.

--------------------- MERGED ---------------------------

I found something else. The sound is perfect in almost every games, but games like SF2 and another cave i tested does still have some little cracking sounds. If you set "AUDIO_INTERP" (interpolation) to MIN and "AUDIO_FMINTERP" to OFF, then the sound is 100% perfect :) I added this options because it's available on the windows version, but even there it say it can slow down emulation and such. I think i should remove this option from gui and such definitively.
I should even also only leave the 48KZ/OFF options as audio frequency does not change a lot on fps.
 
  • Like
Reactions: MKKhanzo
It could be that the remaining cracking sound you hear is JUST ONLY because of my /= 4 hack?! Did you try without that.

But yes, I agree on limiting audio options if it works fine at 48 khz etc. At least on Vita. The less options the user has to make things bad, the better :) That's the beauty of consoles: Programming for a single system that is the same everywhere, the coder can find the optimum settings that work on everybody's machine.
 
Last edited by rsn8887,
It could be that the remaining cracking sound you hear is JUST ONLY because of my /= 4 hack?! Did you try without that.

But yes, I agree on limiting audio options if it works fine at 48 khz etc. At least on Vita. The less options the user has to make things bad, the better :) That's the beauty of consoles: Programming for a single system that is the same everywhere, the coder can find the optimum settings that work on everybody's machine.
The sound is not crackling anymore even with your /= 4 hack. The final trick was the interpolation. Just pushed all the changes, you MUST try SF2 on CPS1, audio is damn perfect ! (if not using a shader which does < 60 fps). You clearly see the difference when comparing this last version with the previous one.
 
  • Like
Reactions: MKKhanzo
With all the talk of audio changes, has anyone else had an issue where all sound stops playing altogether when you launch a game, which remains until pfba is closed and re-opened?

It happened once under pfba-2017.01.24.vpk then again last night with pfba-2017.01.29.vpk.
Both times it occurred after playing/exiting several games, sound works fine in the game I am playing, I then load another and there is no sound. If I then load any other ROM it will also have no sound.

Last night I was playing metal slug 1, then went to load ms pacman and it occurred, last time it was other games so I dont believe its tied to any specific title.

Loving this emulator. Ghouls and ghosts looks awesome with sharp + scan filtering. One of these years I will be coordinated enough to beat the thing :)
 
Last edited by Count Duckula,
Another bug report: Armed Police Batrider needs disable arm 68k core. Main rom (Europe) disables and playable, but clones (Japanese / Korean) don't disable so they aren't playable in PFBA now.
 
Another question from the ignorant PFBA user:
Are PFBA and MAME cores related in any way ?
I'm asking this because I've noticed that The Simpsons (simpsons.zip, system GX072) runs at 59,9 FPS with RetroArch mame2000 core, while it runs at 35 fps on PFBA.
I'm already grateful retroarch and pfba exists at all, I'm not trying to compare those projects, I just want to know if "merging" the cores is doable, because pfba is much more user friendly and mame2000 performances on it would be the best of two worlds.
 

Site & Scene News

Popular threads in this forum