How do I check camera is connected?

In spring I had successfully run the tests and I could see image from the camera with my vlc. Half a year later I can’t run the same tests:

root@milkv-duo]/mnt/system/usr/bin# sensor_test 
[sys_vi_init]-41: MMF Version:7e0cc6a08-musl_riscv64
[SAMPLE_COMM_SNS_ParseIni]-1950: Parse /mnt/data/sensor_cfg.ini
[parse_source_devnum]-1605: devNum =  1
[parse_sensor_name]-1686: sensor =  GCORE_GC2083_MIPI_2M_30FPS_10BIT
[parse_sensor_busid]-1714: bus_id =  1
[parse_sensor_i2caddr]-1725: sns_i2c_addr =  37
[parse_sensor_mipidev]-1736: mipi_dev =  0
[parse_sensor_laneid]-1747: Lane_id =  3, 2, 4, -1, -1
[parse_sensor_pnswap]-1758: pn_swap =  0, 0, 0, 0, 0
[SAMPLE_PLAT_SYS_INIT]-72: common pool[0] BlkSize 3133440
ISP Vipipe(0) Allocate pa(0x8c56c000) va(0x0x3fe9d23000) size(291120)
stSnsrMode.u16Width 1920 stSnsrMode.u16Height 1080 25.000000 wdrMode 0 pstSnsObj 0xe8cf8
[SAMPLE_COMM_VI_StartMIPI]-483: sensor 0 stDevAttr.devno 0

and

root@milkv-duo]/mnt/system/usr/bin# camera-test.sh
[SAMPLE_COMM_SNS_ParseIni]-1950: Parse /mnt/data/sensor_cfg.ini
[parse_source_devnum]-1605: devNum =  1
[parse_sensor_name]-1686: sensor =  GCORE_GC2083_MIPI_2M_30FPS_10BIT
[parse_sensor_busid]-1714: bus_id =  1
[parse_sensor_i2caddr]-1725: sns_i2c_addr =  37
[parse_sensor_mipidev]-1736: mipi_dev =  0
[parse_sensor_laneid]-1747: Lane_id =  3, 2, 4, -1, -1
[parse_sensor_pnswap]-1758: pn_swap =  0, 0, 0, 0, 0
MMF Version:7e0cc6a08-musl_riscv64
Create VBPool[0], size: (3110400 * 3) = 9331200 bytes
Create VBPool[1], size: (3110400 * 3) = 9331200 bytes
Create VBPool[2], size: (2764800 * 1) = 2764800 bytes
Total memory of VB pool: 21427200 bytes
Initialize SYS and VB
Initialize VI
ISP Vipipe(0) Allocate pa(0x8c524000) va(0x0x3fce775000) size(291120)
stSnsrMode.u16Width 1920 stSnsrMode.u16Height 1080 25.000000 wdrMode 0 pstSnsObj 0x3fcf5a5400
[SAMPLE_COMM_VI_StartMIPI]-483: sensor 0 stDevAttr.devno 0
vi init failed. s32Ret: 0xffffffff !
init middleware failed! ret=ffffffff

can I tell by these logs if it is a hardware problem or a software bug?
P.S. Last time, if i recall it correctly, I connected an external power supply to the board, since it was somewhat inconsistent, and I decided it had insufficient power. But the last time it was working just fine - without an issue.

1 Like

that’s weird. I do not remember changing anything on the board. However, after I reinstalled the brand new ready-to-go image from github, the camera started working again!

Another question is where do i find source code for that sample_vi_fd (i’d like to alter it and recompile it) - it’s a pity I can’t find such tutorials…

Where did you get that binary? If it was there already in the stock image, then give Buildroot Milk-V SDK a try, probably?

Initially mine was from buildroot (it was last February that I tinkered with it, and I can’t actually remember, how I did it - one thing for sure: I was using an old imac with linux mint (and probably docker for ubuntu?). this time I just downloaded the ready-made image from github.

I just installed tcc and I’m wondering: does it have all the headers installed by default on that image, will I be able to compile this sensor-test.c thing on the board itself?)

1 Like