How to know which sensor my hik camera has ?

gipsh

n3wb
Joined
Mar 21, 2016
Messages
21
Reaction score
0
Is there a way to get which sensor brand (aptina,sony,omni,etc..) my camera has programatically ?

Im able to boot my own firmware from SD using the bootloader, but when i want to compile
a sample code i need to specify the camera sensor.

Thanks!!
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,905
Reaction score
6,757
Location
Scotland
Is there a way to get which sensor brand (aptina,sony,omni,etc..) my camera has programatically ?
One option might be to list the loaded kernel modules and figure a way to process the result - perhaps by a process of elimination from a known list of types in use.
But it does not look that universal.

Example from an IPC-T140, using a 4MP ov4689 sensor.
Code:
~ # cat /proc/modules
ov4689_mipi 25218 0 - Live 0x7f12b000 (PO)
snd_soc_ambdummy 2054 0 - Live 0x7f127000
snd_soc_dummy 2939 0 - Live 0x7f123000
snd_soc_ambarella_i2s 5629 0 - Live 0x7f11e000
ehci_ambarella 2450 0 - Live 0x7f11a000
ehci_hcd 47924 1 ehci_ambarella, Live 0x7f108000
usbcore 151833 3 ehci_ambarella,ehci_hcd, Live 0x7f0d1000
hikio 120051 2 - Live 0x7f0ad000 (PO)
base 9628 1 hikio, Live 0x7f0a4000 (O)
watch 1010 0 - Live 0x7f0a0000 (O)
ambad 1833 2 - Live 0x7f09c000 (PO)
ambhdmi 26254 0 - Live 0x7f091000 (PO)
ambdbus 1702 0 - Live 0x7f08d000 (PO)
ambtve 1742 0 - Live 0x7f089000 (PO)
iav 211954 5 ov4689_mipi, Live 0x7f048000 (PO)
vout 44260 4 ambhdmi,ambdbus,ambtve,iav, Live 0x7f037000 (PO)
hw_timer 4103 1 iav, Live 0x7f032000 (PO)
imgproc 18103 1 iav, Live 0x7f02a000 (PO)
dsp 52245 3 iav,vout,imgproc, Live 0x7f015000 (PO)
msg 72254 8 ov4689_mipi,ambhdmi,ambdbus,ambtve,iav,vout,imgproc,dsp, Live 0x7f000000 (O)
~ # prtHardInfo
Start at 2019-06-24 21:43:20
Serial NO :IPC-T14020171212BBWR151586945
V5.4.5 build 170124
NetProcess Version: 1.7.1.179932 [15:49:49-Jan 23 2017]
Db Encrypt Version: 65537
hardwareVersion    = 0x0
hardWareExtVersion    = 0x0
encodeChans        = 1
decodeChans        = 1
alarmInNums        = 0
alarmOutNums        = 0
ataCtrlNums        = 0
flashChipNums        = 0
ramSize            = 0x4000000
networksNums        = 1
language            = 1
devType            = 0x22261
net reboot count    = 0
vi_type            = 32
Path: /Camera/Platform/Branches/branches_frontend_software_platform/IPC_develop_branch/IPC_5.4.x/ipc_5.4.4_r6
Last Changed Rev: 253136
Last Changed Date: 2017-01-23 23:51:42 +0800 (Mon, 23 Jan 2017)


~ #

This from a DS-2CD2432 a mt9t002 3MP sensor :
Code:
alastair@PC-I5 ~ $ ssh admin@192.168.1.105
admin@192.168.1.105's password:


BusyBox v1.19.3 (2014-07-11 11:25:54 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

#
# cat /proc/modules
8189es 554802 0 - Live 0xbf0cf000
event_notify 3907 1 - Live 0xbf0c9000
cmemk 9037 0 - Live 0xbf0c0000
mt9t002 16747 0 - Live 0xbf0b6000 (P)
ambarella_sd 13415 0 - Live 0xbf0ac000
snd_soc_a5sevk 1707 0 - Live 0xbf0a6000
snd_soc_ak4954 58212 1 - Live 0xbf091000
snd_soc_ambarella_i2s 4565 1 - Live 0xbf08a000
ambad 2862 0 - Live 0xbf084000 (P)
ambdbus 63329 0 - Live 0xbf06d000 (P)
ambtve 13839 0 - Live 0xbf064000 (P)
uart232 9670 0 - Live 0xbf05b000
iav 114495 3 - Live 0xbf034000 (P)
vin 8910 2 mt9t002,iav, Live 0xbf02b000 (P)
vout 27682 3 ambdbus,ambtve,iav, Live 0xbf01d000 (P)
imgproc 16423 1 iav, Live 0xbf012000 (P)
dsp 20065 2 iav,imgproc, Live 0xbf006000 (P)
gdmak 2269 2 - Live 0xbf000000
#

But the idea does not look so promising on this DS-2CD3335
Code:
alastair@PC-I5 ~ $ ssh admin@192.168.1.106
admin@192.168.1.106's password:


BusyBox v1.19.3 (2017-01-18 20:54:04 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# cat /proc/modules
hi3516a_pm 46122 0 - Live 0xbf3b3000 (O)
hi_mipi 23446 0 - Live 0xbf3a8000 (O)
hi3516a_adec 7340 0 - Live 0xbf3a3000 (PO)
hi3516a_aenc 48951 0 - Live 0xbf393000 (PO)
hi3516a_ao 109928 1 - Live 0xbf372000 (PO)
hi3516a_ai 116976 2 hi3516a_aenc, Live 0xbf34f000 (PO)
hi3516a_aio 27949 0 - Live 0xbf343000 (PO)
acodec 10982 0 - Live 0xbf33d000 (PO)
hi_sensor_i2c 1441 0 - Live 0xbf339000 (O)
hi3516a_ive 78534 1 - Live 0xbf31e000 (PO)
hi3516a_vda 191153 1 - Live 0xbf2e8000 (PO)
hi3516a_jpege 55418 0 - Live 0xbf2d4000 (PO)
hi3516a_h265e 157108 0 - Live 0xbf2a5000 (O)
hi3516a_h264e 175474 0 - Live 0xbf270000 (PO)
hi3516a_chnl 37053 0 - Live 0xbf261000 (PO)
hi3516a_venc 239530 9 hi3516a_jpege,hi3516a_h265e,hi3516a_h264e, Live 0xbf21c000 (PO)
hi3516a_rc 72399 0 - Live 0xbf204000 (PO)
hi3516a_vou 180593 0 - Live 0xbf1ad000 (PO)
hi3516a_vpss 339915 10 - Live 0xbf14a000 (PO)
hi3516a_viu 248271 3 hi3516a_vpss, Live 0xbf0fd000 (PO)
hi3516a_isp 76405 5 hi_sensor_i2c,hi3516a_vpss,hi3516a_viu, Live 0xbf0e5000 (O)
hi3516a_vgs 132076 0 - Live 0xbf0bc000 (PO)
hi3516a_region 72417 1 - Live 0xbf0a4000 (PO)
hi3516a_tde 123354 2 hi3516a_region, Live 0xbf07d000 (PO)
hi3516a_sys 61829 3 hi3516a_vpss,hi3516a_viu, Live 0xbf066000 (PO)
hi3516a_base 61307 23 hi3516a_adec,hi3516a_aenc,hi3516a_ao,hi3516a_ai,hi3516a_aio,acodec,hi3516a_ive,hi3516a_vda,hi3516a_jpege,hi3516a_h265e,hi3516a_h264e,hi3516a_chnl,hi3516a_venc,hi3516a_rc,hi3516a_vou,hi3516a_vpss,hi3516a_viu,hi3516a_isp,hi3516a_vgs,hi3516a_region,hi3516a_tde,hi3516a_sys, Live 0xbf050000 (PO)
hi_media 5877 32 hi_mipi,acodec,hi3516a_tde,hi3516a_base, Live 0xbf04b000 (O)
mmz 21013 9 hi3516a_ao,hi3516a_jpege,hi3516a_h265e,hi3516a_h264e,hi3516a_tde,hi3516a_sys,hi3516a_base, Live 0xbf041000 (O)
uart232 9999 0 - Live 0xbf03a000 (PO)
PTmotor 5470 0 - Live 0xbf035000 (PO)
alarm 3946 0 - Live 0xbf031000 (PO)
event_notify 4731 1 alarm, Live 0xbf02c000 (PO)
motor 20417 0 - Live 0xbf023000 (PO)
hitimer 2666 2 PTmotor,motor, Live 0xbf01f000 (PO)
hi_sspi 4906 1 motor, Live 0xbf01a000 (O)
hikcomm 66517 7 PTmotor,alarm,event_notify, Live 0xbf004000 (PO)
base 3994 6 uart232,alarm,event_notify,motor,hi_sspi,hikcomm, Live 0xbf000000 (O)
#
 

gipsh

n3wb
Joined
Mar 21, 2016
Messages
21
Reaction score
0
Hi and thanks for the response.
My case is similar to the last you posted, all the drivers are hi_*

This is what we do to get the sensor model,

On the generic build for hi35xxx you have a file called `load3518.sh` which set some parameters
for the sensor. On our camera we looked for the memory positions and the values defined on the file to infer which
sensor we had. Is not perfect but is something. In our case was ar0331.

Code:
    case $SNS_A in
        ar0130|9m034|po3100k)
            devmem  0x20030030 32 0x5;          #Sensor clock 27 MHz
            insmod extdrv/ssp_ad9020.ko;;
        icx692)
            devmem  0x200f000c 32 0x1;          #pinmux SPI0
            devmem  0x200f0010 32 0x1;          #pinmux SPI0
            devmem  0x200f0014 32 0x1;          #pinmux SPI0
            insmod extdrv/ssp_ad9020.ko;;
        mn34031|mn34041)
            devmem  0x200f000c 32 0x1;          #pinmux SPI0
            devmem  0x200f0010 32 0x1;          #pinmux SPI0
            devmem  0x200f0014 32 0x1;          #pinmux SPI0
            devmem  0x20030030 32 0x5;          #Sensor clock 27MHz
            insmod extdrv/ssp_pana.ko;;
        imx104|imx122|imx138)
            devmem  0x200f000c 32 0x1;          #pinmux SPI0
            devmem  0x200f0010 32 0x1;          #pinmux SPI0
            devmem  0x200f0014 32 0x1;          #pinmux SPI0
            devmem  0x20030030 32 0x6;          #Sensor clock 37.125 MHz
            insmod extdrv/ssp_sony.ko;;
        ov9712|soih22|ov2710)
            devmem  0x20030030 32 0x1;          #Sensor clock 24 MHz
            insmod extdrv/ssp_ad9020.ko;;
        mt9p006)
            devmem  0x20030030 32 0x1;          #Sensor clock 24 MHz
            devmem  0x2003002c 32 0x6a;         #VI input associated clock phase reversed
            insmod extdrv/ssp_ad9020.ko;;
        mn34031|mn34041)
            devmem  0x200f000c 32 0x1;          #pinmux SPI0
            devmem  0x200f0010 32 0x1;          #pinmux SPI0
            devmem  0x200f0014 32 0x1;          #pinmux SPI0
            devmem  0x20030030 32 0x5;          #Sensor clock 27MHz
            insmod extdrv/ssp_pana.ko;;
        imx104|imx122|imx138)
            devmem  0x200f000c 32 0x1;          #pinmux SPI0
            devmem  0x200f0010 32 0x1;          #pinmux SPI0
            devmem  0x200f0014 32 0x1;          #pinmux SPI0
            devmem  0x20030030 32 0x6;          #Sensor clock 37.125 MHz
            insmod extdrv/ssp_sony.ko;;
        ov9712|soih22|ov2710)
            devmem  0x20030030 32 0x1;          #Sensor clock 24 MHz
            insmod extdrv/ssp_ad9020.ko;;
        mt9p006)
            devmem  0x20030030 32 0x1;          #Sensor clock 24 MHz
            devmem  0x2003002c 32 0x6a;         #VI input associated clock phase reversed
            insmod extdrv/ssp_ad9020.ko;;
        hm1375|ar0330|gc1004|gc1014)
            devmem  0x20030030 32 0x1;;         #Sensor clock 24 MHz
        ar0331)
            devmem  0x20030030 32 0x5;;         #Sensor clock 27MHz
        imx236)
            devmem  0x20030030 32 0x6;          #Sensor clock 37.125 MHz
            ;;
        *)
 
Top