yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Yes the 108Mpx mode is there if you use the adb sell and type:

adb shell dumpsys media.camera > camera.txt

you get all the info from the cam

xiaomi.scaler.availableSuperResolutionStreamConfigurations (80420000): int32[60]
[35 12032 9024 0 ]
[35 12032 9024 1 ]
[33 12032 9024 0 ]
[35 6016 4512 0 ]
[35 6016 4512 1 ]
[34 6016 4512 0 ]
[34 6016 4512 1 ]

and it even opens the possibility of raw ?

android.scaler.availableRawSizes (d0008): int32[14]

[12032 9024 6016 4512 ]

[752 4464 3008 2256 ]

[752 1116 3008 2256 ]

[752 1116 ]
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Wow if we could get 108MP raw that would be the best!

I'm back home now and had some time this morning so I installed Android Studio, Open Camera source and after some fiddling got it working. What threw me a bit, was when I tried to build it, nothing happened, no error messages, nothing. However once I''d created a virtual device with Tools/AVD and installed the Pie binary, it all worked fine.

So now I have a custom version of Open Camera as I've added your mods. I'll have a proper play later and report back.

Thanks once again for all your efforts.

Steve
[Xiaomi Mi Note 10 Questions & Answers] picitup:
After playing with Open Camera, it seems that camera id 9 is causing problems with my EU rom. After camera 9 is used, Open Camera no longer updates the screen with the camera image.

Just for now, I've modded the code to limit the last camera id to 5 which seems to work fine:

int cameraId = getNextCameraId();

[B] if(cameraId>5) cameraId=0;[/B]

if(cameraId==6) cameraId=7;
if(cameraId==8) cameraId=9;
if(cameraId==10) cameraId=11;
if(cameraId==11) cameraId=12;
if(cameraId==12) cameraId=13;
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Morning :)

I was poking around the Mi9 forum and found this thread:

[APP][MOD][MAGISK] 48MP and improvements for GCam

https://xdaforums.com/Mi-9/themes/app-48mp-improvements-gcam-t3992597/page2

I appreciate it's for another camera module, but wonder if there's any clues for our sensor there?

Cheers

Steve
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Thanks Steve, looks interesting, since there is no code I have downlaoded and trying to decompile it to see what it does, looks dangerous by the comments in the thread :cool:

Camera 9 works for me but it is weird bottom half of the picture is green stripes and upper the image is duplicated like a stereo pic...
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
btw tryed adding this to build.prop but so far see no difference

persist.camera.HAL3.enabled=1
persist.camera.eis.enabled=1

and from the Mi9 forum there are a few more props to test like

persist.camera.CDS=1
persist.camera.HAL3.enabled=1
persist.camera.ae.capture.bound=7
persist.camera.ae.instant.bound=7
persist.camera.auto.hdr.enable=1
persist.camera.auxcamera.swap
persist.camera.batchcount=0
persist.camera.continuous.iso
persist.camera.dc.frame.sync
persist.camera.dcrf.enable=1
persist.camera.disable_zsl_mode=0
persist.camera.dual.camera
persist.camera.dual.camera.dump
persist.camera.dual.camera.mpo
persist.camera.dual_led_calib=1
persist.camera.dumpimg
persist.camera.dumpmetadata
persist.camera.eis.enable=1
persist.camera.exif.rotation
persist.camera.eztune.enable
persist.camera.facedetect=1
persist.camera.fdvideo
persist.camera.feature.cac
persist.camera.feature.restart
persist.camera.feature.shutter
persist.camera.global.debug
persist.camera.gyro.android=4
persist.camera.hal.debug
persist.camera.hal3.prv.feature=1
persist.camera.hal3hfr.enable=1
persist.camera.hdr.outcrop
persist.camera.hdr.video=2
persist.camera.imglib.stillmore
persist.camera.initial.exp.val
persist.camera.instant.aec
persist.camera.instant.capture
persist.camera.is_mode=4
persist.camera.is_type=4
persist.camera.jpeg_burst
persist.camera.kpi.debug
persist.camera.led.on.period
persist.camera.liveshot.size
persist.camera.longshot.save
persist.camera.longshot.stages
persist.camera.ltmforseemore
persist.camera.mem.usecache
persist.camera.mem.usepool
persist.camera.mobicat
persist.camera.multi_pass=1
persist.camera.no-display
persist.camera.nonzsl.yuv
persist.camera.offlineraw
persist.camera.ois.disable=0
persist.camera.ois.video=1
persist.camera.opt.livepic=1
persist.camera.preview.seemore
persist.camera.preview.ubwc
persist.camera.preview_raw
persist.camera.preview_yuv
persist.camera.raw.debug.dump
persist.camera.raw.dump
persist.camera.raw.format
persist.camera.raw_yuv
persist.camera.rdi.mode=1
persist.camera.rdimode=1
persist.camera.remosaic.trigeriso=250
persist.camera.retro.number
persist.camera.saf.stablecnt=3
persist.camera.secure.mode
persist.camera.set.afd
persist.camera.snap.format
persist.camera.snapshot.fd
persist.camera.snapshot.number
persist.camera.snapshot_raw
persist.camera.stats.af.paaf
persist.camera.stats.debug.mask
persist.camera.thermal.mode
persist.camera.thermal.mode=frameskip
persist.camera.time.monotonic
persist.camera.tintless
persist.camera.tn.disable
persist.camera.tnr.preview=1
persist.camera.tnr.video=1
persist.camera.tof.direct=1
persist.camera.video.CDS
persist.camera.video.ubwc
persist.camera.video_raw
persist.camera.zsl.backlookcnt
persist.camera.zsl.interval
persist.camera.zsl.mode
persist.camera.zsl.queuedepth
persist.camera.zsl_matching
persist.camera.zsl_raw
persist.camera.zsl_yuv
persist.capture.burst.exposures
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Also found in the file at /data/property some persist properties related to the camera:

persist.camera.rearMain.vendorID 03
persist.camera.frontMain.vendorID 01
persist.camera.rearTele4x.vendorID 03
persist.camera.rearTele.vendorID 03
persist.camera.rearMacro.vendorID 01
persist.camera.rearUltra.vendorID 01
persist.camera.module.info Iback_camera=F4_semco_Samsung_s5khmx;front_camera=F4_sunny_Samsung_s5kgd1
persist.camera.module.infoext Lback_camera_aux=F4_semco_OV_ov08a10;back_camera_aux=F4_semco_Samsung_s5k2l7
persist.camera.module.infoext2 Iback_camera_aux=F4_sunny_OV_ov02a10;back_camera_aux=F4_sunny_Sony_imx350
persist.camera.algoup.disableldc 0

And there are plenty more camera props if at adb you check all of them

find . -name '*so' | xargs strings | grep '^persist\.'
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Thanks I'll take a look tomorrow.

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Finally Got it hacked!!!:D:D:D 108Mpx with Opencamera [IMG="108Mpx Note10 Open Camera"]https://dl.xda-developers.com/4/9/0/6/4/3/3/Note10-net.sourceforge.opencamera.jpg?key=YxswXHAq4e_hFgQBYdBkiw&ts=1576827904[/IMG]

Will Post the instructions in the OpenCameraThread
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Source code to enable it is here: https://xdaforums.com/mi-note-10/themes/enable-5-cams-opencamera-108mpx-mode-t4016279

Btw it takes 108Mpx pictures faster than the stock camera app, not tested quality yet.

and it seems to work with raw too it takes about a minute to take if raw enabled but nothing is stored so may need further works :)
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Sound like you cracked it wide open! Well done :)

I'll try it out today and report back on the other thread.

You should add a donate button to your account..... :)
[Xiaomi Mi Note 10 Questions & Answers] Kasallamacher:
108 faster than stock? My stock app takes 108 immediately.
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
you have the pro? , my non pro stock app takes a couple seconds for 108Mpx pics
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
also @picitup I found other files that may change the stock or other cam apps behavior to tinker and test at system\vendor\etc\camera\

like camxoverridesettings.txt

these are the contents of mine: some are commented #

multiCameraEnable=TRUE
#logInfoMask=0x10098
#overrideLogLevels=0x1F
enableNCSService=TRUE
disableOIS=FALSE
disablePDAF=FALSE
pdafHWEnableMask=0x2
disableFocusIndication=1
#enable3ADebugData=TRUE
#enableTuningMetadata=TRUE
advanceFeatureMask=0x7E7
isBeautyMakeupSupported=TRUE
isVideoBeautifierSupported=TRUE
exposeFullSizeForQCFA=FALSE
useFeatureForQCFA=1
enableSensorHWSync=TRUE
multiCameraFrameSync=1
enableSensorFpsMatch=TRUE
enableICAInGrid=1
forceDisableUBWCOnIfeIpeLink=0
enableInternalHALPixelStreamConfig=TRUE
iseispreviewSupported=TRUE
enableBubbleRecovery=FALSE
minReprocessInputWidth=6016
minReprocessInputHeight=4512
logConfigMask=0
ismfnrbokehsupported=TRUE
fovcEnable=1
tintlessEnable=TRUE
enableTOFInterface=TRUE
dynamicEnableTOFInterface=TRUE
isTeleOisSupported=TRUE
gyroSensitivityLLS=0.04
gyroSensitivityLLSEnable=FALSE
FDPreProcessing=GTM
enableOfflineNoiseReprocess=1
enableOISOptimization=TRUE
#Moon Mode Parms Start
enableMoonOffset=1
cubicParamMoonOffset=0
quadraticParamMoonOffset=0
linerParamMoonOffset=10.921
constantParamMoonOffset=0
#Moon Mode Parms End
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Lol I read them all and understood none!

Thanks again for all your efforts :)

Cheers

Steve
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
[MENTION=3467492]picitup[/MENTION] I have some advances with the raw capture at 108Mpx , bypasing some stuff at the opencamera + camera2 api to save the dng file I was able to access the raw buffer and save it to disk it, but still have issues with the file headers and dng info so it is not readable, but at least seems to match by the size it is about 200Mb, 4 times the stock app size that generates a raw dng file of about 50Mb for the 27Mpx image, will keep looking into it!
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi [MENTION=10329227]TF1920[/MENTION] sounds like you've been working hard over the xmas break. That sounds like great progress.

If your DNG files are just headerless binary data, you might be able to open them in irfanview, which offers a .raw extension (Raw binary data). I think I read that DNG files can also offer lossless compression.

If I can be of any help, please let me know. If you want to post up one of your DNG files I can have a play.

Cheers
[Xiaomi Mi Note 10 Questions & Answers] picitup:
I just had a poke around and you probably have this already:

http://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf

I see DNG is an extension of TIFF 6. Nice.

Cheers
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Another little poke around and I found this:

https://www.awaresystems.be/imaging/tiff/astifftagviewer.html

It will read the TIFF tags from a Note10 DNG file
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Thanks [MENTION=3467492]picitup[/MENTION] the buffer is not yet a dng, so it is not recognized by any "off the self" software yet, it is a buffer of bytes "General raw camera sensor image format, usually representing a single-channel Bayer-mosaic image. Each pixel color sample is stored with 16 bits of precision." but seems that the information could be there since the file is 217153536 bytes so for 9024x12032 pixeles , there will be 2 bytes or 16 bits x pixel so match the android description, trying to decode the buffer atm with code with OpenCV

Here you have a sample test file for the raw buffer, the jpg is a similar pic but not the same exact pic, since atm when raw I am only storing the raw buffer https://srv-file9.gofile.io/download/SCUrCc/rawtestNote10.zip

---------- Post added at 08:17 PM ---------- Previous post was at 07:58 PM ----------

Mostly was able to decode the raw buffer but bad news looks like about 3/4 of it are 0s or black pixels so no info :( will re-check code to see if there is something I missed

https://srv-file7.gofile.io/download/nZCkBQ/decoded.jpg
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi I'm not sure, but think irfanview might import simple raw data but I'll give it a try.

The 2 links above give me "You are not authorized to download this file." Do I need some permissions?

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
try this link https://gofile.io/?c=7LcIgd
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Good Morning :)

Yes that link works thanks. I've had a play and think that despite the size of the file intimating a 108MP image, the actual image data is only half this.

I renamed the file to rawbuffer.raw and opened it in irfanview (see attached import page pic) and set the resolution to W:6016 and H:4512 and it opened fine, with no black areas. When I imported using full 108MP res, the two halves of the image were stacked horizontally.

I've also attached a pic of the resultant image saved as a HalfRes.jpg. I think I have the colour order wrong, but it looks like the original.

Just a suggestion - if you use a numbered grid as the photo, it might be easier to see where the bits of the image are. If you want me to make one up, to save you time, just ask!

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Good Morning Steve and Good job,

Here you have another example with a numbered grid https://gofile.io/?c=YRLHsV

I guess what you are suggesting is that the raw buffer is not storing the full 108Mpx but the 27Mpx one?

Edit: Also test infranview but the mode set is not as the one used by android raw, it should be 16BPP yes but not in any of these configurations should be a Bayyer pattern (probably RG) but the import box only allows bayer pattern up to 12BPP :(
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi well that's what I thought from your 1st image, but looking at the grid you photographed, it seems there are 2 images side by side, identical apart from the colour information looks a little different.

I've uploaded a jpeg of the image imported at 6016x4512 (grid.jpg) and another imported at 12032x9024 (gridfull.jpg). The gridfull.jpg is reduced resolution so I can post it on the forum, and I've filled the black area with blue to make it a little clearer.

I'm a little confused now lol!
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hmm... not quite sure where I'm going with this, but I imported the file repeatedly, playing with different image settings and came up with the attached (reduced resolution).

Now the image area is 12032x4512. The import settings were 24 bit YUV. Just a guess, but we may have an issue with the format if it's quad bayer and decoding the same.

Just an idea from the past. My camera used to sometimes save just the binary data of AVI files (no header) if the battery was low. The fix was to find a good file, cut the header off and insert it at the start of the binary data. Then the file was converted to a complete AVI and worked.

Would it be possible to chop the header off a working DNG file and insert it into your binary data?

Probably crazy lol.
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
good detective works [MENTION=3467492]picitup[/MENTION] , you could try the dng works, replacing the hex values for the resolution in the header of a existing dng form the stock opencam, but the plain android rawbuffer we are using atm is not the same as the dng raw compressed buffer, anyway the problem still is that there are missing 3/4 of the pixel info so far, even in your last 12032x4512 example seems that only 27Mpx or half it is valid, more likekly next year :) will try to build a simple app to see if the results are the same as in the modified OpenCam.

Another thing you can try is with this file https://gofile.io/?c=Gh39IW it is also a raw buffer but taken with opencam but setting 6016x4512 resultion , weird that the file size is the same as in 108Mpx:)
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi thanks. I didn't manage to improve my results with your opencam image. I'll have a think and see if I can come up with some more ideas.

So is the data format of the raw files just simple RGB or is it a direct sensor dump and will need Bayer decoding?

Enjoy your new year's eve.... :)
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
yes It is a direct sensor dump needing bayer decoding yes.

Enjoy your new year's eve too!
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Thanks :)

I just wondered what results I get if I did it all in reverse so I took a 27MP Note10 DNG file and saved it as a raw file in Irfanview to see if it would work and it did. Not sure if it's any help but here it is:

https://mega.nz/#F!JEN0wYjB!KiTFHtdcvugt9rBWmPV9_w

There's the raw file - obviously not bayer encoded, a jpeg of the image and a screenshot of the settings I used.

Anyway, you probably want to get off drinking :)
[Xiaomi Mi Note 10 Questions & Answers] picitup:
A happy and healthy new year to [MENTION=10329227]TF1920[/MENTION] and all readers :)

In the spirit of doing things in reverse, I created a 108MP 24 bit blank .BMP, saved it, cut out the image data and pasted in the 108MP streams that you provided and got the same results as a binary import of the raw data.

Then I used the excellent free program https://www.hhdsoftware.com/free-hex-editor Hex Editor Neo to look at your original stream Note10-108MpxRawtest2/rawbuffer2.raw and found:

file offset 0-54,288,383 contains expected random binary data

file offset 54288384-217,153,535 (EOF) contains just zeros

So it looks to me that although the file size of the stream hints at being 108MP, it's only around 25% populated with data which exactly works out to 26.99999962699203 MP and confirms our efforts to view it and only 25% of the image canvas is populated.

In short, I think our viewing methods are fine, but the contents of the file is where the problem lies.

Bummer.

BTW Neo is a brilliant binary editor. It works just like a text editor but for binary files and is really fast even with 200MB files :)

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Happy new year too! and thanks for the info, will keep digging to see if we can generate the full populated 108Mpx raw stream
[Xiaomi Mi Note 10 Questions & Answers] picitup:
OK so I don't want to distract from the current effort to find a 108MP raw stream, but was thinking about the file formats and decoding the Bayer output.

I've attached an image of Quad Bayer, Normal Bayer and what I call "Slipped Quad".

The crux of it is, if you take a Quad Bayer stream and ignore the 1st row and column of pixels, then group 4 neighbouring pixels together, you get a (just under) 108MP RGGB image. It probably makes more sense to look at the image!

The image on the right is the decoding method I'm suggesting and the captured pixels are in white boxes.

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Good info [MENTION=3467492]picitup[/MENTION], you have all the info of the sensor here: https://www.samsung.com/semiconductor/image-sensor/mobile-image-sensor/S5KHMX/ I am using OpenCV to convert the color space you have some info here too https://docs.opencv.org/3.4/de/d25/imgproc_color_conversions.html

> created a new app from scratch based on the android raw examples, to discard some OpenCamera issues, and raw problem is the same.

Also found where the problem with 108Mpx raw size may reside in the camera info these values don't match with the max resolution:

android.sensor.info.activeArraySize (f0000): int32[4]

[0 0 6016 4512 ]

android.sensor.opaqueRawSize (e001e): int32[3]

[6016 4512 33930240 ]

android.sensor.info.pixelArraySize (f0006): int32[2]

[6016 4512 ]

android.sensor.info.preCorrectionActiveArraySize (f000a): int32[4]

[0 0 6016 4512 ]

The last 2 are used by the android native source code (android_hardware_camera2_DngCreator.cpp) to store the dng headers and since the buffer size and the camera info don't match it the 108Mpx raw is not saved.

> so the next challenge is to find a way to change the above values to 12032 x 9024 and test again my buffers, don't know if a vendor buildprop could do anything or a customized os version is needed.

> I think the solution is to edit this file camxoverridesettings.txt at system\vendor\etc\camera\

and set this parameter to TRUE exposeFullSizeForQCFA=FALSE since QCFA is Quad color filter mosaic

> finally was able to edit this property but makes no difference in the buffer generated , and looks like the "adb shell dumpsys media.camera > camera.txt" gives the same results
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi [MENTION=10329227]TF1920[/MENTION]

Thanks for the info. OpenCV looks really powerful, much more than irfanview. I'll spend some time reading the docs and try and get up to steam with it.

It sounds like you're digging really deep into the system. I'm sure you'll get there. It's a pity just changing exposeFullSizeForQCFA didn't do the trick as that would have been a very easy fix.

In the meantime, if there's anything I can do to help, please let me know. I'm happy to take a look at any streams you manage to extract from the device if that helps.

Cheers
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Thanks Steve, yes OpenCV is quite powerfull, will let you know once I have any advances, probably some deeper changes in the system and vendor stuff are needed tesiting some with magisk atm

Another app maybe worth trying is https://play.google.com/store/apps/details?id=amirz.dngprocessor
[Xiaomi Mi Note 10 Questions & Answers] harysviewty:
Can someone please send me modified version of opencamera to access all of those Aux cams please

---------- Post added at 05:14 PM ---------- Previous post was at 05:06 PM ----------

Can someone please download 'hw device info' and see the camera sensor lists?
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Here it is!
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Here you have the sensor list from hw device info https://gofile.io/?c=YwnyqA
[Xiaomi Mi Note 10 Questions & Answers] harysviewty:
Can you click on supported 8? I need to see the sensor lists
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
Yes here they are https://gofile.io/?c=asvPEx , is interesting that 2 108Mpx show up, these names are linked to the .so files?, any clue to help up with the raw stuff?
[Xiaomi Mi Note 10 Questions & Answers] TF1920:
[MENTION=3467492]picitup[/MENTION] I was finally able to get full 108Mpx raw dumps from the Note 10, here you have the files https://gofile.io/?c=IwR15m , you can play with them with infranview but finally the full raw pixels are there :) ,

how i did it:

1.- Edit the file camxoverridesettings.txt at vendor/etc/camera and add this line at the end:

reprocessDump=TRUE

2.- Reboot your phone and check that this line is there, if not you need to build a small magisk module to modify it

3.- Then once you take any picture with the stock cam app 3 files will be generated at ./data/vendor/camera with the full raw info in total 500Mb for each pic be warned ;)

looks like they are in 3 formats yuvrawplain16, rawmipi, yuv420nv12

Edit: For example at infranview the file ended yuv420... import perfectly with setting 24BPP s YUV 4:2:0 activated, color oreder RGBA, Interleaved

Let me know if you play with them your thoughts.

Still this is not integrated at opencamera, one option could be with special permisions to move this files to the DCIM folder or delete them in the raw is disabled.
[Xiaomi Mi Note 10 Questions & Answers] picitup:
Hi [MENTION=10329227]TF1920[/MENTION] - I thought you had been quiet and assumed you were working hard at the problem. 108mp raw is amazing! I wish you were around on the Mi9 forum when I was trying to get 48mp raw working :)

I have a meeting this morning, but am free this afternoon so will definitely take a look at your samples and try out your instructions to get them working on my phone too.

500MB files lol. I'm guessing these are uncompressed and could be made smaller with lossless jpeg DNG compression. I'll take a look into that. Fortunately I have plenty of spare space on my phone. The maths doesn't quite seem to work out as 12032x9024x3bpp = 325MB but we can worry about that later.

I'll report back with my findings.

Thanks once again for all your efforts. How many hours have you spent so far or shouldn't I ask? :silly:

Cheers

Steve