UHS-I / SD cards investigation

Started by nikfreak, July 30, 2014, 05:46:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

walter_schulz

Not supported within Digic 4 cams and no one working on it.

clubsoda

Quote from: Levas on May 31, 2019, 09:47:49 PM
@sheleviy
Can imagine you're not able to compile, in that case, here's a compiled version of the SD_UHS module:
https://drive.google.com/file/d/1SJHrA75UXobTzBcsEY3lqbHxhNdoksPb/view?usp=sharing

Just replace this one with the one on your card.
This one, when activated in Magic lantern module tab, loads automatically at camera  startup.

What is the newest magic lantern build for this module and my 6d to use with?

Levas

For 6d the newest build is this one:
www.magiclantern.fm/forum/index.php?topic=15088.msg223031#msg223031

The SD_UHS module in the build from the link above is autmatically started at startup (when SD_UHS module is enabled in module tab ofcourse)
You don't see a message on screen or something.
If your card can handle the speed, you will see better recording times(or continuous)

And some slightly older builds here, probably also with the SD_UHS module in it:
https://bitbucket.org/Levas_EOS/magic-lantern/downloads/

clubsoda


Whr

The RAW video really shocked me, but the device I used was 500d of the digtal4 processor, which can only record 3-5 seconds. I hope the sd card can be overclocking on the 500d. I can provide my device for the test.Thanks


https://www.youtube.com/embed/se5E7f_Mi4c
500D 1.1.1 & X-T3

theBilalFakhouri

Quote from: theBilalFakhouri on May 31, 2018, 09:31:22 AM
I'd like to play with values without changing it in the code and recompiling it every time.

Can I adjust these registers by adtg_gui? if not, Can anyone knows the coding better than me make these registers adjustable via sd_uhs with a submenu ? then we can run an overclocking with the settings we did  :o

I did it yesterday
SD-UHS" border="0

If someone want to play with fire I will PM him sd_uhs.mo with adjustable uhs values in a submenu and the source code if needed,I will not post it to public Because it's dangerous for your CARD and Camera

I am trying to get more read/write speeds (more than 160 MHz) and understand how these registers affects the bandwidth together, But I think I will end up with a developed version for tweaking these registers in automated way, saving time and effort

Something I have noticed, sometimes when I tweak the values and end up with 2.6 MB/s write speed then 20 to 21 MB/s in the second test, and after I put the values which I tweaked back to default values the write speed stays 21MB/S Instead of 40MB/S (700D default) and I need to restart the camera to get the my write speed back.

theBilalFakhouri

I got some small improvement, The tests below in play mode, Card Sandisk Extreme Pro 170MB/S 64GB:

Before:
Write Speed 66.1 MB/S
Read Speed 71.8 MB/S

After:
Write Speed 68.5 MB/S
Read Speed 74.7 MB/S

The write speed some users have achieved it at 68MB/S in the past, But the read speed never got above 72MB/S in the past, now it is  :D

Preset Settings:

static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr_160MHz[]   = {        0x3,        0x2,                             0x1, 0x1D000001,        0x0,      0x100,      0x101,      0x101,        0x1 };   /*  (found by brute-forcing and modified by trial and error) */


theBilalFakhouri

Hello @a1ex

According to sdcard.org
https://www.sdcard.org/press/past_evens/pdf/SD_Standards_and_Technology_GWTaipei_Oct2014.pdf

sdr104specs" border="0

In SDR50: 100MHz gives 50MB/S , so every 2 MHz gives 1 MB/s, in this case your presests names in sd_uhs.c is not accurete ?,
Like: "SDR50 values from 700D (96MHz)" it's actually 80MHz which is 40MB/S , and the 160MHz prseset name should be 144MHz (it gives 72MB/s)

Edit: the presets names (48 MHz and 96 MHz . .) are from camera ROM or DebugMsg logs , so it's from Canon

nikfreak

Quote from: a1ex on April 03, 2018, 12:55:26 PM
Ran a brute force (random) search for the above registers, and...

SDR104 @ 160MHz 8)

......
Brute-forcing: press shutter halfway during the initial tests, until it starts running some more. Press shutter halfway again to stop (infinite loop).
No guarantees of success, no guarantees of safety, no guarantees of data integrity. You have been warned.

Please post logs and benchmarks.

Anyone ever been able to find or brute force 208 Mhz for SDR104 ??? ??
[size=8pt]70D.112 & 100D.101[/size]

theBilalFakhouri

a1ex told me before he tried 8 hours on AC Adapter power, I tried once but the battery ran out :P
And I don't think there is someone else, if there, Hello somone else how are you ? did you get 208MHz :D

Some ideas to Speed-UP the Process like a turbo

Quote from: theBilalFakhouri on September 30, 2018, 07:48:55 AM
I think brute forcing is a better solution but if you can .. :P make sd_uhs realize the last settings before the battery goes off and skip the tested values (time saver) and no AC adapter required (it can help with AC adapter also) & anybody can help with this without AC adapter.

Also making the tested values general or save it to the logs or something (In this way we can share in the forum the values we have tested to each other and speed up the process) then I can copy it to my card and sh_uhs will skip it.

But it need C programmer volunter, My skills aren't there yet

nikfreak

errrrm a1ex, couldn't this (=you  ;D) be brute forced within qemu?? No? We could need some volunteers to try this on their cams  otherwise. Should be worth it.
[size=8pt]70D.112 & 100D.101[/size]

Danne

I got an adapter an eosm and 100D. @farouk.. I really am out of time atm but could put a camera running. However. My attempts on the eosm was a bit wacky. Maybe the 100d works better.

theBilalFakhouri

BEST RESULT so far on Sandisk Extreme Pro 32 GB 95MB/S
BEST-RESULT" border="0

Read speed is always the same at 74.8 MB/s it's very constant I ran more than 10 tests, it always keep it up at 74.8 MB/s but Write speed it's varies between 68.9 MB/s to 71.3 MB/s , so maybe your results will not the same, but hey it reached 71.3 MB/s at some point.

Same preset above can do this result but I tweaked 0xC0400600 to 0x2 instead of 0x3, didn't notice a difference after tweaking it.

-Continuous 3K?
-No

-Actual Performance?
-Not on my camera

-Hmmm
-Yes

-Overclocking the Memory (RAM) instead ?
-Maybe it will be more effective

theBilalFakhouri

Quote from: a1ex on April 03, 2018, 12:55:26 PM
SDR104 @ 160MHz 8)

meh

SDR104 @ 192MHz  8) 2020

196-MHz-Bench" border="0

Write Speed 81.3 MB/s


196-MHz-Read-Speed" border="0

Read Speed 86 MB/s (I am expecting Higher than that in Bench.mo, but . . .)


mv1080-196-MHz-Bench" border="0

Effective Write Speed in mv1080 61.6 MB/s before it was 52 MB/s on 700D

Explanation for above results:
As you saw in the first picture the write speed started at 81.3 MB/s then when the read speed benchmark started, the speed dropped for both write and read speeds, okay it's actually not a drop, I think after a little experiments SD UHS controllers switched back to 48 MHz mode and this happen when only performing reading action by the camera at 192 MHz (like viewing images in PLAY mode or a background tasks), (maybe it's a safeguard?) As Long as there is no reading action happening @ 192 MHz from the sd card the write speed stays @ 81.3 MB/s

Good to mention: when messing around with sd_uhs registers and perform a messed up values the camera also switch to 48 MHz mode and you can't get the default speed even if you bring registers values back to original values, you need to restart the camera (safeguard also?)

sd_uhs.mo performs lo and hi write/read speed test (see sd_uhs.c), I got 86MB/s read speed result from the "hi" read/write speed test, "lo" makes read speed drops to 15 MB/s then 21 MB/s

Okay the settings :D here you go:
static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr_192MHz[]   = {        0x4,        0x3,                             0x1, 0x1D000001,        0x0,      0x201,      0x201,      0x100,        0x1 };  /*found by trial and error*/


How did I get above values? by thinking how to get them

Original values from 700D is:
static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr50_700D[]   = {        0x3,        0x3,                             0x4, 0x1D000301,        0x0,      0x201,      0x201,      0x100,        0x4 };   /* SDR50 values from 700D (96MHz) */


0xC0400610 Register is the main guy here to make an overclock, lower its value by one step to 0x3 (also override  0xC0400620 which have same value) this gives 55 MB/s , easy ha

Override 0xC0400610 & 0xC0400620 again to 0x2 (Now you need to tweak 0xC0400614 from 0x1D000301 to 0x1D000201 to make the overclock work, if you don't the camera will switch to 48 MHz mode 21MB/s (messed values) )
That gives 72 MB/s

Okay now you think overriding it to 0x1 should give more speed ? let's try
Override 0xC0400610 & 0xC0400620 to 0x1
and 0xC0400614 to 0x1D000001
now you need to override either 0xC0400600 from 0x3 to 0x2 , now these values will give same 72 MB/s no improvement
or 0xC0400604 from 0x3 to 0x2 , that will give 74.8 MB/s which is meh and lowering 0xC0400610 to 0x0 will not work (at least for now)

These two registers 0xC0400600 & 0xC0400604 are related somehow to overclocking, this 0xC0400600 if you increase its value from 0x3 to 0x4 will underclock the speed,

I thought let's underclock from 0xC0400600 , then re-overclock by 0xC0400610 , and it worked and we got the benefit from lowering 0xC0400610 to 0x1



Quote from: theBilalFakhouri on September 29, 2018, 04:43:08 PM
maybe in one week we will have 208MHz

Quote from: a1ex on September 29, 2018, 06:32:21 PM
I wouldn't rush to say this,

it took 5 days :D

Levas

Quote from: theBilalFakhouri on June 29, 2020, 10:54:34 AM

Explanation for above results:
As you saw in the first picture the write speed started at 81.3 MB/s then when the read speed benchmark started, the speed dropped for both write and read speeds, okay it's actually not a drop, I think after a little experiments SD UHS controllers switched back to 48 MHz mode and this happen when only performing reading action by the camera at 192 MHz (like viewing images in PLAY mode or a background tasks), (maybe it's a safeguard?) As Long as there is no reading action happening @ 192 MHz from the sd card the write speed stays @ 81.3 MB/s

Good to mention: when messing around with sd_uhs registers and perform a messed up values the camera also switch to 48 MHz mode and you can't get the default speed even if you bring registers values back to original values, you need to restart the camera (safeguard also?)


Cool finding  8)

Can confirm it works on the 6d, but as you mention, it drops back to really slow speeds very quick. Most of the times I could record one or 2 clips with higher speed, then it drops to 20MB/s  :P
So if a way is found to prevent the speed drop, then this is really useful :D

Normal SD-UHS 160Mhz write speed in video mode on 6d is about 59MB/s, with the above settings I got 66Mb/s (quick benchmark in video mode)

Levas

Quote from: theBilalFakhouri on June 29, 2020, 10:54:34 AM
Original values from 700D is:
static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr50_700D[]   = {        0x3,        0x3,                             0x4, 0x1D000301,        0x0,      0x201,      0x201,      0x100,        0x4 };   /* SDR50 values from 700D (96MHz) */


I always thought, these SD-UHS hack settings are the same on each digit 5 SD card camera, but standard settings on 6d for SD-UHS overclock are:

static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr_160MHz[]   = {        0x2,        0x3,                             0x1, 0x1D000001,        0x0,      0x100,      0x100,      0x100,        0x1 };   /* overclocked values: 160MHz = 96*(4+1)/(2?+1) (found by brute-forcing) */


How come, different values are used across different cameras ?

nikfreak

good job, please continue !!!!  ;D
[size=8pt]70D.112 & 100D.101[/size]

theBilalFakhouri

Quote from: Levas on June 29, 2020, 06:08:26 PM
I always thought, these SD-UHS hack settings are the same on each digit 5 SD card camera

Yes you are right, overclockling values are the same across all D5 Cameras, I Mentioned the default values from 700D without the hack which is "sdr50_700D" mode . . not "sdr104_160MHz"

sdr104_160MHz is not a 6D standard values, the standard values for 6D will be same as sdr50_700D which performs ~43 MB/s read/write speeds

Levas

Ah, so these were the default canon values ;)

Can you try and change the first register value ( 0xC0400600 ) to 0x3 ?

I did that, and got 79.5Mb/s write speed in VIDEO mode  :D

Couldn't test it long, battery is empty now. 79.5Mb/s benchmark in 5x zoom video mode.  Recorded a 1.5Gb mlv file in 2880x1200@25fps in 14 bit lossless.

Tried to benchmark it again, without raw recording enabled, so benchmark screenshot is saved. But didn't succeed. One time, the speed dropped halfway during the benchmark Write test... Battery is empty now.


theBilalFakhouri

@Levas

Wow

Can you share your the full set of registers values ?

Which preset should I change 0xC0400600 to 0x3 ? sdr104_160MHz or sdr104_160MHz?

I remember I tried it before in both presets, there is no improvement, but I will check again when I get the camera

Levas


static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr_160MHz[]   = {        0x3,        0x3,                             0x1, 0x1D000001,        0x0,      0x201,      0x201,      0x100,        0x1 };

Danne

Hm, tried 0x3 before on eosm but no cegar. Strange. Worth digging into again it seems. And Levas. Keep that 2880x1200@25fps. Only one of its kind on the 6D recorded for that long  :P.

Maybe try patching without raw video on? Or in photo mode.

Levas

Unfortunately, the 1.5Gb mlv isn't that interesting to watch  :P

Taking a look at it now on the computer, exported it to lossless dng's.
410 frames @ 25fps. The framesize varies from 3.9Mb to 4.6Mb (4.6 Mb when I point it to a window, so overexposed highlights).

410 frames at 25fps ->1.55Gb file...thats 94.5 Mb/s (with use of 250Mb buffer memory ofcourse, so the 79.5Mb/s seems true  :D )
Will try again if battery is full.

When trying to save benchmark screenshot, it looked like it only works in 5x zoom mode and not normal 1080p mode.
Benchmarking in 1080p mode gave 20Mb/s and trying again in 5x zoom mode started fast, but halfway write test it dropped.

So have to take a proper look at this.
Far from usable as it is uncertain when speed drop comes.

theBilalFakhouri

Quote from: Levas on June 29, 2020, 07:19:12 PM

static uint32_t uhs_regs[]     = { 0xC0400600, 0xC0400604,/*C0400608, C040060C*/0xC0400610, 0xC0400614, 0xC0400618, 0xC0400624, 0xC0400628, 0xC040061C, 0xC0400620 };   /* register addresses */
static uint32_t sdr_160MHz[]   = {        0x3,        0x3,                             0x1, 0x1D000001,        0x0,      0x201,      0x201,      0x100,        0x1 };


You Nailed it

SDR104 @ 240 MHz  8)
SDR104-240-MHz" border="0

Same problem, it switch to 48 MHz , I think this is the reason why brute-forcing didn't get it because of write/speed test makes the camera switch to 48 MHz

Danne