DS-Homebrew / nds-bootstrap

Boot an nds file
https://wiki.ds-homebrew.com/nds-bootstrap/
GNU General Public License v3.0
1.17k stars 75 forks source link

Korg DS-10 random sound glitches #1031

Closed cruffoc closed 2 years ago

cruffoc commented 3 years ago

Your console: Nintendo DSi XL Launch Method: TLMenu++ v16.6.0 Version used: stable v0.35.1 Game tested/used/applicable: Korg DS-10 Plus [ID 4868] Expected Behavior: stability with sound in a game/software heavily sound oriented Actual Behavior: random glitches while switching between the different menu/interfaces

Steps to reproduce

nds-bootstrap.ini file:

DEBUG = 1
LOGGING = 1
CACHE_FAT_TABLE = 0
ROMREAD_LED = 0
DMA_ROMREAD_LED = -1
CONSOLE_MODEL = 0
CACHE_BLOCK_SIZE = 1
PRECISE_VOLUME_CONTROL = 0
SOUND_FREQ = 0
NDS_PATH = sd:/roms/nds/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).nds
SAV_PATH = sd:/roms/nds/saves/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).sav
AP_FIX_PATH = sd:/_nds/TWiLightMenu/apfix/VKGE-3974.ips
RAM_DRIVE_PATH = sd:/null.img
LANGUAGE = 1
DSI_MODE = 0
BOOST_CPU = 1
BOOST_VRAM = 1
EXTENDED_MEMORY = 2
DONOR_SDK_VER = 5
PATCH_MPU_REGION = 0
PATCH_MPU_SIZE = 0
CARDENGINE_CACHED = 1
FORCE_SLEEP_PATCH = 0
HOMEBREW_ARG =

Logs

NDSBTSRP.LOG

findModuleParamsOffset:
Module params offset restored: 02004FCC
sdk_version: 05037533
This rom is compressed

Switched to NTR mode BIOS
relocate_ce9
firstCardLocation 02003000 : 02780000

armReadCardLocation 020030EC : 02780000

thumbReadCardLocation 02003110 : 02780000

armReadCardDmaLocation 02003140 : 02780000

armReadSlot2Location 02003164 : 02780000

armSetDmaCardLocation 02003198 : 02780000

thumbReadCardDmaLocation 020031D0 : 02780000

thumbSetDmaCardLocation 020031F0 : 02780000

armReadNandLocation 0200321C : 02780000

thumbReadNandLocation 02003248 : 02780000

armWriteNandLocation 02003270 : 02780000

thumbWriteNandLocation 02003290 : 02780000

armIrqEnableLocation 020032C0 : 02780000

thumbIrqEnableLocation 020032E0 : 02780000

pdashReadLocation 0200330C : 02780000

thumbReadSlot2Location 02003330 : 02780000

ipcSyncHandlerLocation 02003370 : 02780000

resetLocation 0200339C : 02780000

globalCardLocation 02003F94 : 02780000

 ce9->patches 02003030

patchCardNds

[SDK 5]

swi12 location : 0200413A

dsiModeCheck location : 02004EB4

cardIrqEnable location : 02016AEC

startOffset : 02004000

cardRead location : 0200E28C

cardPullOut location : 0200E844

cardId location : 0200E07C

patchCardSetDma
cardReadDma location : 0200E4F4

ERR_NONE

Arm7 (patch v5)
Relocation src: 02380644
JumpTableFunc: 0238FB14
card read:  0238FAFC
Eeprom read:    0238FB20
Eeprom page write:  0238FB38
Eeprom page prog:   0238FB50
Eeprom verify:  0238FB68
Eeprom page erase:  0238FB7C
swi12 location : 02383BA4

swiGetPitchTable location : 02383BB8

ERR_NONE

hookNdsRetailArm7
hookLocation arm7: 02391918

ERR_NONE
hookLocation arm9: 02FE0020

ROM loaded into RAM
Complete 12MB used

AP-fix found and applied
chipID: C0001FC2

debug: true
ndsPath: "sd:/roms/nds/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).nds"
savPath: "sd:/roms/nds/saves/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).sav"
donorE2Path: ""
donor2Path: ""
donor3Path: ""
donorPath: ""
donorTwlPath: ""
saveSize: 80000
language: 1
dsiMode: 0
donorSdkVer: 5
patchMpuRegion: 0
patchMpuSize: 0
ceCached: true
cacheBlockSize: 8000
extendedMemory: true
consoleModel: 0
colorMode: 0
romRead_LED: 0
dmaRomRead_LED: FFFFFFFF
boostCpu: true
boostVram: true
soundFreq: false
forceSleepPatch: false
logging: true
initDisc: false
gameOnFlashcard: false
saveOnFlashcard: false
backlightMode: 0

Other notes

rafaelpernil2 commented 3 years ago

I am facing the same issues

rafaelpernil2 commented 3 years ago

I have found out that it works flawlessly on version v10.0.1. I have installed it on another SD card so that I can use KORG DS-10 and KORG M01 until this issue is fixed.

RocketRobz commented 3 years ago

@rafaelpernil2 Is this a TWLMenu++ version or an nds-bootstrap version?

rafaelpernil2 commented 3 years ago

@RocketRobz It is a TWLMenu++ version https://github.com/DS-Homebrew/TWiLightMenu/releases/tag/v10.0.1

RocketRobz commented 3 years ago

That would mean that nds-bootstrap v0.25.3 and later have brought back the issue somehow. Also, are you using a DSi or 3DS?

@cristobalruffo Can you try turning off Expand ROM space in RAM for that game?

rafaelpernil2 commented 3 years ago

I am using a DSi with TWLMenu++v16.6.0, the same as @cristobalruffo

rafaelpernil2 commented 3 years ago

Another way to replicate the same issue Korg M01 [ID 5549], simply by playing "Demo Song 1", at some point the audio overloads and starts glitching.

Also when the lid is closed, using headphones, the audio pops a few times per second, constantly, like a rhythm.

I tried with Expand ROM space in RAM on and off with no success. Here is my nds-bootstrap.ini file:

DEBUG = 0
LOGGING = 0
CACHE_FAT_TABLE = 0
ROMREAD_LED = 0
DMA_ROMREAD_LED = -1
CONSOLE_MODEL = 0
CACHE_BLOCK_SIZE = 0
PRECISE_VOLUME_CONTROL = 0
SOUND_FREQ = 0
NDS_PATH = sd:/roms/nds/5549 - KORG M01 - Music Workstation (J)(PLAYASiA).nds
SAV_PATH = sd:/roms/nds/saves/5549 - KORG M01 - Music Workstation (J)(PLAYASiA).sav
RAM_DRIVE_PATH = sd:/null.img
LANGUAGE = -1
DSI_MODE = 0
BOOST_CPU = 0
BOOST_VRAM = 0
EXTENDED_MEMORY = 1
DONOR_SDK_VER = 0
PATCH_MPU_REGION = 0
PATCH_MPU_SIZE = 0
CARDENGINE_CACHED = 1
FORCE_SLEEP_PATCH = 0
AP_FIX_PATH = sd:/_nds/TWiLightMenu/apfix/BZMJ-ED97.ips
rafaelpernil2 commented 3 years ago

I can also confirm that the audio stops properly when closing the lid on TWLMenu++ v10.0.1, it seems to be related with this issue.

cruffoc commented 3 years ago

thanks to everybody for collaborating

That would mean that nds-bootstrap v0.25.3 and later have brought back the issue somehow. Also, are you using a DSi or 3DS?

@cristobalruffo Can you try turning off Expand ROM space in RAM for that game?

I can ensure I have tried many config parameters combinations. I have done what you requested and the issue prevail. Actualy it seems to be even worst; once the random glitch was triggered I wasn't able to "turn it off" sort-of-speak as I showed in my demo video before. I had to close and open the project again. I will keep testing but yea, problem persists.

I've been reviewing this once again and I should add that I believe it is something related with DSi enhanced games. Korg DS-10 [ID 2768] doesn't present any issues whatsoever. After I opened this report I remember I wanted to try the "enhanced" version to see if there was any improvements software-wise. To my surprise was the same but then I faced this issue when I decided to update as I mentioned before.

rafaelpernil2 commented 3 years ago

@cristobalruffo KORG M01 is not a DSi enhanced game, so the issue is probably not related with "DSi mode"

rafaelpernil2 commented 3 years ago

I am currently trying different versions of TWLMenu++ to find the version where this issue first appeared. Will report back later.

rafaelpernil2 commented 3 years ago

@RocketRobz Good news, I have found the first version to contain this bug:

Last working version: TWLMenu++ v10.2.0 / nds-bootstrap v0.26 First appearance of the bug: TWLMenu++ v10.3.0 / nds-bootrstrap v0.26.1

So, it seems like the bug was intruduced in nds-bootstrap v0.26.1

I hope this information helps you locate and fix the bug :)

cruffoc commented 3 years ago

I have setup another SD Card with the version @rafaelpernil2 had mentioned but I keep getting this issue.

nds-bootstrap.ini:

DEBUG = 1
LOGGING = 1
ROMREAD_LED = 0
LOADING_SCREEN = 1
CONSOLE_MODEL = 0
PRECISE_VOLUME_CONTROL = 0
COLOR_MODE = 0
SOUND_FREQ = 0
NDS_PATH = sd:/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).nds
SAV_PATH = sd:/saves/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).sav
AP_FIX_PATH = sd:/_nds/TWiLightMenu/apfix/VKGE-3974.ips
RAM_DRIVE_PATH = sd:/null.img
LANGUAGE = -1
DSI_MODE = 0
BOOST_CPU = 0
BOOST_VRAM = 0
DONOR_SDK_VER = 5
GAME_SOFT_RESET = 0
PATCH_MPU_REGION = 0
PATCH_MPU_SIZE = 0
CARDENGINE_CACHED = 0
FORCE_SLEEP_PATCH = 0

NDSBTSRP.LOG:

findModuleParamsOffset:
Module params offset restored: 02004FCC
sdk_version: 05037533
This rom is compressed
Secure area already decrypted
patchCardNds

[SDK 5]

Found cardId

ERR_NONE

Arm7 (patch v5)
Relocation src: 02380644
JumpTableFunc: 0238FB14
card read:  0238FAFC
Eeprom read:    0238FB20
Eeprom page write:  0238FB38
Eeprom page prog:   0238FB50
Eeprom verify:  0238FB68
Eeprom page erase:  0238FB7C
ERR_NONE

ERR_NONEhookNdsRetailArm7
hookLocation arm7: 02391918

ERR_NONE
hookLocation arm9: 02FE0020

chipID: C0001FC2

debug: true
ndsPath: "sd:/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).nds"
savPath: "sd:/saves/4868 - Korg DS-10+ Synthesizer (DSi Enhanced) (U).sav"
saveSize: 80000
language: FF
dsiMode: (null)
donorSdkVer: 5
patchMpuRegion: 0
patchMpuSize: 0
ceCached: false
consoleModel: 0
colorMode: 0
romread_LED: 0
boostCpu: false
boostVram: false
soundFreq: false
gameSoftReset: false
forceSleepPatch: false
logging: true
initDisc: true
gameOnFlashcard: false
saveOnFlashcard: false
backlightMode: 0
rafaelpernil2 commented 3 years ago

@cristobalruffo TWLMenu++ 10.2.0? Or you just downgraded nds-bootstrap? I tested swapping TWLMenu++ versions

cruffoc commented 3 years ago

@rafaelpernil2 I have downloaded v10.2.0 from releases' page, although I'm not sure if I'm copying the correct files since there is many folders and files depending on your device. I copied everything named DSi on its folder, plus _nds folder

Screenshot_20201107_180817

rafaelpernil2 commented 3 years ago

That's exactly what I did (also including version.txt and AP-patched games.txt). But I also removed _nds folder from the SD card before copying those files. Could that be the issue? I think, at some point, the folder structure/naming for nds-bootstrap.nds changed.

I tested Korg DS10+ tweaking many parameters and switching pages for some minutes trying to reproduce the bug and couldn't do it on v10.2.0.

rafaelpernil2 commented 3 years ago

I tried again just to confirm and Korg DS10+ is working perfectly for me on TWLMenu++ v10.2.0. Not a single glitch.

cruffoc commented 3 years ago

oh man this pisses me off badly. it's either the rom, sd card or my console (I'm using a DSi XL btw). I did this with another (micro) SD Card I'm gonna send you an email (the one specified in your github profile) to discuss something that I'm not legally allowed to discuss here I would presume.

Could this be in any way an SD Card format issue? I'm just thinking out loud because now I have no idea. I will keep trying different parameters / sd's / anything else.

rafaelpernil2 commented 3 years ago

Well, if it helps, I followed these steps when formatting the SD card and checking for errors: https://dsi.cfw.guide/sd-card-setup but it worked well too with a micro SD card formatted with Windows

Are you changing the game settings in Twilight Menu? Just to make sure. In my case, I am using default settings at all times.

piratesephiroth commented 3 years ago

yeah always format with 32K clusters

cruffoc commented 3 years ago

I have done eveything from zero with another SD card I don't get to solve this. if needed, I would provide more information in order to identify the root of the issue

cruffoc commented 3 years ago

I have found a workaround: it seems the last opened game is registered by TWLMenu somewhere within its files. I have copied bootstrap v0.26 files in a separated folder. When I open it bootstrap v0.26, it opens up the last rom I have opened trough TWLMenu before (which was Korg DS-10) and work flawlessly, no glitches at all. I'm not really sure why I don't get this right when trying with another different SD Card with the whole old working release. I found this solution while trying to make a Forwarder this this tool, which allows you specify a bootstrap-nds file of your preference. While doing so, the created forwarder started Animal Crossing instead of Korg DS-10, didn't understand this shenanigans at all until I remembered what it was the last game I played before. Still I believe I'm making quite a mess but anyways, this is just for the sake of documentation.

rafaelpernil2 commented 3 years ago

I think what happened is that you were using the internal NAND instead of Hiya for launching TWLMenu++. That would explain why, no matter which version you tried to copy to your SD, the outcome was always the same and that you needed to re-route nds-bootstrap manually.

Make sure to boot from hiya.dsi by assigning "NO BUTTON" mapping to it (see https://dsi.cfw.guide/installing-hiyacfw.html#section-iii---configuring-unlaunch-and-hiyacfw )

rafaelpernil2 commented 3 years ago

Now we have confirmation of the bug origin from two different sources.

To wrap up: nds-bootstrap v0.26.1 introduced this bug, v0.26 works flawlessly.

Thanks for your amazing work and it would be great if you fixed this issue for the next version 😊

Caio-Branco commented 3 years ago

Sorry for necroing the other Issue about the sound issues with the Korg synths. I will try the solutions in this thread and report back if needed. Thanks for keeping this alive, these cartridges are very rare and hoping for a fix on the latest version.

cruffoc commented 3 years ago

Sorry for necroing the other Issue about the sound issues with the Korg synths. I will try the solutions in this thread and report back if needed. Thanks for keeping this alive, these cartridges are very rare and hoping for a fix on the latest version.

as @rafaelpernil2 mentioned, be sure to be running under HiyaCFW first, otherwise you'll be getting the bug anyways. I've been keeping a copy of nds-bootstrap 0.26 on me and when I want to use any of the korg nds', I open them normally, then I reset and open bootstrap 0.26 which will automatically open the last nds file opened before.

Caio-Branco commented 3 years ago

Sorry for necroing the other Issue about the sound issues with the Korg synths. I will try the solutions in this thread and report back if needed. Thanks for keeping this alive, these cartridges are very rare and hoping for a fix on the latest version.

as @rafaelpernil2 mentioned, be sure to be running under HiyaCFW first, otherwise you'll be getting the bug anyways. I've been keeping a copy of nds-bootstrap 0.26 on me and when I want to use any of the korg nds', I open them normally, then I reset and open bootstrap 0.26 which will automatically open the last nds file opened before.

I just want to report back that I've done a TWL 10.2.0 with bootstrap 0.26 clean install on a formatted SD and all Korg Synths run flawlessly either with all default settings or DSi mode (not forced as it crashes) I don't know if its placebo that the M01 and DS-10+ would run smoother in this mode but they don't break, even under some playback stress.

Again thank you guys for keeping this alive and hoping it gets fixed on the main release cause i can see some interest coming soon as it really is an impressive piece of software for any gaming console music-wise, no wacky stripped-down music toy we used to see around this era but a fully-featured analog tracking station of sorts from Korg and it sounds good, I'm sure yall seen the youtube videos. Cheers.

RocketRobz commented 2 years ago

Recent versions should already fix the sound issues.