Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4710

Camera board • Issues with Pi Camera Module 3 with RPI 4B 2GB

$
0
0
**Forum Post: Issues with RPI Camera Module 3 (Wide-Angle)**

Hi everyone,

I’ve been dealing with persistent issues using the RPI Camera Module 3 (Wide-Angle). Initially, the camera worked, but after a few reboots, I have encountered a DMA heap error, and now the RTSP server that I used with MediaMTX is no longer working. This seems to be because the Pi Cam is no longer being registered on the system.

**The Problem**
The camera operated at the start but after a few reboots it just stopped working. For example:
- `libcamera-still` worked at the start and was able to capture an image, but now I get the error `*** no cameras available ***`.
- `mediamtx` RTSP streaming was working perfectly but now the logs of that also indicate that the camera is not available anymore.

---

**Hardware/Software Details**
- RPI 4 Model B (2GB RAM)
- RPI Camera Module 3 (Wide-Angle)
- OS: RPI OS Bullseye (32-bit and 64-bit tested)
- Tools: `libcamera` v0.3.2+, `mediamtx` (v1.10.0)

---

**What I’ve Tried**

1. **Verified Hardware Connections**
- Checked CSI port connections and ribbon cable.

2. **Configured Software**
- Enabled the camera in `raspi-config`. (THIS OPTION DOESNT EXIST as its for the legacy versions)
- Updated `/boot/config.txt` with `dtoverlay=imx708` and increased `cma` memory. (I realised that this was for the legacy version and should not be messed around with, but when I tried it didnt fix the issue.)

3. **Kernel Module**
- Verified `bcm2835-v4l2` module is loaded and added to `/etc/modules`.

4. **Tested libcamera**
- `libcamera-still` logs errors like:
```
ERROR DmaBufAllocator dma_buf_allocator.cpp:116 Could not open any dma-buf provider
```
- `dmesg` reports:
```
Failed to register camera imx708_wide: -12
```

5. **RTSP with MediaMTX**
- Configured `mediamtx` to stream RTSP.
- Initially it streamed to Agent DVR but now we get an error (OPEN_INPUT:Immediate exit requested)

6. **Updates and Reinstalls**
- Fully updated OS and firmware using `sudo apt full-upgrade` and `rpi-update`.
- Reinstalled `libcamera` and tools.

7. **Examined DMA Issues**
- Increased CMA memory in `/boot/config.txt`.
- `dmesg | grep dma` often logs DMA allocation issues.

8. **Tried on Multiple Systems**
- I have not tested this on another Pi because the Pi Cam initially works on this system but eventually stops working.

---

**Current Status**
The camera fails to register reliably. The logs suggest DMA heap or driver compatibility issues, but the root cause remains unclear.

---

**Community Questions**
1. Has anyone experienced similar issues with the Camera Module 3 (Wide-Angle)?
2. Are there troubleshooting steps I missed?
3. Could this be a hardware defect or purely software-related?
4. How can I resolve the DMA heap allocation errors?

---

**Logs for Reference**

Dmesg Output:
```
WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning
ERROR RPI vc4.cpp:216 Failed to register camera imx708_wide: -12
```

dmesg | grep - i camera:
dmesg | grep -i camera
[ 4.810090] imx708 10-001a: camera module ID 0x0302
[ 33.774823] process '/mediamtx-rpicamera-1733333125019997130/mtxrpicam' started with executable stack

pi@raspberrypi:~ $ dmesg | grep -i dma
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] DMA [mem 0x0000000000000000-0x000000003fffffff]
[ 0.000000] DMA32 [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] On node 0, zone DMA32: 19456 pages in unavailable ranges
[ 0.000000] Policy zone: DMA32
[ 0.026961] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[ 0.027245] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.027697] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.070111] bcm2835-dma fe007000.dma-controller: DMA legacy API manager, dmachans=0x1
[ 0.071875] iommu: DMA domain TLB invalidation policy: strict mode
[ 1.638734] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[ 1.703849] mmc0: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[ 4.552110] uart-pl011 fe201000.serial: no DMA platform data


Libcamera Logs:
```
ERROR DmaBufAllocator dma_buf_allocator.cpp:116 Could not open any dma-buf provider
```

pi@raspberrypi:~ $ sudo libcamera-still -o test.jpg
[18:02:50.372665907] [12242] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
Preview window unavailable
ERROR: *** no cameras available ***

pi@raspberrypi:~ $ libcamera-hello --list-cameras
Could not open any dmaHeap device
No cameras available!


NOTE THAT AFTER SOME TROUBLESHOOTING STEPS THE ERROR OF DMA HAS DISAPPEARED AND NOW WE GET NO CAMERA AVAILABLE


---

Thanks for reading—any help is greatly appreciated! Let me know if you’ve encountered similar issues or have solutions!

Statistics: Posted by arsank47 — Thu Dec 05, 2024 11:29 am — Replies 0 — Views 4



Viewing all articles
Browse latest Browse all 4710

Trending Articles