After librem5 has been on a while Millipixels will hang after taking picture

After a reboot it seems I can always get pictures. At some point later I take a picture but it seems the processing never finishes. I get a swirling progress indication that never stops.


Points of note.
–Millipixels always works after a reboot and does so for a while. I can’t find a repeatable pattern to when it stops working.
–Very rarely it will start working again but only until I close the ap and open it again. Then back to the swirling thing.
–When its working properly the camera preview continues to update even while swirling icon shows processing. When its not the image stops updating and the swirling icon continues to swirl for ever.
–If you don’t close millipixels the battery will drain quickly. Not sure if this relates to this issue.

Any tips on what may cause this and how I can resolve it?
How about pointing me to a process or service I can kill to recover camera functionality without needing a reboot? Closing and reopening millipixels doesn’t work.
Thanks!

2 Likes

Could you post the output of the following command after you see the infinite swirl:

sudo dmesg | tail

Exactly the same problem for me on millipixels 0.21.

For the future, please explicitly write that you are using unreleased versions of packages when asking for help or submitting issues. In this case the screenshot quickly gave it away, but it could have been a headscratcher otherwise. The latest version of Millipixels available in Byzantium is 0.20.0-1pureos1.

4 Likes

Swirling now…
sudo dmesg | tail…
[45422.927065] bq25890-charger 3-006a: Upstream supply changed: 0.
[45422.927095] bq25890-charger 3-006a: Disabling OTG_EN pin
[45422.931306] tps6598x 0-003f: The interrupt is masked , how did it fire ?? 380100a
[45422.945317] bq25890-charger 3-006a: Upstream supply changed: 0.
[45422.945349] bq25890-charger 3-006a: Disabling OTG_EN pin
[45423.051996] bq25890-charger 3-006a: Upstream supply changed: 0.
[45423.052024] bq25890-charger 3-006a: Disabling OTG_EN pin
[45433.591134] cma: cma_alloc: reserved: alloc failed, req-size: 3206 pages, ret: -12
[45433.598769] csi: consider increasing the CMA area
[45433.598784] imx7-csi 30b80000.csi: pipeline start failed with -12

How do I find out what version of millipixels I am running. millipixels -v or --version just launches the camera ap without showing me any version information.

dpkg -s millipixels

Could you (re)install millipixels 0.20 from the repositories and check if this is happening as well?

‘dpkg -s millipixels’ produced this:

root@pureos:/usr/local/bin# dpkg -s millipixels
Package: millipixels
Status: deinstall ok config-files
Priority: optional
Section: x11
Installed-Size: 1420
Maintainer: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
Architecture: arm64
Version: 0.20.0-1pureos1
Config-Version: 0.20.0-1pureos1
Depends: libbsd0 (>= 0.0), libc6 (>= 2.18), libcairo2 (>= 1.2.4), libcamera0 (>= 0~git20220628+27cc0a6b), libgcc-s1 (>= 4.2), libglib2.0-0 (>= 2.65.1), libgtk-3-0 (>= 3.16.2), libstdc++6 (>= 5.2), libtiff5 (>= 4.0.3), libzbar0 (>= 0.10), libraw-bin, v4l-utils
Recommends: dcraw, graphicsmagick-imagemagick-compat | imagemagick, libimage-exiftool-perl
Breaks: linux-image-librem5 (<< 5.16.18pureos2)
Conffiles:
 /etc/sudoers.d/10_millipixels b83a20ec39545ea0568976cfa5be0037
Description: GTK3 camera app for mobile using the V4L2 media request API
 Millipixels is a GTK3 camera application that knows how to deal with the V4L2
 media request API.
Homepage: https://source.puri.sm/Librem5/megapixels/
root@pureos:/usr/local/bin#

I then did apt remove millipixels, which said it removed it but… …it still launched.
I then did ‘which millipixels’ and found it at /usr/loca/bin I renamed it to millipixels_old
Now it doesn’t launch.
I then did ‘apt install millipixels’ and my camera ap is back with what looks like manual controls and no video record options. It is working fine. I will continue to try and reproduce my issue and report back.

Thanks for testing.

I’m guessing you somehow installed millipixels (from source?) into /usr/local/bin. I normally recommend installing into a prefix in the home directory instead, where it’s harder to mess up the entire OS.

2 Likes

I did install from source and I don’t really know what I am doing so who knows what mess I may have made. Thanks for your help.

3 Likes

If you want to just test it out, there’s an option to download a .deb package on the page where you found the source. This is true for (approximately) all our projects and all our merge requests.

1 Like

Its happening again.

purism@pureos:~$ sudo dmesg | tail
[sudo] password for purism: 
[47310.857047] bq25890-charger 3-006a: Disabling OTG_EN pin
[47311.010036] bq25890-charger 3-006a: Upstream supply changed: 0.
[47311.010455] bq25890-charger 3-006a: Disabling OTG_EN pin
[47328.869373] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[47524.083497] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[47740.925205] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[47769.228447] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[48587.467186] cma: cma_alloc: reserved: alloc failed, req-size: 3206 pages, ret: -12
[48587.475604] csi: consider increasing the CMA area
[48587.475632] imx7-csi 30b80000.csi: pipeline start failed with -12

1 Like

Okay, thanks. This looks like the same problem as here: https://source.puri.sm/Librem5/millipixels/-/issues/65

Do you have other programs running in the background? Did you use some heavy program and close it before starting the camera?

Meanwhile, I’ll prepare a kernel patch where this should work more reliably.

2 Likes

Nothing out of the ordinary running I can think of. The phone gives notifications from text messages, calls, Geary, Nheko. I have a script watching for new messages in Nheko. I have used firefox, VLC, Feeds and ??.

My script watching for messages from Nheko can be found here but I don’t think its anything important.


2/3 down, the code sniplet.

How long is it usually from the time you write a kernel patch until I may see it on my phone? How can I monitor for when this patch gets applied to my device?

It’ll take a couple weeks. The patch I intend to submit will change the output of dmesg, by increasing from the 320MiB:

purism@pureos:~$ sudo dmesg | grep cma
[    0.000000] cma: Reserved 320 MiB at 0x00000000e4800000
3 Likes

@dcz

Is this patch submitted and released in the PureOS kernel yet? I am still having the following error with millipixels version 0.21.0-1+librem5ci82490.d911e89:

mar 22 15:19:06 pureos sm.puri.Phosh.desktop[66589]: MPCamera: VIDIOC_STREAMON error 12, Cannot allocate memory
mar 22 15:19:06 pureos sm.puri.Phosh.desktop[66589]: MPCamera: VIDIOC_DQBUF error 22, Invalid argument

I am on the following kernel:
Linux 6.1.0-1-librem5

No, it’s not. It’s beginning to look like it’s not the right solution. See the discussion here: https://source.puri.sm/Librem5/linux/-/merge_requests/671

Ok, so still bugchasing then. I just tried the pkill Xwayland and after that restarting millipixels. Still couldn’t take a picture.

Thanks, that is an important clue. Do you want to help testing with a debugging kernel?

Sure, just tell me how :slight_smile:

Install the kernel from this merge request:

Then use the monitor from https://source.puri.sm/Librem5/linux/-/merge_requests/671#note_231187 and collect the memory data.

Afterwards come with the log from the monitor, and we’ll use the leak finder to identify what might be wrong.