Homebrew RetroArch Switch

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
Ok changed sd card( it was a slow card in order to test in fat32), reinstalled retroarch on sdcard sandisk class10 64gb,fat32, restored default parameter retroarch, and it's ok! Great 1 week I've been struggling with the sound on snes and I eat, and I'm taking care of it and it's fixed, I'm testing it but it looks ok... Maybe an old retroarch config....with a new nsp build, it doesn't look good.
 
Last edited by KHEOPS,

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,261
Country
United States
Retroarch sound continues to be slightly warbly on all cores, I don't think any core is to blame. The recent mgba homebrew sounds fine for instance, but not the mGBA retroarch core.
 

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
Hidden elsewhere: settings->driver->audio driver->switch_thread
Yes I see it, switch> null > switch thread

Rahkeesh
I made this video yesterday
Do you hear audio problems?
Use a headset is more accurate to hear audio problems


Preface

A game console is always in perfect sync with the TV (usually CRT) because the console itself generates the video signal, meanning NTSC games are native in 59.94Hz (audio & video) and that is exactly what the console outputs to the TV.
Emulators on the other hand do NOT have control over the refresh rate of the TV because the GPU of your device generates the video timing and it might not be perfect 59.94Hz as the console outputs.
Lets assume the GPU runs the desktop in 60.01Hz but NTSC games are still 59.94Hz, as you can see there is our problem we are trying to fix.

There are two ways we can run the emulation:

  1. In sync with NTSC audio which will be in perfect pitch in 59.94Hz but the video will be out of sync and stutter.
  2. In sync with the GPU refreshrate but the audio will be out of sync and crackle when the drift is to large.
Since the refreshrate in HZ of the GPU timting is fixed we want to synchronize the NTSC game to it (vsync) thus making the game run several 1/100 of Hz faster, and then fix the resulting audio crackling.
The way retroarch fixes the audio crackling is by changing the NTSC game audio pitch by dynamically adjusting/stretching the audio pitch to be in sync with the GPU refreshrate.
This audio stretching from 59.94HZ to 60.01Hz is roughly 0.1% change in pitch which is inaudible to us but fixes the sync issues.

So let’s begin.



Guide

First thing, make sure the monitor that you’ll be playing Retroarch is the PRIMARY monitor in windows and IN-FOCUS (mouse click it), if you are using multiple monitor setup.
Experience shows that this is the biggest factor in stuttering in retroarch.
I use a 15kHz CRT as an extended monitor with a VGA->ScartRGB cable from my PC, so I make sure it is set to be Primary BEFORE I run Retroarch.

Every monitor has a personal vertical sync timing that should be calibrated first in retroarch.
Go to the Settings -> Video menu.

Windowed Fullscreen Mode -> Off
Vertical Sync (VSync) -> On
Hard GPU Sync -> On
Vertical Refresh Rate.
Estimated Screen Framerate.

Press the “Space” or “Start” key when on “Estimated Screen Framerate” and wait till the counter reaches 2048 smaples.
Now press “Enter” or “X” (dualshock) or “A” (xbox) when still standing on “Estimated Screen Framerate” to update “Vertical Refresh Rate”.
That’s it, you calibrated the vertical sync to your monitor and you can do this procedure as often as you think you need.

This initial calibration is very important since all Audio synchronization and stretching in retroarch rely on this measured “Vertical Refresh Rate” value, so make sure you do it.
etc... Here the link
https://forums.libretro.com/t/perfect-audio-video-synchronization/12072

Or here, where you learn nice things

https://forums.libretro.com/t/defau...ta-value-0-005-is-bad-and-quite-audible/15129
 
Last edited by KHEOPS,

SmashinGit

Active Member
Newcomer
Joined
Jan 18, 2017
Messages
31
Trophies
0
Age
24
XP
1,086
Country
Afghanistan
Any chance the atari800_libretro core will be ported? The reason I ask is Dropzone is one of my favourite games of all time. I can play it on the Commodore 64 core (vice_x64_libretro) but the best version of the game is on the Atari 800xl.
 

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
Any chance the atari800_libretro core will be ported? The reason I ask is Dropzone is one of my favourite games of all time. I can play it on the Commodore 64 core
..

Yes, they will be available.
Opengl has been recently implemented, so it is ready to port the core parallel n64, psp, etc.....
But the atari will be present, be patient, wait until you see retroarch 1.7.6
 
Last edited by KHEOPS,
  • Like
Reactions: SmashinGit

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,261
Country
United States
Can clearly hear crackling in f-zero in that video. I'm not really familiar enough with the other games to have an opinion.

I'm not 100% confident whether anything is wrong with the threaded audio driver, but I've had tons of crackling and wavering pitch with the non-threaded. Sonic 2 on Genesis GX being a great example.

Edit: I always have audio sync on and threaded video if it matters.
 
Last edited by Rahkeesh,

m4xw

Ancient Deity
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
Maybe it's not well optimized for the system.
I would recommend opening up an "Issue" thread on Libretro's GitHub for Snes9x, mentioning that it does stutter or crackles at times with default settings.
https://www.libretro.com/index.php/retroarch-1-7-5-introducing-libnx-switch-version/
Hints
      • In case PCSX ReARMed is running too slowly, go to Settings -> Video and enable Threaded Video. Threaded Video can also help with certain demanding shaders. Please note that Threaded Video can tend to introduce some judder to frame pacing which isn’t there with non-threaded video, so for all other cores you might want to leave this off.

One of my hobbies is to configure mame cabs, more complicated than simple emulators, right? ( it's been more than 15 years now I am very sensitive to vsynchro), video synchronization, custom timeline of frequencies crt tv,and so on, so using retroarch for me is child's play, and I see a lot of messages on forums, which complain. From the difficulty of retroarch, then everyone is different, but when I say that the core snes has a problem, it is that it has a problem.
God fucking damn people.
Its about synchronization of the audio and video buffers :feelsbaguetteman:
video threaded on the switch is implemented just fine, that quote is a copy pasta for desktop versions.
 
Last edited by m4xw,
  • Like
Reactions: ShadowOne333

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
Can clearly hear crackling in f-zero in that video. I'm not really familiar enough with the other games to have an opinion.

I'm not 100% confident whether anything is wrong with the threaded audio driver, but I've had tons of crackling and wavering pitch with the non-threaded. Sonic 2 on Genesis GX being a great example.

Edit: I always have audio sync on and threaded video if it matters.

Yes I had audio problems on my 9x snes or my post above, I fixed the problem precisely, on genesis gx I no longer have any problem...
The original settings are not good, I see you haven't read my post and the links posted, so if like me you are sensitive to audio cracking I give you my settings that correct the genesis
Do not put video threaded!
Launch the sonic2 game, then enter the menu
Quick menu > audio > dynamic audio rate 0.005 ( set a zero) > audio maximum timing skew 0.005 ( set a zero too)
Make a core override save, quit the game then retroarch, restart your genesis games and tell me what you think about it?
Make your report.

M4xw
We have the same functions on all retroarch, android. switch, and pc, the above proof with the genesis audio problem, try my settings, make the difference.
 
Last edited by KHEOPS,

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
Thats expected behaviour, lol.
No
Of retroarch origin
It's dynamic audio rate 0.005
Maximum timing skew 0.005
See the links you have read yet
Now the genesis cracks in the audio with the original settings, with these settings, the genesis, the nes ,the nec pc engine no longer have these problems.
 

m4xw

Ancient Deity
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
No
Of retroarch origin
It's dynamic audio rate 0.005
Maximum timing skew 0.005
See the links you have read yet
Now the genesis cracks in the audio with the original settings, with these settings, the genesis, the nes ,the nec pc engine no longer have these problems.
Am I talking against a wall?
 
  • Like
Reactions: wicksand420

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
In some cores - yes
Oh, well... Okay, all right.
Well I answered to rahkeesh, and he won't have any audio genesis problems with these settings, and no need for video threaded except psx and n64
I answered him my switch on his knees, and the headset on his ears to be sure, and that corrects the problem he had like me
Then no problem, you don't talk to a wall.
 

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,261
Country
United States
Do not put video threaded!
Launch the sonic2 game, then enter the menu
Quick menu > audio > dynamic audio rate 0.005 ( set a zero) > audio maximum timing skew 0.005 ( set a zero too)
Make a core override save, quit the game then retroarch, restart your genesis games and tell me what you think about it?
Make your report.

DARC was already 0.005. AMTS is 0.05, the menu only lets me increment in .01 so I'm not sure how to get it down to 0.005.

Listening more closely I still get very minor crackling in threaded audio. Can hear it on the "SEGA" on Sonic 2 startup. Non-threaded works a billion times worse of course.
 
Last edited by Rahkeesh,

KHEOPS

Well-Known Member
Member
Joined
Aug 29, 2018
Messages
532
Trophies
0
XP
386
Country
France
DARC was already 0.005. AMTS is 0.05, the menu only lets me increment in .01 so I'm not sure how to get it down to 0.005.

Listening more closely I still get very minor crackling in threaded audio. Can hear it on the "SEGA" on Sonic 2 startup. Non-threaded works a billion times worse of course.

No set both values to zero at 0.000
Set to zero? Press left 5 times that's it.
Do not put video threaded
 
Last edited by KHEOPS,

m4xw

Ancient Deity
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,958
Country
Germany
DARC was already 0.005. AMTS is 0.05, the menu only lets me increment in .01 so I'm not sure how to get it down to 0.005.

Listening more closely I still get very minor crackling in threaded audio. Can hear it on the "SEGA" on Sonic 2 startup. Non-threaded works a billion times worse of course.
Try audio latency 120
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/WOppJ92RgGU?si=KE79L6A_3jESsGQM