Millipixels not finding cameras

Hello,

I received a “librem 5 USA” a few weeks ago.

After making a full upgrade :

uname -a
Linux pureos 6.1.0-1-librem5 #1 SMP PREEMPT Wed Dec 14 15:50:03 UTC 2022 aarch64 GNU/Linux

I tried to run the camera app “millipixels”, which fails by returning :

“Selected camera is not available. Is it turned on?”

Trying to switch of camera does not help.

More precisely, here is the log :

millipixels RET

Found config file at /usr/share/millipixels/config/purism,librem5r4.ini
Adding camera big from config
matched GRBG8 to GRBG8 3
matched GRBG8 to GRBG8 3
Adding camera selfie from config
matched GBRG16 to GBRG16 14
matched GBRG16 to GBRG16 14
Found postprocessor script at /usr/share/millipixels/postprocess.sh
mp_device_list_find_remove imx7-csi s5k3l6xx 3-002d
20: there’s csi, looking for s5k3l6xx 3-002d
20: there’s csi capture, looking for s5k3l6xx 3-002d
20: there’s imx8mq-mipi-csi2 30a70000.csi, looking for s5k3l6xx 3-002d
19: there’s csi, looking for s5k3l6xx 3-002d
19: there’s csi capture, looking for s5k3l6xx 3-002d
19: there’s imx8mq-mipi-csi2 30b60000.csi, looking for s5k3l6xx 3-002d
19: there’s s5k3l6xx 3-002d, looking for s5k3l6xx 3-002d
found!
devname /dev/video1
19: there’s csi, looking for s5k3l6xx 3-002d
19: there’s csi capture, looking for s5k3l6xx 3-002d
19: there’s imx8mq-mipi-csi2 30b60000.csi, looking for s5k3l6xx 3-002d
19: there’s s5k3l6xx 3-002d, looking for s5k3l6xx 3-002d
found!
linking flags 0 source 15:0 sink 10:0
MPDevice: MEDIA_IOC_SETUP_LINK error 22, Argument invalide
mp_device_list_find_remove imx7-csi hi846 2-0020
20: there’s csi, looking for hi846 2-0020
20: there’s csi capture, looking for hi846 2-0020
20: there’s imx8mq-mipi-csi2 30a70000.csi, looking for hi846 2-0020
Could not find /dev/media* node matching ‘imx7-csi’
linking flags 1 source 15:0 sink 10:0
MPDevice: MEDIA_IOC_SETUP_LINK error 22, Argument invalide
Setting mode 1052 780
[0:48:52.720674522] [4279] INFO Camera camera_manager.cpp:293 libcamera v0.0.0
[0:48:52.733235477] [4283] ERROR SimplePipeline simple.cpp:1292 No sensor found
No such camera: /base/soc@0/bus@30800000/i2c@30a50000/camera@2dinvalid

Here are the devices :

lh /dev/video* /dev/media*
crw-rw---- 1 root video 241, 0 31 déc. 17:05 /dev/media0
crw-rw---- 1 root video 241, 1 31 déc. 17:05 /dev/media1
crw-rw---- 1 root video 241, 2 31 déc. 17:05 /dev/media2
crw-rw---- 1 root video 241, 3 31 déc. 17:05 /dev/media3
crw-rw----+ 1 root video 81, 0 31 déc. 17:05 /dev/video0
crw-rw----+ 1 root video 81, 1 31 déc. 17:05 /dev/video1
crw-rw----+ 1 root video 81, 7 31 déc. 17:05 /dev/video2
crw-rw----+ 1 root video 81, 8 31 déc. 17:05 /dev/video3

And I am in the “video” group, it is unlikely to be a permission issue.

I have seen other related topics, but none helped me so far as I already upgraded the whole system and rebooted accordingly.

Errors which show in the logs might not be related to my current issue as I have seen similar logs from another person’s librem 5 USA phone.

May anyone from Purism help me to make the camera app work ?

Regards

1 Like

I am NOT with Purism, just another L5 owner.
I apologize in advance if this is a waste of your time.
A few things that may help you in your troubleshooting.?

‘sudo udevadm monitor’ shows a lot of output when flipping any of the three switches. When I turn the camera switch from off to on I get about 65 lines of output.

‘sudo dmesg -w’ shows the following additional output when I turn on the camera switch: (bottom of the 3 switches)

[19400.176963] imx7_media_csi: module is from the staging directory, the quality is unknown, you have been warned.
[19400.198484] imx7-csi 30a90000.csi: Registered csi capture as /dev/video0
[19400.217588] imx7-csi 30b80000.csi: Registered csi capture as /dev/video1
[19400.446669] imx8mq_mipi_csi2: module is from the staging directory, the quality is unknown, you have been warned.
[19400.479110] imx8mq-mipi-csi2 30a70000.csi: Consider updating driver imx8mq-mipi-csi2 to match on endpoints
[19400.488099] imx8mq-mipi-csi2 30b60000.csi: Consider updating driver imx8mq-mipi-csi2 to match on endpoints
[19400.615248] s5k3l6xx 3-002d: using default 24000000 Hz clock frequency
[19400.615646] of_get_named_gpiod_flags: parsed ‘rstn-gpios’ property of node ‘/soc@0/bus@30800000/i2c@30a50000/camera@2d[0]’ - status (0)
[19400.615906] s5k3l6xx 3-002d: probe i2c ffff000000c84800
[19400.644256] s5k3l6xx 3-002d: model low: 0x30
[19400.644911] s5k3l6xx 3-002d: model high: 0xC6
[19400.645382] s5k3l6xx 3-002d: revision number: 0xB0
[19400.646759] s5k3l6xx 3-002d: Consider updating driver s5k3l6xx to match on endpoints
[19400.656595] debugfs: Directory ‘s5k3l6’ with parent ‘/’ already present!
[19400.896287] hi846 2-0020: GPIO lookup for consumer reset
[19400.896530] hi846 2-0020: using device tree for GPIO lookup
[19400.896671] of_get_named_gpiod_flags: parsed ‘reset-gpios’ property of node ‘/soc@0/bus@30800000/i2c@30a40000/camera@20[0]’ - status (0)
[19400.896848] gpio gpiochip0: Persistence not supported for GPIO 25
[19400.896917] hi846 2-0020: GPIO lookup for consumer shutdown
[19400.896925] hi846 2-0020: using device tree for GPIO lookup
[19400.897001] of_get_named_gpiod_flags: parsed ‘shutdown-gpios’ property of node ‘/soc@0/bus@30800000/i2c@30a40000/camera@20[0]’ - status (0)
[19400.897060] gpio gpiochip4: Persistence not supported for GPIO 4
[19400.920460] hi846 2-0020: chip id 08 46 using 2 mipi lanes
[19400.921631] hi846 2-0020: Consider updating driver hi846 to match on endpoints
[19400.934559] debugfs: Directory ‘hi846’ with parent ‘/’ already present!
[19400.942458] hi846 2-0020: debugfs create dir error

I see in your millipixels output this: “Found config file at /usr/share/millipixels/config/purism,librem5r4.ini”
I have that file. This part seems interesting.

[big]
driver=s5k3l6xx 3-002d
media-driver=imx7-csi
libcamera-id=/base/soc@0/bus@30800000/i2c@30a50000/camera@2d

I see it mentioning two drivers. I take this to be kernel modules.?
‘sudo lsmod | grep s5k’ shows:

s5k3l6xx 32768 1
v4l2_fwnode 28672 3 hi846,imx8mq_mipi_csi2,s5k3l6xx
v4l2_async 28672 7 v4l2_fwnode,v4l2_flash_led_class,dw9714,hi846,imx8mq_mipi_csi2,imx7_media_csi,s5k3l6xx
videodev 278528 11 v4l2_async,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hi846,hantro_vpu,videobuf2_common,imx8mq_mipi_csi2,i
mx7_media_csi,v4l2_mem2mem,s5k3l6xx
mc 77824 12 v4l2_async,videodev,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hi846,hantro_vpu,videobuf2_common,imx8mq_mi
pi_csi2,imx7_media_csi,v4l2_mem2mem,s5k3l6xx

‘sudo lsmod | grep imx7’ shows this:

imx7_media_csi 32768 0
videobuf2_dma_contig 24576 2 hantro_vpu,imx7_media_csi
videobuf2_v4l2 32768 3 hantro_vpu,imx7_media_csi,v4l2_mem2mem
videobuf2_common 69632 6 videobuf2_dma_contig,videobuf2_v4l2,hantro_vpu,imx7_media_csi,v4l2_mem2mem,videobuf2_memops
v4l2_async 28672 7 v4l2_fwnode,v4l2_flash_led_class,dw9714,hi846,imx8mq_mipi_csi2,imx7_media_csi,s5k3l6xx
videodev 278528 11 v4l2_async,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hi846,hantro_vpu,videobuf2_common,imx8mq_mipi_csi2,i
mx7_media_csi,v4l2_mem2mem,s5k3l6xx
mc 77824 12 v4l2_async,videodev,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hi846,hantro_vpu,videobuf2_common,imx8mq_mi
pi_csi2,imx7_media_csi,v4l2_mem2mem,s5k3l6xx

Also in the config file it has, “libcamera-id=/base/soc@0/bus@30800000/i2c@30a50000/camera@2d”

Searching for something like it on the file system I found:

/sys/firmware/devicetree/base/soc@0/bus@30800000/i2c@30a50000/camera@2d

Perhaps something here, when compared to what you see, can add more clues?

1 Like

Very next and correct output lines that should appear, the ones that aren’t there, are following two:
found!
devname /dev/video0
Etc.

Therefore, as we all see where errors start, perhaps simple reinstall of here related package might help there, I think:
apt list millipixels -a
sudo apt autoremove
sudo dpkg -P millipixels
sudo apt update && sudo apt full-upgrade
sudo apt install millipixels
sudo apt autoremove
millipixels RET

I user-errored a similar problem once. It took me longer than I care to admit that I had the software looking for a non-existent front camera. Try pushing the switch camera button on the lower left of the camera gui?

Can you check which version of Millipixels you have? Also, the output of the uname -r command.

This looks like you have an outdated Millipixels.

1 Like

Hi,

Thanks for your answer.

I carefully upgraded the system with :
apt list millipixels -a
sudo apt autoremove
sudo dpkg -P millipixels
sudo apt update && sudo apt full-upgrade
sudo apt install millipixels
sudo apt autoremove

uname -r gives

6.1.0-1-librem5

Still millipixels cannot find cameras.

1 Like

Can you check which version of Millipixels you have?

dpkg -s millipixels
2 Likes

Hi, thanks for your help.

The command dpkg -s millipixels returns many things, among which :

Version: 0.20.0-1pureos1

which should be the most uptodate version as I upgraded one hour ago.

Regards

Could you check the version of libcamera? dpkg -s libcamera

1 Like

It tells me libcamera is not installed.

It is “libcamera0” which is installed with version :

0~git20220628+27cc0a6b-1pureos3

Huh, that should not be possible. 20.0 will not start if libcamera is not there. Maybe it just disappeared from the installed package list, that would explain why the behaviour matches the older version.

2 Likes

I edited my previous reply.

Please turn on the switches, then reboot the phone, and send the result of:

dmesg | grep s5k3l6xx

It does not seem to return any errors, however :

s5k3l6xx 3-002d: revision number 0xB0
s5k3l6xx 3-002d: Consider updating driver s5k3l6xx to match on endpoints

might be a clue

The log shows s5k3l6xx being present, it’s hi846 that’s missing.

You mean, these log lines :

I made all possible suggestions and millipixels is still unable to find any cameras.

I begin to think it is a hardware issue. Could it be ?

The last thing to do is to make a full pureos/librem5 reinstall.

Could you try dmesg | grep hi846?

1 Like

Yes, there seem to have an issue there :

hi846 2-0020: i2c read error: -6
hi846: probe of 2-0020 failed with error -5

These are the last two lines appearing with dmesg | grep hi846, previous lines seem fine.

Regards

Thanks for following up. Please contact support@puri.sm

1 Like