Canon 6D

Started by Maqs, May 01, 2015, 09:56:15 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dfort

Quote from: Levas on February 19, 2018, 12:54:55 AM
Now the one with the CMOS[7] adjustments seems to work  :D
I've got multiple MLV's with 3x3 binning and 50fps  :D
BUT weirdly enough, the first time I tried this build, I got an error message on recording, multiple times.
But now I can't recreate this error.

I'm not getting any errors in QEMU and this is doing exactly what you did in order to get it working so let's make this one the hero.

a1ex

@dfort: just FYI (this one should be easy to translate into a crop_rec preset). That's actually how this module got its name ;)

blubbblubb

I recently switched to the Canon 6D (coming from a 600D) and the only thing i miss is the ability to monitor the Audio Levels with a pair of headphones. I tried to copy the steps mentioned in this post:
Quote from: jjtempey85 on August 12, 2016, 01:08:32 PM
*EDIT* - I forgot the registers I had to port over from Tragic Lantern in audio.h.  All better now.

I got tired of not having headphone monitoring on my 6D, so I hacked it in over the course a few evenings.  ...

but I was not able to simply copy those changes (probably because the code of Magic Lantern has changed a lot since then). Im guessing some functions were removed or renamed

I stopped trying at this error message:
../../src/audio.h:160:9: error: implicit declaration of function '_audio_ic_write_bulk';

I might look into it again in the next few days and try to get it to work, however my main question is: Where there any problems with those changes? Or was there another reason that this never made it into the official version?

a1ex

You should probably just provide a declaration; then, to get changes into mainline, the general procedure is to provide a pull request, and other 6D owners to confirm it's working (since I'm unable to test otherwise, except for some limited stuff in QEMU, such as how the menus look like, or whether it turns off the display or not).

blubbblubb

The function was declared inside another function (which to me looked a bit weird to begin with), moving it seemed to help.

Now there is an undefined reference to sounddev_active_in which by the looks of it is a canon function with a missing stub for the 6D.

I'm guessing i'll have to refresh my C and Assembler knowledge a bit and have a deeper look into it.

As for getting it into mainline, the way it was done in the previously mentioned post seems kinda hacky and there are some limitations/problems mentioned so i guess it would be necessary to adress those first.

dfort

Quote from: a1ex on February 20, 2018, 08:21:09 PM
@dfort: just FYI (this one should be easy to translate into a crop_rec preset). That's actually how this module got its name ;)

Wow, that post from @Levas is from 3 1/2 years ago. It took that long to make it easy? Looks like 3xzoom/1:1 crop could also apply to the other "is_basic" cameras. Well,  they already have the CROP_MODE_HACK but it would still be a good exercise.

MR MIAN

so...how can you get the audio?mlv_dump only give me dngs by
mlv_dump file.MLV --dng --no-stripes --no-fixcp
I have loaded mlv_snd.mo and keep it on. :'(

a1ex

Quote from: dfort on February 21, 2018, 04:27:33 AM
Wow, that post from @Levas is from 3 1/2 years ago. It took that long to make it easy?

FYI, the original crop_rec module was announced 2 years ago, and it referenced Levas' post from the very beginning. The module was a lot simpler back then, since it only had one preset (you already know).

Best guess: the feature wasn't tempting enough for other folks to look at the source code.

Levas

Did some more testing with lossless recording, as known resolution 1824x1026 gives frames with bottom half corrupted.

When we do normal black level fix (1920-1792-1536-1024), we get a normal upper half.
Now I did some more testing, and with an alternative black level fix (1728-1408-2304-2048) I can get a normal bottom half of the same frame  :o

Here are the 3 frames, all the same, on my google drive:
-one vanilla, as it comes out of mlv_dump
-one with the 'normal' black level fix for 6d
-and one with an alternative black level fix:
https://drive.google.com/drive/folders/17ywgTKYYMLLvL3QZzkCtFvCHed4CZ4aC?usp=sharing

dfort

Quote from: MR MIAN on February 21, 2018, 10:31:30 AM
so...how can you get the audio?mlv_dump only give me dngs...

Upload a short MLV with audio so we can examine it.

Quote from: Levas on February 23, 2018, 11:24:47 AM
...frames with bottom half corrupted...we get a normal upper half...I can get a normal bottom half of the same frame

The DNG samples you posted in Reply #783 were not shot with the crop_rec module, right? (Obvious because of the frame size.)

Maybe I got the DEFAULT_RAW_BUFFER_SIZE wrong?

src/raw.c
#ifdef CONFIG_6D
#define DEFAULT_RAW_BUFFER MEM(0x76d6c + 0x2C)
#define DEFAULT_RAW_BUFFER_SIZE (0x4ee00000 - 0x4d600100)
#endif


We made an adjustment in the crop_rec module to adjust  CMOS[7] (see pull request "PACK12(37,10)" is being applied to the 6D):

modules/crop_rec/crop_rec.c
cmos_new[7] = (is_6D) ? PACK12(37,10) : PACK12(6,29);

Is that working with all reduced bit depth and lossless settings?

Levas

@Dfort, the dng samples are shot with mlv_lite, lossless 14 bit in normal 1080p mode.

If default buffer size is wrong, how can we fix it, can we check these values, or can we do some trial and error ?

Quote from: dfort on February 23, 2018, 02:54:37 PM

We made an adjustment in the crop_rec module to adjust  CMOS[7] (see pull request "PACK12(37,10)" is being applied to the 6D):

modules/crop_rec/crop_rec.c
cmos_new[7] = (is_6D) ? PACK12(37,10) : PACK12(6,29);

Is that working with all reduced bit depth and lossless settings?


The last crop_rec build you made, the one with the CMOS 7 adjustment, works for all formats, 14-10 bit and lossless all options.

dfort

Quote from: Levas on February 23, 2018, 03:29:02 PM
If default buffer size is wrong, how can we fix it, can we check these values, or can we do some trial and error ?

It isn't defined on the 100D so it must be using this:

src/raw.c
#define DEFAULT_RAW_BUFFER_SIZE (9*1024*1024)

Simply comment out the DEFAULT_RAW_BUFFER_SIZE for the 6D and see what happens.

0x4ee00000  - 0x4d600100 = 0x17FFF00 - uses this currently for 6D
9*1024*1024  =   9437184 = 0x0900000 - uses this if  DEFAULT_RAW_BUFFER_SIZE is commented out


[EDIT] That's pretty much half the size. How does this work?

a1ex

Quote from: Levas on February 23, 2018, 03:29:02 PM
If default buffer size is wrong, how can we fix it, can we check these values, or can we do some trial and error ?

Here (just needs enabling a compile-time option).

Levas

@Alex

I think I've done it right  ???

And got this in Photo mode, looks like the buffer goes from
4B328000 to 4CFFFFFC




Also did a screenshot of the Free Memory dialog:



a1ex

Looks OK. Same numbers when starting in other modes? (1080p, 720p etc)

Levas

Yes same for other modes.
Had to restart the camera a few times to see it that quickly, must say the console text is rapidly moving up and out of sight, is there a way to scroll trough console text afterwards ?

a1ex

Not exactly; there is an option to save the log to a file (CONSOLE_DEBUG in console.c), but that's pretty much it. However, it's not a bad idea to have a larger - scrollable - buffer.

dfort

Let's see if that "Raw buffer guess" @Levas found works. PR updated and test build posted.

[EDIT - Wait a minute. This doesn't make sense: 4B328000 - 4CFFFFFC = -1CD7FFC

What is listed here for the EOSM is 46798080 - 47F24060 but what is in raw.c and seems to be working properly is 0x47F00000 - 0x46798080. Is this an operation or a range or did I transpose the numbers or  ???

MR MIAN

Quote from: dfort on February 23, 2018, 02:54:37 PM
Upload a short MLV with audio so we can examine it.
https://pan.baidu.com/s/1qZhil9U
mlv_dump said it hasn't content audio.
I'm not sure if you kan open this link ,if you can't,maybe i can Email it to you.
thanks a lot.

Levas

Quote from: dfort on February 23, 2018, 11:55:47 PM
[EDIT - Wait a minute. This doesn't make sense: 4B328000 - 4CFFFFFC = -1CD7FFC

@Dfort
I think it's a range, I put the biggest number in front.
Made a build with it by using this in raw.c for the 6d.

#define DEFAULT_RAW_BUFFER_SIZE (0x4CFFFFFC - 0x4B328000)

1291845628 -  1261600768 = 30244860 = around 29/30Mb

The build works, but it doesn't fix lossless quirks on the black level and half corrupted frames on some resolutions unfortunately.

Edit, the buffer however is bigger than the standard 9Mb buffer and also a little bigger than the 25Mb buffer you'll get with your(DFort) Crop_rec_4K_6d test builds.
So still a gain here  8)

Edit 2, I see in your source now that you start the buffer at 4DF0000 and end with 4B328000, is there a reason for changing the start address ? It's now even 45Mb in size  :D

Levas

@Mr Mian,

My Chinese language skills are not very well, tried to download the MLV, but I didn't succeed.

But to record MLV's with audio, you must download the 4 februari build from Dfort.
https://bitbucket.org/daniel_fort/magic-lantern/downloads/crop_rec_4k_mlv_lite_snd.2018Feb04.6D116.zip
And be sure to enable the MLV_lite and MLV_snd modules:


After that, restart camera and then within the raw video menu (highlight it and click Q button on camera) you will see all the way at the bottom of the menu a 'sound recording' option, select it and activate it.
Now you should be able to have MLV's with audio recording


dfort

@MR MIAN - Your MLV file has no audio. Follow the instructions posted by @Levas in order to turn on audio in mlv_lite.

I see you are using one of my experimental builds. I've been making changes based on the feedback I'm getting from users because I don't have access to a 6D. Your MLV file shows that you have activated several modules at one time including adv_int, autoexpo, bench, crop_rec, deflick, dot_tune, ettr, mlv_lite, mlv_rec, mlv_snd, raw_twk and silent, that is way too many. In addition, you shouldn't load mlv_lite and mlv_rec at the same time because they will conflict.

It looks like you used crop_rec with a reduced bit depth lossless compression setting, right? When I extract the dng files they look like this over here:



Not at all like the examples you previously posted.


Levas

Good to see that the problem with black levels shifting, when using lossless recording, is not restricted to my canon 6d.
So it's not just my copy of the 6d, but probably all 6d's out there  ;D

dfort

Quote from: Levas on February 24, 2018, 10:48:11 AM
Edit 2, I see in your source now that you start the buffer at 4DF0000 and end with 4B328000, is there a reason for changing the start address ? It's now even 45Mb in size  :D

I was doing this during a break at work yesterday then got busy and forgot to post why I did what I did. Now that I look at it again, maybe I did the wrong thing.

If you look at what is working on the other cameras, for example the 5D3_113:

#define DEFAULT_RAW_BUFFER_SIZE (0x4CDF0000 - 0x4B152000)

and compare it to this:

Quote from: a1ex on February 01, 2018, 12:51:29 AM
5D3 1.1.3: 0x4B152000 - 0x4CDFFFFC (repeatable; tested photo mode, 1080p25, 720p50, x5, with and without HDMI monitor)

Note that indeed the larger number has to come first or we'll end up with a negative value. However, notice that on all of the cameras that are working in crop_rec_4k (with the exception of the 100D) the larger number is also rounded down slightly. I went the wrong direction and rounded up. What I should have done, starting with the test you just did:

Quote from: a1ex on February 01, 2018, 12:51:29 AM
6D: 0x4B328000 - 0x4CFFFFFC

and done this:

#define DEFAULT_RAW_BUFFER_SIZE (0x4CFF0000 - 0x4B328000)

In addition, the branch I'm using on the pull request was falling behind the crop_rec_4k branch so I merged in the latest changes. This might help with the testing but the pull request is getting messy so once we get things ironed out I should redo the pull request.

I'll post a new build in the usual location and also make a new crop_rec_4k_mlv_lite build because that one is also falling behind. I'm deleting the old builds because we know those have problems and my downloads page needs a clean up.

MR MIAN

Quote from: Levas on February 24, 2018, 11:02:37 AM
But to record MLV's with audio, you must download the 4 februari build from Dfort.

thanks a lot.it seems i have a wrong understanding of these modules.i thought if don't active them together will have no conflision.
my mlv_snd comes from the test version on fer 20th and shows a tab in the ML main memu,not in the mlv(lite).
Quote from: dfort on February 24, 2018, 02:20:51 PM
Not at all like the examples you previously posted.
thanks you for pointing out my mistake.this mlv is recorded in 14bit lossless mode(in my memory).the screenshot i posted before are dngs haven fix black level with exiftool.
i will upload more mlv files for test.however,before that,i have to make a struggle to register my google drive since i am in China :'(