SD info and benchmarks (was Re: EOS M3 porting) - page 6 - DryOS Development - CHDK Forum

SD info and benchmarks (was Re: EOS M3 porting)

  • 62 Replies
  • 41157 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #50 on: 06 / May / 2017, 08:12:21 »
Advertisements
Here's a CHDK-less SD benchmark.
Thanks. I finally had the chance trying it.
Here is a typical run (from CBasic), using a Sony branded 16GB (UHS-I, U1, "94MB/s") card that looks similar to this:
Code: [Select]
loaded A/CBBENCH.BIN size 132 at 0x005325c0
time 2770 speed 46 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2930 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
min 2770 max 2940 avg 2917 avg speed 43 MB/s
It looks like 43MB/s is the maximum writing speed that can be expected (cam was the M10, same results with/without CHDK + card reset hack). Apparently, "we" did not get the same card speed as the 80D.
The CHDK benchmark module's results are much worse and fluctuating.

*

Offline reyalp

  • ******
  • 14126
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #51 on: 06 / May / 2017, 18:00:27 »
Here's a CHDK-less SD benchmark.
Thanks. I finally had the chance trying it.
Here is a typical run (from CBasic), using a Sony branded 16GB (UHS-I, U1, "94MB/s") card that looks similar to this:
Code: [Select]
loaded A/CBBENCH.BIN size 132 at 0x005325c0
time 2770 speed 46 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2930 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
time 2940 speed 43 MB/s
min 2770 max 2940 avg 2917 avg speed 43 MB/s
It looks like 43MB/s is the maximum writing speed that can be expected (cam was the M10, same results with/without CHDK + card reset hack). Apparently, "we" did not get the same card speed as the 80D.
I'm not surprised, we have seen cameras with the "same" digic give different performance before. The same CPU can be tied to peripherals with faster or wider buses etc. The RAM difference Ant pointed out would only apply the difference were in a very limited number of RAM buffered shots.

It would be interesting to see what results you get on sx280.

It might also be interesting to benchmark the card in a PC with a fast UHS reader.
Quote
The CHDK benchmark module's results are much worse and fluctuating.
It would be nice to figure out why this happens.

Once difference is that cbbench does one open, 16 writes and then a close, while the CHDK benchmark does an open / close cycle for each write. The open/closes aren't included in the benchmark time in either case, but might affect overhead in other ways.

If the camera were buffering a significant amount of data until close, this could give cause inaccurate results, but IMO 128 MB is much more than the firmware buffers at this level, and the results bear it out: If a substantial portion was being buffered, slow cards would appear as fast as fast cards.

When I did the parallel DNG code, we noticed close can take a noticeable amount of time (~tens of ms) but this is small in comparison to multi-megabyte write times.

Another difference is that cbbench uses a fixed 8 MB write size (which IIRC one of the common block sizes SD cards use) while CHDK bench a fraction of the raw buffer size, which likely does not match any of the underlying block sizes.

CHDK tries to use the raw buffer, but in playback mode that address space may be used for something else. cbbench uses the start of uncached address space, which may be suspect given that the some of the corresponding cached address space is likely occupied by TCM. It might make more sense to start with uncached + 1 MB or something like that.
Don't forget what the H stands for.


*

Offline Ant

  • *****
  • 509
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #53 on: 07 / May / 2017, 16:28:13 »
It looks like 43MB/s is the maximum writing speed that can be expected (cam was the M10, same results with/without CHDK + card reset hack). Apparently, "we" did not get the same card speed as the 80D.

Do you have logs for this card?
What is the second value in message "USetAcMd(%d,%d)s" ?

*

Offline srsa_4c

  • ******
  • 4451
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #54 on: 08 / May / 2017, 20:51:52 »
Do you have logs for this card?
What is the second value in message "USetAcMd(%d,%d)s" ?
Code: [Select]
Sony 16G UHS-I U1, "94MB/s"

SetSSCG(12,0)s
HWInit(0)s
SWInit(0)s
SetUHSMod(0,1)s
RegPowCF(0)s
CardInit(0)s
GetCrdTyp(0)s
GetCmnReg(0)s
SdGetReg(0)s
GetRUS(0)s
GetSpd(0)s
UGtSuAcMd(0)s
USetAcMd(0,3)s
UGtSuCuLm(0)s
USetCuLm(0,2)s
ChgClkSpd(0,8)s
UTuSmPt(0,0)s
GetTtlSect(0)s

Kingston 16G UHS-I U1, "90MB/s R 45MB/s W"

SetSSCG(12,0)s
HWInit(0)s
SWInit(0)s
SetUHSMod(0,1)s
RegPowCF(0)s
CardInit(0)s
GetCrdTyp(0)s
GetCmnReg(0)s
SdGetReg(0)s
GetRUS(0)s
GetSpd(0)s
UGtSuAcMd(0)s
USetAcMd(0,3)s
UGtSuCuLm(0)s
USetCuLm(0,2)s
ChgClkSpd(0,8)s
UTuSmPt(0,0)s
GetTtlSect(0)s

Sandisk 16G UHS-I U1 "48MB/s"

SetSSCG(12,0)s
HWInit(0)s
SWInit(0)s
SetUHSMod(0,1)s
RegPowCF(0)s
CardInit(0)s
GetCrdTyp(0)s
GetCmnReg(0)s
SdGetReg(0)s
GetRUS(0)s
GetSpd(0)s
UGtSuAcMd(0)s
USetAcMd(0,2)s
UGtSuCuLm(0)s
USetCuLm(0,1)s
ChgClkSpd(0,6)s
UTuSmPt(0,0)s
GetTtlSect(0)s
Now I'm not so sure about that 43MB/s limit. The 2 faster cards in the above list are clearly set differently. Can't test on PC due to USB 2.0.

It might make more sense to start with uncached + 1 MB or something like that.
Yeah, the card benchmark clearly needs to be changed to provide more usable results.
Quote
It would be interesting to see what results you get on sx280.
Code: [Select]
loaded A/CBBENCH.BIN size 132 at 0x0041dd88
time 6330 speed 20 MB/s
time 7450 speed 17 MB/s
time 7490 speed 17 MB/s
time 7490 speed 17 MB/s
time 7510 speed 17 MB/s
time 7910 speed 16 MB/s
time 7610 speed 16 MB/s
time 8410 speed 15 MB/s
min 6330 max 8410 avg 7525 avg speed 17 MB/s
No working UHS support on this camera, as it seems.
« Last Edit: 08 / May / 2017, 20:54:50 by srsa_4c »

Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #55 on: 09 / May / 2017, 13:16:10 »
Trying to benchmark my SX60 before making changes to boot.c (as @reyalp did in the latest g7x build)
It's been a long time since I ran canon basic...something is wrong.
I rebuilt cbbench.bin (I don't think I had to)
I edited extend.m for SX60HS/100f  pointers
Code: [Select]
' run benchmark binary^M
' sd card information function, set to 0 to skip^M
DIM SdInfo_ptr = 0x10e7e3d^M
'DIM SdInfo_ptr = 0^M
' addresses below from funcs_by_*.csv^M
DIM Open_ptr = 0xfc3328e9^M
DIM Write_ptr = 0xfc3329a5^M
DIM Close_ptr = 0xfc33296d^M
DIM GetSystemTime_ptr = 0xfc3a46a9

put cbbench.bin and extend.m onto the card.....
script.req looks ok.

BUT...when I press set, I still get a message from romlog dump program...and then the camera crashes....
Feel like an idiot, but I don't know what I'm doing wrong at this point. :'(

*

Offline srsa_4c

  • ******
  • 4451
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #56 on: 09 / May / 2017, 13:30:03 »
Trying to benchmark my SX60 before making changes to boot.c (as @reyalp did in the latest g7x build)
It's been a long time since I ran canon basic...something is wrong.
I rebuilt cbbench.bin (I don't think I had to)
I edited extend.m for SX60HS/100f  pointers
Code: [Select]
' run benchmark binary^M
' sd card information function, set to 0 to skip^M
DIM SdInfo_ptr = 0x10e7e3d^M
'DIM SdInfo_ptr = 0^M
' addresses below from funcs_by_*.csv^M
DIM Open_ptr = 0xfc3328e9^M
DIM Write_ptr = 0xfc3329a5^M
DIM Close_ptr = 0xfc33296d^M
DIM GetSystemTime_ptr = 0xfc3a46a9

put cbbench.bin and extend.m onto the card.....
script.req looks ok.

BUT...when I press set, I still get a message from romlog dump program...and then the camera crashes....
If you're sure that the addresses are good, the problem is likely due to the typos in reyalp's script (forgot to mention that earlier).
Code: [Select]
' hokey attempt to get ensure loaded binary is out of cache
memset(cachbuf,0xab,cachbuf_size)
Wait(100)
memset(cachbuf,0xba,cachbuf_size)
Change cachbuf to cachebuf, cachbuf_size to cachebuf_size.
If that still doesn't solve it, there's yet another way (using the firmware's "caching related routine", the one called from the CHDK bootloader).

Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #57 on: 09 / May / 2017, 14:16:39 »
Quote
Change cachbuf to cachebuf, cachbuf_size to cachebuf_size.
Thanks...but no luck...something is creating UART.REQ...that's all I can see.
I commented out the run of the benchmark, and SDinfo_ptr for simplicity.

It really looks like it is running a different script, because it prints on the LCD "Test" which I recall is my romlog dump...
only one copy of extend.m no caps EXTEND.M. If the new extend.m contains a syntax error, does the last successful extend.m prevail somewhere in memory?

Maybe I'll just give up and use the standard benchmarks already in CHDK.

*

Offline reyalp

  • ******
  • 14126
Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #58 on: 09 / May / 2017, 16:19:18 »
only one copy of extend.m no caps EXTEND.M. If the new extend.m contains a syntax error, does the last successful extend.m prevail somewhere in memory?
No, it's read from disk.

If you used a multi-partition card, it could be using one from a different partition than you expected, but you shouldn't be using a multi-partition card.

If you actually overwrote the extend.m, there's really no way the camera could see the old one except maybe filesystem corruption. Double check that you haven't put the new one in extend.m.txt or something like that, or appended instead of copying.

A few of us have seen weird stuff happen due to filesystem corruption that was triggered by crashes in development, so setting up the card fresh isn't a bad idea if you don't find another cause.

Quote
Maybe I'll just give up and use the standard benchmarks already in CHDK.
The main point of this is to be able to compare performance without CHDK to performance with CHDK, to ensure CHDK isn't causing degraded performance.

@srsa_4c,
ugh, thanks for catching those. I guess that code isn't (always) needed. I'll upload a new zip to the original post.
Don't forget what the H stands for.

Re: SD info and benchmarks (was Re: EOS M3 porting)
« Reply #59 on: 09 / May / 2017, 23:19:41 »
Got it working!  My romcode.dis ramcode.dis was generated with incorrect address parameters.
My cheap kingston SD card maxes out at 10MB/s without CHDK and 9MB/s with CHDK.
« Last Edit: 09 / May / 2017, 23:23:30 by 62ndidiot »

 

SimplePortal © 2008-2014, SimplePortal