Author Topic: 12-bit (and 10-bit) RAW video development discussion  (Read 673356 times)

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3401
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1475 on: December 16, 2017, 06:34:40 AM »
Also, the FPS override might be a key to solving the sync issue.

This is what I have been wondering as well...
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

ilia3101

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 951
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1476 on: December 16, 2017, 02:40:16 PM »
It would be great if you could run those EDMAC module tests and post logs for the 5D2.

Try logging at 50us (or 100us or more if it freezes the image or has other problems) a few scenarios in LiveView:
- without raw video and without photo raw overlays enabled (e.g. global draw off, no other modules loaded)
- with raw video enabled, old method (run it on top of regular nightly or raw_video_10bit_12bit)
- with raw video enabled, new method (on top of dfort's modified version)

I ran two log tests:
1. no modules loaded (unified)
2. with mlv_lite enabled (unified)

Not sure what "new method" means though. I can do more if needed.

Download: https://drive.google.com/file/d/1xwEypSKD43PJ-8-agUMYBGVk7LxGAkVo/view?usp=sharing

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1477 on: December 16, 2017, 04:59:11 PM »
Not sure what "new method" means though. I can do more if needed.

The "new method" means using the build that I posted on my downloads page. Make sure to use one of the "raw_video_10bit_12bit" builds. I'll be posting some dm-spy-experiments builds soon.

Speaking of -- I have found the stubs needed for the dm-spy-experiments tests on the 7D and 50D. The stubs were already there on the 500D and 5D2 and I found the few missing on the 550D. Some of the stubs conflict and must be turned off but I'm not sure how to go about testing which stubs to comment out. For starters I'm using the 500D as an example though the 5D2 has a different set of stubs commented out. Once I run a test on the 7D I'll start posting dm-spy-experiments builds.

Here are the tests we should be concentrating on. Every time I reread one of a1ex's post I seem to find something new, like making sure we get logs using all video modes.

The keys for solving the sync issue are in that big LVState diagram, the debug logs from LiveView (dm-spy-experiments branch; for models other than 500D you will have to find some stubs) or EDMAC activity logs/graphs (currently captured for 50D, but incomplete). I hope to be able (but cannot promise) to solve the sync issues after analyzing all these logs.

All the logs have to be captured in 3 LiveView modes (see #1450) in order to have something to compare. Repeat for all video modes (1080p, 720p, 5x, whatever else your camera has). Repeat for all camera models (not just 50D). The two logging tasks are also for camera models already present on the Experiments page (for double-checking and for having something to compare against).

About the 1100D, it is an EVF_STATE camera while the others use LVState, there seems to have been very little interest in that camera, no reports about how the build posted on the official Experiments page is working and many of the modules on the Nightly build aren't compiling yet no 1100D user has brought this up. Finding these stubs is a PITA and if there isn't feedback from 1100D users then it isn't worth the effort. A few more points on the 1100D, the video specs are very unimpressive and the memory is rather small so the chances of getting this camera working in the crop_rec_4k branch seem rather dismal.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

CITY-U1001

  • New to the forum
  • *
  • Posts: 46
  • 50D in future
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1478 on: December 16, 2017, 07:07:56 PM »
my camera 50D, i can make test.
50D | EFS 18-55 | last build crop_rec-3744x1080_24fps_50D-eXperimental.4.57pm.2020May06.50D109.zip

CITY-U1001

  • New to the forum
  • *
  • Posts: 46
  • 50D in future
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1479 on: December 16, 2017, 07:31:51 PM »
modules on
mlv_play, mlv_rec, mlv_twk, edmac, ettr.
difference:
edmac000 - movie records 640x480
edmac001 - movie records 1920x1080
start log in lv
canon menu sRAW2
raw video 1568x848 23.976 fps
http://dropmefiles.com/mIFeM files
50D | EFS 18-55 | last build crop_rec-3744x1080_24fps_50D-eXperimental.4.57pm.2020May06.50D109.zip

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2293
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1480 on: December 16, 2017, 09:44:09 PM »
I'll be posting some dm-spy-experiments builds soon.........  The stubs were already there on the 500D and 5D2  Once I run a test on the 7D I'll start posting dm-spy-experiments builds.
I complied theses  memspy build for my 3.5K/UHD thread , I think they will work , I was using them to find LV buffer info etc....
Nightly.memspy.lv.raw.buffer.extended.resoultion.2017Apr24.5D2212.zip or magiclantern-v2.3.NEXT.Memspy.2017Apr23.5D2212.zip (Old Core)
This Stub Test  my be useful I make some time ago stubtest_5D2.log also some misc. dm_Logs I made a while ago for research & development for 3K/UHD 5D2 Raw development and Other Digic IV Cams
dm-0000.log dm-0001.log dm-0002.log dm-0003.log dm-0004.log dm-0005.log dm-0006.log plus a few misc. --  digic00.LOG & log001.log
I don't remember the conditions or camera setting for the log test . Of course these are from my 5D2 , it may help .

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1481 on: December 16, 2017, 10:29:36 PM »
Now that I got dm-spy-experiments pimped out I thought I'd start going over some previous posts.

Allocate it, use a pre-allocated one, or find some unused*) memory block. Don't try random pointers hoping they will work.

*) If you decide to use this one, double-check it's really unused (test it in any camera mode you may think of - photo, movie, zoom, various FPS, while recording, external monitors, and make sure it's not going to be reused by other Canon code while you are updating it). Tools you may use: CONFIG_MARK_UNUSED_MEMORY_AT_STARTUP, CONFIG_RSCMGR_UNUSED_SPACE_TEST, or write your own RAM analysis tools.

Not sure what to look for (yeah I know, search the forum) but thought this was interesting:







I also started looking at some logs and trying to make sense of them. Looks like the new EDmac stubs are working.

Code: [Select]
grep EDmac DM-0000.LOG
D3CBA> **INT-5Ah*:ff28226c:99:02: WriteEDmacWbIntegCompleteCBR 0
D3D16> **INT-58h*:00000564:99:02: WriteEDmacYuvCompleteCBR
D3DEC> **INT-83h*:00000564:99:02: WriteEDmacQuarkCompleteCBR
D3E26> **INT-8Ah*:00000564:99:02: WriteEDmacVramCompleteCBR_x1
D748A> LiveViewMg:00ca6ebc:00:00: *** SetEDmac(0x9, 0x4056ff9c, 0x1364d4, 0x40000000), from ff27ed4c
D74F7> LiveViewMg:00ca6ebc:00:00: *** ConnectReadEDmac(0x0, 0xf), from ff27ed58
D7552> LiveViewMg:00ca6ebc:00:00: *** RegisterEDmacCompleteCBR(0x9, 0xff27dbc0, 0x0), from ff27ed68
D75A9> LiveViewMg:00ca6ebc:00:00: *** StartEDmac(0x9, 0x1), from ff27ed84
D78FE> LiveViewMg:00ca6ebc:00:00: *** SetEDmac(0x12, 0x5f11d800, 0x136498, 0x20000000), from ff27e4f8
D7961> LiveViewMg:00ca6ebc:00:00: *** StartEDmac(0x12, 0x2), from ff27e504
D7A12> LiveViewMg:00ca6ebc:00:00: *** RegisterEDmacCompleteCBR(0x10, 0xff27dbbc, 0x0), from ff27e598
D7A7D> LiveViewMg:00ca6ebc:00:00: *** SetEDmac(0x10, 0x443c0d24, 0xff56f474, 0x20000000), from ff27e678
D7AD2> LiveViewMg:00ca6ebc:00:00: *** StartEDmac(0x10, 0x1), from ff27e684

Not sure what sort of test to run on the dm-spy-experiments branch but if anyone wants to compile it and try various options the branch I'm working on is here.

Back to creating a full set of EDMAC logs:

1080p no raw 50µs
720p no raw 50µs
480p no raw 50µs
5x zoom no raw 50µs

mv1080 mlv_lite 50µs
mv720 mlv_lite 50µs
mv640 mlv_lite 50µs
zoom mlv_lite 50µs

mv1080 mlv_lite allocate-raw-lv-buffer 50µs
mv720 mlv_lite allocate-raw-lv-buffer 50µs
mv640 mlv_lite allocate-raw-lv-buffer 50µs
zoom mlv_lite allocate-raw-lv-buffer 50µs
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dariSSight

  • Member
  • ***
  • Posts: 163
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1482 on: December 17, 2017, 12:54:06 AM »
@dariSSight read the last few posts and do not use any 5D2 build that uses EDMAC channels 0x01 or 0x02 for raw recording!!

More research needs to be done.

50D testers - the 50D builds using EDMAC 0x01 should be ok.
So can I use Dfort December 12 build?
Canon 5D Mark II

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1483 on: December 17, 2017, 01:09:05 AM »
So can I use Dfort December 12 build?

According to the code:

edmac-memcpy.c
Code: [Select]
#elif defined(CONFIG_5D2)
uint32_t raw_write_chan = 0x10; /* 0x01 and 0x02 also work but not safe. Needs fps override as a workaround */

The current 5D2 build should be good to use for testing and logging.

Ha ha, Dfort, this old build of yours keeps coming back to haunt you because this is the best ML build made for the 7D in the history of mankind!

As promised I took another look at this build. I could finally get a good zoom mode recording using mlv_rec but not with raw_rec (before it became mlv_lite) and only if FPS override was turned on. However, it does work with 10/12bit and the video looks good.

Taking a look at the old code for the 7D:

edmac-memcpy.c
Code: [Select]
#elif defined(CONFIG_7D)
uint32_t edmac_read_chan = 0x0A;  /*Read 0x19 0x0D 0x0B 0x0A(82MB/S)*/
uint32_t edmac_write_chan = 0x06; /* Write 0x5 0x6 0x4 (LV) */
//5 zoom, 6 not - improved performance (no HDMI related tearing)

I tried changing the write channel to 0x10 which is what we're using in these experimental builds in hopes that it will work with mv1080 mode but no luck. How about going the other way and on the raw_video_10bit_12bit_LVState-wip branch change the write channel from 0x10 to 0x6 to see if that gets zoom mode working? Nope, didn't work. So it looks like that old build just happens to be a lucky coincidence that it works as well as it does.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

6D_ML

  • New to the forum
  • *
  • Posts: 17
  • 6D mkII *1.0.2
Re: 12/10-bit RAW Video Shutter Speed Issue
« Reply #1484 on: December 17, 2017, 05:42:31 AM »
I'm excited about 10-bit RAW recording option. The footage I was able to record so far looks as good as a 14-bit one.
I noticed that shutter speed can't be adjusted in ML menu, EXPO tab (stuck at 1/25.49), while top panel shows shutter speed changes accordingly. Video exif indicates 1/25.49 speed, when top panel may indicate anything from 1/30 to 1/4000s. magiclantern-raw_video_10bit_12bit.2017Aug21.6D116.zip - Latest Build (2017-08-21 08:24) is used.
When switching to Nightly Build shutter speed adjustment works fine. What debugging procedures are required to help troubleshoot the shutter speed issue in 10/12-bit RAW video mode?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1485 on: December 17, 2017, 09:57:46 AM »
Read from #1365 - the questions are still valid.

If it's a regression (issue not present in regular nightly), try older builds to narrow down. If that doesn't help, compile from source, running "hg bisect".

IDA_ML

  • Hero Member
  • *****
  • Posts: 965
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1486 on: December 17, 2017, 10:22:01 AM »
As promised I took another look at this build. I could finally get a good zoom mode recording using mlv_rec but not with raw_rec (before it became mlv_lite) and only if FPS override was turned on. However, it does work with 10/12bit and the video looks good.

Do you mean to say that you have both: the normal uncropped as well as 5x-zoom mode in 10/12 bits working now?  If that is the case, then you have acomplished another achievement, Dfort !!!  You have broken your own record for the best ML build for the 7D in the history of mankind!  Congratulations !!!

Lucky coincidence or not, if these two modes work properly now, this makes the 7D an extremely capable RAW-video camera for resolutions up to 2496x1198 WITH synchronous sound and up to 20 and more seconds recording times even at the maximum resolution, 10 bits and 24 fps !!! You can hardly immagine how happy will all 7D owners be hearing this news!  I cannot wait to test.  Could you please post a new build with these features working?

As far as the RAW-rec module is concerned, in my opinion, further work on it makes sense only after it becomes MLV-lite.  So please, don't worry about it for now.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1487 on: December 17, 2017, 06:24:07 PM »
Do you mean to say that you have both: the normal uncropped as well as 5x-zoom mode in 10/12 bits working now?

No, it means that the old build works well in 5x-zoom mode and the new builds sort of work in the uncropped mv1080 and mv720 modes.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

6D_ML

  • New to the forum
  • *
  • Posts: 17
  • 6D mkII *1.0.2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1488 on: December 17, 2017, 09:04:11 PM »
Read from #1365 - the questions are still valid.

If it's a regression (issue not present in regular nightly), try older builds to narrow down. If that doesn't help, compile from source, running "hg bisect".

Alex, thank you for your reply and providing the link to older builds. Let me answer some questions you asked previously.
Quote from: a1ex
Is it a a display issue, or does the image brightness stay fixed as well?
Replies based on Build #26 (Aug 21, 2017 10:24:50 AM) for 6D1.1.6 with no settings changed or modules loaded.
Image brightness does not change when adjusting shutter speed. It's actually frozen in ML menu, but  top screen and Canon version of the overlay settings show shutter speed value changes properly.
Shutter speed is set to the following values based on FPS set in Canon video recording settings:
1920/30 FPS → 1/32.43(45) - Fixed
1920/24 FPS → 1/25.52(54) - Fixed
1280/60 FPS → 1/70.03(11) - Fixed

I tried Build #24 (Aug 20, 2017 10:36:50 PM), and it has the same shutter speed adjustment  problem as Build #26 (Aug 21, 2017 10:24:50 AM). There is a difference in shutter speed displayed though:


Shutter_Speed_Disabled_in_Video_Mode_magiclantern-raw_video_10bit_12bit.2017Aug20.6D116


Shutter_Speed_Disabled_in_Video_Mode_magiclantern-raw_video_10bit_12bit.2017Aug21.6D116

Build #22 (Jul 3, 2017 12:47:09 AM) does not suffer from this shutter speed issue. So something when wrong with Build #24 for 6D model.


Shutter_Speed_Selection_OK_in_Video_Mode_magiclantern-raw_video_10bit_12bit.2017Jul03.6D116

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1489 on: December 17, 2017, 10:10:27 PM »
Hm... now that's a mystery. The main difference between the two is this backend (for 100D/70D, but also affects 6D) and a few small fixes on the raw side.

Can you run the same tests on the latest build (#31) ? (not really expecting to work, but... who knows; it has nothing fancy, other than syncing with latest stuff from mainline and the above PR)

BTW, I see ISO is set to Auto. Are you in M mode?

edit: I might remember something; please PM me a RAM dump (Debug -> Dump ROM and RAM, from both #22 and #31).

12georgiadis

  • Member
  • ***
  • Posts: 210
  • 5DmkIII - 7D - EOS-M
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1490 on: December 17, 2017, 10:56:40 PM »
Dfort, Andy600, Ilia3101, a1ex, IDA_ML, reddeercity and others, fantastic evolution for the 7D and all DigicIV ! Good resurrection ! That adds a range of new possibilities for casual raw shooting. I hope that all this work on 10/12 would reach the stable graal. We can even dream of a crop_rec_4k on 7D now, with cropmode and H264 proxy features !
I can try to run some test after christmas. Is there any tutorial for EDMAC tools ? And I can test the builds too. Keep it up !

6D_ML

  • New to the forum
  • *
  • Posts: 17
  • 6D mkII *1.0.2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1491 on: December 17, 2017, 11:19:48 PM »
Can you run the same tests on the latest build (#31) ?
Build# 31 still has the same shutter speed issue. The stuck value is different though:



BTW, I see ISO is set to Auto. Are you in M mode?
Indeed, it was M mode with autoISO, but switching to Av, Tv, P modes does not remedy stuck SS values.

edit: I might remember something; please PM me a RAM dump (Debug -> Dump ROM and RAM, from both #22 and #31).
PM sent with RAM dump.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1492 on: December 17, 2017, 11:38:14 PM »
Fix pushed (issue confirmed in QEMU, but could not test the actual behavior). Please try build #32.

6D_ML

  • New to the forum
  • *
  • Posts: 17
  • 6D mkII *1.0.2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1493 on: December 18, 2017, 04:40:28 AM »
Fix pushed (issue confirmed in QEMU, but could not test the actual behavior). Please try build #32.
Tried Build #32. The issue persists, but now the shutter speed value is equal to 360° of the selected FPS. Here's a screenshot for 1920/30FPS:


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1494 on: December 18, 2017, 06:06:25 AM »
Both RAM dumps were taken under the same conditions, right? (same shutter speed, same video mode etc)

Found another set of addresses, not an exact match (likely because the RAM dumps were not taken at the same shutter speeds), but let's try that one as well (build #33). If that doesn't work, please send me a ROM dump from that build as well.


dariSSight

  • Member
  • ***
  • Posts: 163
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1495 on: December 18, 2017, 09:37:30 AM »
According to the code:

edmac-memcpy.c
Code: [Select]
#elif defined(CONFIG_5D2)
uint32_t raw_write_chan = 0x10; /* 0x01 and 0x02 also work but not safe. Needs fps override as a workaround */

The current 5D2 build should be good to use for testing and logging.

As promised I took another look at this build. I could finally get a good zoom mode recording using mlv_rec but not with raw_rec (before it became mlv_lite) and only if FPS override was turned on. However, it does work with 10/12bit and the video looks good.


I don’t know if I’m doing anything wrong but I tested Dec 12,2017 build and its nonfunctional, choppy footage files, freeze while in record. Is there any build you have for non crop and 5xzoom I can test that’s ready? So far best build for testing non-crop 10bit 12bit is Reddeercity Dec10,2017noncropBuild but you said don’t use that build, and Dec1,2016/5xCropBuild(I think that’s a Dfort build).
Canon 5D Mark II

IDA_ML

  • Hero Member
  • *****
  • Posts: 965
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1496 on: December 18, 2017, 10:26:41 AM »
Is there any build you have for non crop and 5xzoom I can test that’s ready?

Obviously not.  Please read post 1488 above.

6D_ML

  • New to the forum
  • *
  • Posts: 17
  • 6D mkII *1.0.2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1497 on: December 18, 2017, 02:35:14 PM »
Both RAM dumps were taken under the same conditions, right? (same shutter speed, same video mode etc)

Found another set of addresses, not an exact match (likely because the RAM dumps were not taken at the same shutter speeds), but let's try that one as well (build #33). If that doesn't work, please send me a ROM dump from that build as well.
Build #33 allows for shutter speed changes now! PM with ROM files sent.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1498 on: December 18, 2017, 06:40:24 PM »
Looks like the 6D is up and running properly. Thanks @6D_ML for the excellent bug reporting and following a1ex's instructions.

I tested Dec 12,2017 build and its nonfunctional, choppy footage files, freeze while in record.

Are you setting FPS override to 24 or 23.976? That seems to be the key on the 5D2.

So far best build for testing non-crop 10bit 12bit is Reddeercity Dec10,2017noncropBuild but you said don’t use that build...

Well, if it works for you, go for it. I'm trying to figure out how to get all the video modes working like they are on the Digic V cameras and the Digic IV models that use EVF_STATE (60D and 600D). Technically the 1100D falls in that last category but there doesn't seem to be much feedback on that camera.

Top priority is 7D, 5D2 and 50D. Sounds like the 50D is already working with this new code. Where are the 500D and 550D testers?
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2293
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #1499 on: December 19, 2017, 06:26:15 AM »
I can confirm -- raw_video_10bit_12bit.2017Dec12.5D2212.zip  build totally fails in all bit depths & crop even 14bit .
As @dariSSight says "choppy footage"
Frame over ride enable -- canon fps 24 , ML fps 23.976 (I always have frame over enable to exact fyi )
this what I have in my original source in download , which worked
Code: [Select]
#ifdef CONFIG_5D2
#define RAW_LV_BUFFER_ALLOC_SIZE (SRM_BUFFER_SIZE - 0xF000)
#endif
the 12/12/2017 build changed to this and doesn't
Code: [Select]
#ifdef CONFIG_5D2
#define RAW_LV_BUFFER_ALLOC_SIZE (SRM_BUFFER_SIZE - 0x4000)
#endif