I'm trying to make a script that, for now, simply acceses the camera, takes a screenshot and then shows it. But currently every time the code tries to access the camera, it crashes, giving the error Bus error (Core dumped)
I tried changing library for the usage of the camera, both imageio and opencv, but neither worked. I'm currently using a chromebook with chromeOS, using Linux to use apps and code.
Any ideas on how to fix this?
It seems you are running into this error trying to access invalid memory locations on certain platforms like Chrome OS. A few things to try:
Check if your Python libraries for camera access are compatible with Chrome OS/Chromebooks. There may be something platform specific causing this crash.
Try a simpler test first - use something like OpenCV to just open a video file instead of a live camera stream. See if that works without crashes. Then add back the camera code.
Explicitly set OpenCV to use older camera APIs that are more stable, rather than latest auto-detected APIs:
Try running your Python code completely outside the Linux/Crostini environment - native on Chrome OS. The Linux integration may be factor.
Check if you have properpermissions to access the camera hardware from your Python script.
My suspicion is that Chrome OS + camera access via Python libraries is resulting in something that causes a system level crash. Simplifying the test case and trying different APIs/platforms should help narrow down where things go wrong.