Samsung camera: mystery registers investigation
Not to spam random threads, this is the one with ongoing research. Mostly regarding how to get rid of noise in the pictures.
Related: https://source.puri.sm/Librem5/linux-next/-/merge_requests/396/diffs#note_157948
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Dorota Czaplejewicz added camera label
added camera label
- Dorota Czaplejewicz mentioned in issue #317
mentioned in issue #317
Left part - all registers from !396 and !378 (merged) applied
Right part - same thing as above but with:
root@dogwood:/sys/kernel/debug/s5k3l6# echo 0x307b > address root@dogwood:/sys/kernel/debug/s5k3l6# echo 0x80 > add_value
Taken at full res (no binning)
Collapse replies - Author Maintainer
Well, that's curious, the banding is vertical in all my pictures. Sensor model difference?
Sorry, the photo is rotated 90 degrees (took it with Megapixels)
Also, I cropped it to show only top half to keep image size at bay.
- Author Maintainer
Ah, thanks. So it's really bands parallel to the short side of the sensor.
- Author Maintainer
First suspect: 0x3074, namely the last nibble (low nibble of 0x3075): by default it's 0x4.
- It seems it affects color channels separately.
- 0x1 somewhat corresponds to white when 4-binning.
- Not setting it causes a global unevenness.
- Value resulting in uniform darkness depends on binning (0x4 for 4-binning, 0x2 for 2-binning, ? (investigating) for no binning.
- 0x2 in 2-binning still leaves some banding
Edited by Dorota Czaplejewicz - Author Maintainer
There seems to be some... edge detection (?) going on. With 3074: 0970, post-processing x32 it results in clumped pixels, and more clumped on edges of the radiator ribs:
Edited by Dorota Czaplejewicz - Author Maintainer
For no binning, the value 0x0973 and 0x0977 work, with the latter being somewhat brighter.
There's also another set of mystery registers on page 26 of the application note:
s32020080 s32040080 s32060080 s32080080 s32320000 s32340000 s32A00100 s33000001 s34000001 s34024E00 s32680000
purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x02 r2 0x00 0x81 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x04 r2 0x00 0x81 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x06 r2 0x00 0x81 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x08 r2 0x00 0x81 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x32 r2 0x00 0x40 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x34 r2 0x01 0x00 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0xa0 r2 0x00 0x04 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x33 0x00 r2 0x00 0x00 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x34 0x00 r2 0x00 0x00 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x34 0x02 r2 0x4e 0x46 purism@dogwood:~$ sudo i2ctransfer -f -y 3 w2@0x2D 0x32 0x68 r2 0x01 0x00
Interestingly, the Android driver doesn't seem to touch most of those (at least I did not find them being touched anywhere). The only ones it does touch are
0x3400
and0x3402
, but they're set to0x0000
and0x4E42
respectively.- Author Maintainer
- Author Maintainer
- Author Maintainer
Setting 3234 from 0100 to 0000 makes them disappear altogether.
- Author Maintainer
I can't get focus pixels to appear in 1:2 binning, even though I didn't touch anything I can remember. I'm not sure whether I actually observed them.
Using cfee358d they appear in 1:1.
307a: 0d00 // default 0d80. 0080 off is noisy. Does not turn off focus pixels when binning is off. Not sure when 1:2 binning, as they don't appear.
- Author Maintainer
Correction: focus pixels don't appear in 1:2 test pattern. They do appear in dark frame, although faintly.
307a: 0d00 // 0d80 0080 off is noisy. Does not affect focus pixels when binning is off. Does make them disappear in non-test-pattern 1:2 dark frames.
Edited by Dorota Czaplejewicz - Author Maintainer
3074 was promising at default gain, but after bumping gain, I couldn't find any value that didn't result in banding between 0-7 at binning 2. It did change some noise and the intensity of the focus pixels at default gain:
//3074: 0977 // 0974 // 7,6,5 faint focus pixels at 2 times binning pedestal 0
//3074: 0972 // 0974 // super faint focus pixels at 2 times binning pedestal 13
//3074: 0971 // 0974 // super faint noise at 2 times binning pedestal 13
3074: 0970 // 0974 // some noise at 2 times binning pedestal 5
Edited by Dorota Czaplejewicz - Dorota Czaplejewicz removed camera label
removed camera label
- Dorota Czaplejewicz added logbook label
added logbook label