mungewell / zoom-zt2

Python script to install/remove effects from the Zoom G1Four pedal
MIT License
50 stars 10 forks source link

Comparing ZDL files with ZD2 #53

Open SafalChapagain opened 1 year ago

SafalChapagain commented 1 year ago

Disassembling the ZD2 ELF and ZDL ELF for Exciter, you can see that they're actually not too dissimilar.

I used the V1.0 Exciter.ZD2 from here: https://www.zoom.co.jp/archive/ZDLM/ZDLF/EXCITER.zip And the ZDL from the MS70CDR from here: https://github.com/shooking/ZoomPedalFun/tree/main/MS70CDR/DerivedData/2.10

I disassembled it using the assembly tools from here: https://www.ti.com/tool/C6000-CGT

I wonder if ZDL ELFs will just work on ZD2 pedals outright, as long as you use some other ZD2 as a base? My G1X Four hasn't actually arrived yet, but I'd be willing to try doing that.

out_zdl.txt out_zd2.txt

Side note: where did you get ALLZDL7.lst from? I can't seem to get it from https://www.zoom.co.jp/archive/ZDLM/AllZDL7.lst

mungewell commented 1 year ago

I'm not too sure, but can throw a 'mutant' ZD2 onto my 'crappy/broken' G1Four next weekend - I'd prefer to use this just in-case something goes massively wrong...

In #52 we got the understanding that the 'OS' looks for a couple of Symbols in-order to read/display the Icon it uses on the pedal, and these are not in the CODE section of the ZDL. It might not matter if these don't exist, or perhaps we can add extra onto the end of the .const section to place them (or something appropriate).

It could be that the MS (ZDL) have a totally different way of sending/receiving audio to effect, and controlling it's settings...

There's a project 'zdownload' which will automatically download all the effects from Zoom. https://github.com/fuzboxz/zdownload

I have the follow URLs.

zdl_url = "http://www.zoom.co.jp/archive/GUITAR_LAB/ZDLF7_2/"
r = requests.get("https://www.zoom.co.jp/archive/GUITAR_LAB/AllZDL7.lst")
mungewell commented 1 year ago

Is there a particular reason (or effect) you want ZDL effects on the G1Four?

Do the other ZD2 from the 'fancy' pedals cover your needs?

SafalChapagain commented 1 year ago

Is there a particular reason (or effect) you want ZDL effects on the G1Four?

Do the other ZD2 from the 'fancy' pedals cover your needs?

I'm mostly just curious. I did see some ZDL effects that didn't seem to be on any of the ZD2 devices (e.g. LOFI Rev from the MS70CDR).

I've just found https://github.com/ELynx/zoom-fx-modding which has a step-by-step guide for creating completely new ZDL effects, which might come in handy.

It could be that the MS (ZDL) have a totally different way of sending/receiving audio to effect, and controlling it's settings...

I got some dumps:

ofd_zdl.txt ofd_zd2.txt

There are some differences, it looks like.

For example: The zd2's relocation table:

    -- ----            ------     --- ----                     
     0 R_C6000_ABS_L16 0x000005c4   5 _Fx_FLT_Exciter_Coe      
     1 R_C6000_ABS_H16 0x000005c8   5 _Fx_FLT_Exciter_Coe      
     2 R_C6000_ABS_L16 0x00000610   4 $C$T0                    
     3 R_C6000_ABS_H16 0x00000614   4 $C$T0                    
     4 R_C6000_ABS_L16 0x000006c8  22 Exciter                  
     5 R_C6000_ABS_L16 0x000006cc  21 effectTypeImageInfo      
     6 R_C6000_ABS_H16 0x000006d0  22 Exciter                  
     7 R_C6000_ABS_H16 0x000006d8  21 effectTypeImageInfo      
     8 R_C6000_ABS_L16 0x000006e0  20 g_MultiFswTbl_Exciter    
     9 R_C6000_ABS_H16 0x000006e8  20 g_MultiFswTbl_Exciter    
    10 R_C6000_ABS32   0x8000001c  19 Fx_FLT_Exciter_onf       
    11 R_C6000_ABS32   0x80000054  18 Fx_FLT_Exciter_init      
    12 R_C6000_ABS32   0x80000058  17 Fx_FLT_Exciter           
    13 R_C6000_ABS32   0x8000008c  16 Fx_FLT_Exciter_loConto...
    14 R_C6000_ABS32   0x800000c4  15 Fx_FLT_Exciter_process...
    15 R_C6000_ABS32   0x800000fc  14 Fx_FLT_Exciter_outlv_edit
    16 R_C6000_ABS32   0x80000134  13 Fx_FLT_Exciter_dummy_edit
    17 R_C6000_ABS32   0x80000158  12 picTotalDisplay_Exciter  
    18 R_C6000_ABS32   0x80000164  11 CategoryIcon_Filter      
    19 R_C6000_ABS32   0x80000170  10 AddDelIcon_Filter        
    20 R_C6000_ABS32   0x8000018c   9 g_Exciter_FswPrmPic1     
    21 R_C6000_ABS32   0x800001b0   8 _PrmPic_Treble           
    22 R_C6000_ABS32   0x800001c8   7 _PrmPic_ON_OFF           
    23 R_C6000_ABS32   0x80000364   1 VOLUME_0_80_100          
    24 R_C6000_ABS32   0x80000438   3 _picFsw_LATCH            
    25 R_C6000_ABS32   0x80000444   2 _picFsw_UnLATACH         
    26 R_C6000_ABS32   0x80000448   6 Exciter_Multi1Tbl       

Compared to the ZDL's relocation table:


    id type            offset     sym name                     
    -- ----            ------     --- ----                     
     0 R_C6000_ABS_L16 0x000005d4   1 _Fx_FLT_Exciter_Coe      
     1 R_C6000_ABS_H16 0x000005e0   1 _Fx_FLT_Exciter_Coe      
     2 R_C6000_ABS_L16 0x00000664  11 SonicStomp               
     3 R_C6000_ABS_L16 0x00000668  10 effectTypeImageInfo      
     4 R_C6000_ABS_H16 0x0000066c  11 SonicStomp               
     5 R_C6000_ABS_H16 0x00000674  10 effectTypeImageInfo      
     6 R_C6000_ABS32   0x8000026c   9 Fx_FLT_Exciter_onf       
     7 R_C6000_ABS32   0x8000029c   8 Fx_FLT_Exciter_init      
     8 R_C6000_ABS32   0x800002a0   7 Fx_FLT_Exciter           
     9 R_C6000_ABS32   0x800002cc   6 Fx_FLT_Exciter_loConto...
    10 R_C6000_ABS32   0x800002fc   5 Fx_FLT_Exciter_process...
    11 R_C6000_ABS32   0x8000032c   4 Fx_FLT_Exciter_outlv_edit
    12 R_C6000_ABS32   0x80000354   3 picEffectType_Exciter    
    13 R_C6000_ABS32   0x80000370   2 _infoEffectTypeKnob_A_2  
    14 R_C6000_ABS32   0x80000380   2 _infoEffectTypeKnob_A_2  
    15 R_C6000_ABS32   0x80000390   2 _infoEffectTypeKnob_A_2

Not too sure how relevant it is though.

nomadbyte commented 1 year ago

The Zoom MS (multi-stomps) use ZDL format, which is ZDL 1.0, while we're dealing with ZD2 (2.0). The ZDL file starts with a rather short header, and the goes the ELF, no descriptions and JSON parts.

Some effects are very much named the same as in ZD2 set, so must have been migrated from ZDL (BOMBER.ZDL, SUPERCHO.ZDL, ZNR.ZDL, RNDMFLTR.ZDL). It may be possible to match the ELFs but at the present point I don't see much value in that, as the current knowledge about ZD2 we've collectively accumulated seems sufficient for the desired utility. For one, I'm not foreseeing the degree of modding the ELynx project above does to be applied to ZD2 effects.

At some point, the software effort overpowers the direct utility of actually making use of the device for what it already can do.

Though, I admit, at an instant being distracted by "Mangled Space" effect on MS-70CDR and even pulled the ELF to examine (MNGLD_SP.ZDL), but then reminded myself that it's just another Delay of which there are plenty on G Series.

Anyway, before experimenting any further with the code non-native to the actual hardware series (G Series), I'd urge you guys try to figure out how to enable overwriting of the filesystem part of the Flash storage from the Firmware Updater. As you may know, for G1 FOUR (at least), the Firmware Update apparently overwrites only Boot, Main, and Presets parts, it skips the filesystem ref: Issue 37 . Thus if any patched or foreign module locks up on boot -- there's no easy way to overwrite the filesystem to Factory state as is in the Firmware, this would render the pedal unusable, just as @mungewell discovered with trying out V6-SP effects

SafalChapagain commented 1 year ago

I'd urge you guys try to figure out how to enable overwriting of the filesystem part of the Flash storage from the Firmware Updater.

To be honest, I'm not too comfortable working on that. It seems like it's likely to brick your system if something does go wrong, and I don't have a broken pedal to test it with.

I had a question though, around how many effects can you get on one of the devices? What is it limited by? I was thinking of remaking the 'compressor' that ELynx made for ZD2 by stripping the debug info, which seems easy enough to do.

SafalChapagain commented 1 year ago

I was thinking of remaking the 'compressor' that ELynx made for ZD2 by stripping the debug info, which seems easy enough to do.

I've done this, my results are here: https://github.com/SafalChapagain/zoom-zd2-compressed

Note: I haven't actually tested these yet.

mungewell commented 1 year ago

Following on from discussion yesterday, I spent a while looking at hexdumps of the .const section of various ZD2 effects. I think I have an appreciation of how the effect's characteristics are communicated to the pedals 'OS'.

I think that this is worth writing up as a Wiki, although this is really outside the scope of this project. But willing to host here and open up editing to the 'team'...

If I was to suggest a path forward, it might be to look at how the BDL from the G1Four and B1Four vary. I suspect that this is a just a different EQ table - to make the pedal more suited to the bass frequencies.

As to @nomadbyte suggestion on the installer, there's probably something that does a checksum/validation of the internal drive... once that code is found a simple hex edit could mean that it always fails and re-writes the internal drive.

nomadbyte commented 1 year ago

@SafalChapagain : I was thinking of remaking the 'compressor' that ELynx made for ZD2 by stripping the debug info, which seems easy enough to do.

Stripping the debug info will just make the ELF somewhat smaller. So the direct benefit may be in freeing some internal space on the pedal's filesystem. In case of G Series this is not very relevant, as you can freely remove and install any ZD2 modules using either editors (GuitarLab, ToneLib) or this zoom-zt2 tool.

On the other hand, messing with assembly modules embedded in the effect's ELF is what the ELynx project is really about for the purpose of tuning the actual functioning of the effect. This part is akin to brain surgery, so one needs to know what to change -- a wrong or heavy-handed approach may lead to the effect's module locking up on boot, which would indeed render the pedal unusable. Thus, the Firmware Updater needs to be able to rescue the experimenter's ass, yet looks like it's not set up to do that, as is (for G1 FOUR at least).

mungewell commented 1 year ago

I started a write up here: https://github.com/mungewell/zoom-zt2/wiki/ZD2-ELF-Dissection

SafalChapagain commented 1 year ago

On the other hand, messing with assembly modules embedded in the effect's ELF is what the ELynx project is really about. This part is akin to brain surgery, so one needs to know what to change

I understand. I was thinking of trying to decipher the disassembled ELFs which might give some insight into porting ZDL effects to ZD2 hardware (and maybe make it possible to make your own ZD2s) but I'm not sure if it's worth the effort (and risk, now).

a wrong or heavy-handed approach may lead to the effect's module locking up on boot, which would indeed render the pedal unusable

I see. @mungewell, what did you do to fix the pedal locking up?

mungewell commented 1 year ago

@SafalChapagain Honestly I don't know, I suspect I happened to poke a wire at the right time.... for it to decide to fix itself. I also don't know if the contents of the drive was reset to that embedded within the FW image.

SafalChapagain commented 1 year ago

I'm not too sure, but can throw a 'mutant' ZD2 onto my 'crappy/broken' G1Four next weekend - I'd prefer to use this just in-case something goes massively wrong...

@mungewell Do you have access to this G1Four now?

Also, I tested the ZD2 files with the debug info stripped that I posted (https://github.com/SafalChapagain/zoom-zd2-compressed) and they work perfectly. Lets me get quite a few more effects on there before filling up the memory which is quite useful since I'm using it for both guitar and bass.

nomadbyte commented 1 year ago

...Lets me get quite a few more effects on there before filling up the memory

G1 FOUR easily fits ~70 effect modules, dividing into 3 parts (Guitar, Bass, Acoustic Guitar) this evenly would yield ~23 modules in each group. Isn't it quite a bit? Imagine a pedal board even with a half of this count -- it would be quite enormous!!

I guess, it starts with some strategy of what sort of "coloring" makes sense in a given context/style/instrument. Squeezing in a few more effect modules won't solve this as such, in fact it may just muddy this even more, as some effects are just marginally different.

This zoom-zt2 utility already gives a versatility and a choice to set up a more fitting effects toolbox by selectively assembling only effect modules that make sense to use together in whatever patches. I'd rather "optimize" this selection instead of cramming even more effects in, just in case.

mungewell commented 1 year ago

@SafalChapagain I was able to test with my 'broken' G1Four this morning and can confirm that 'mutant' ZD2 are not a good idea... after upload the pedal crashed and would not connect (midi) to PC when rebooted.

Do NOT uploaded a 'mutant' (ZDL in ZD2 container), you will BRICK your pedal.

Characteristic; after boot the LEDs do their 'sweep' the pedal and would normally light a single LED (indicating the group 1-5), this did not happen with bricked pedal and no LEDs were lit. This pedal has broken screen and I can not tell if there was any on-screen message.

Pedal was NOT recovered by re-flashing the FW.

Finally I was able to recover, by temporarily/intermittently/randomly shorting the various pins of the SPI EEPROM to ground whilst rebooting. When 'successful' a single (group) LED was lit and I could use my zoomzt2 tools to remove the 'mutant' from the pedal/FLST_SEQ.ZT2.

After which the pedal you boot normally.

nomadbyte commented 1 year ago

... Pedal was NOT recovered by re-flashing the FW.

The fw installer apparently does not rewrite the flash memory content; not in the normal running mode, at least. It's easy to confirm this by deleting some installed by default .ZD2 (like COMP.ZD2) and see if the fw installer would restore it.

Roseweave commented 1 year ago

@SafalChapagain I was able to test with my 'broken' G1Four this morning and can confirm that 'mutant' ZD2 are not a good idea... after upload the pedal crashed and would not connect (midi) to PC when rebooted.

Do NOT uploaded a 'mutant' (ZDL in ZD2 container), you will BRICK your pedal.

Characteristic; after boot the LEDs do their 'sweep' the pedal and would normally light a single LED (indicating the group 1-5), this did not happen with bricked pedal and no LEDs were lit. This pedal has broken screen and I can not tell if there was any on-screen message.

Pedal was NOT recovered by re-flashing the FW.

Finally I was able to recover, by temporarily/intermittently/randomly shorting the various pins of the SPI EEPROM to ground whilst rebooting. When 'successful' a single (group) LED was lit and I could use my zoomzt2 tools to remove the 'mutant' from the pedal/FLST_SEQ.ZT2.

After which the pedal you boot normally.

Are the compressed ZD2s still okay though?

Roseweave commented 1 year ago

I was thinking of remaking the 'compressor' that ELynx made for ZD2 by stripping the debug info, which seems easy enough to do.

I've done this, my results are here: https://github.com/SafalChapagain/zoom-zd2-compressed

Note: I haven't actually tested these yet.

If this works, this is an absolute game changer for me. I recently took up Bass and was having to face the possibility of getting a second unit. Now I should be able to fix on some Bass amps as well as some effects I didn't previously have space for. Thank you for this.

SafalChapagain commented 1 year ago

Are the compressed ZD2s still okay though?

Yeah, they seem to work. I've got the compressed versions running on my G1X Four right now (in fact for your exact use case as well). Use the bass amps/effects from the B1X Four for the best results. A lot of the ones from the upgraded models don't work on the G1/X Four, though there are actually some that do.

Roseweave commented 1 year ago

Are the compressed ZD2s still okay though?

Yeah, they seem to work. I've got the compressed versions running on my G1X Four right now (in fact for your exact use case as well). Use the bass amps/effects from the B1X Four for the best results. A lot of the ones from the upgraded models don't work on the G1/X Four, though there are actually some that do.

Just one more issue! The compressed G11 files seem to be outdated - they recently added all the bass effects among other things, some of which I don't think are available on the B1xFour/B3n but may work. Specifically, the Bass Analogue Octave effect. I also want to chance my ass with the SUNN amp and see if I can get it working(hopefully there'll be a workaround for the multiscreen thing). The only version is the G6 version which seems to have a strange format compared to the others(everything ends in 88). I was able to get the Polyshift from the G11 to work, amazingly, so there's hope for other effects.

If I can find a more recent dump I can try some stuff out and see what works, is it easy enough to compress them myself? Do I have to disassemble?

Roseweave commented 1 year ago

Just tried the AnaOct - it loads!

https://drive.google.com/file/d/1tjwrN_zcD5X8I8RkbPobnA-PuioDkrQs/view?usp=sharing here's the file for future inclusion. you can get the rest of the files downloading the latest G11 update and extracting