GrapheneOS / Camera

Modern camera app focused on privacy and security with QR & barcode scanning.
https://grapheneos.org/
MIT License
826 stars 87 forks source link

Unable to save video when locked #381

Closed hephaisto closed 7 months ago

hephaisto commented 10 months ago

When my device is locked, I can double-press the power button to get to the camera and switch to video. I can start and stop video and it is saved properly on the device. However, when I instead start recording the video and press the power button again to switch off the screen, I get "Unable to save this video: Error code 4" when I switch it back on. The complete video is lost, even the part before pressing the power button.

Device: Pixel 4

See also: https://discuss.grapheneos.org/d/7728-unable-to-save-video-when-locked

hephaisto commented 7 months ago

The issue still persists on app.grapheneos.camera 64 TP1A.221005.002.B2.2023122200

Just the error message has changed to the new text.

empratyush commented 7 months ago

@hephaisto on pixel 4 ?

hephaisto commented 7 months ago

@hephaisto on pixel 4 ?

yes.

hephaisto commented 7 months ago

I have to make a few corrections/additions: Now a video is saved. However, recording is stopped without pressing the record-button. This is the sequence of events and the content of the resulting video file:

So now at least the video until the power button press is saved, which definitely is an improvement over the previous state. A least the first video is not totally lost. Thanks for that fix so far! However, the video recording still aborts when switching off the screen.

I'm not sure if the OS itself is messing with the camera in this situation. If it is impossible for the camera app to keep access to the hardware, the current behavior is probably a "won't fix" for the camera app, and could only be changed in the OS. If that is the case, I'd accept the current state as "solved" and I'll probably file a report there.

empratyush commented 7 months ago

This is the expected behaviour camera can only be used while the app is in the foreground.

thestinger commented 3 days ago

Background recording support via a foreground service would be a new feature. This issue report was closed because it wasn't requesting background recording support but rather was reporting the expected behavior of a normal camera app which stops recording when you switch away from it. That's how the Camera permission works, since it only allows access while in use. Recording without the app being in the foreground requires a foreground service and would be a significantly different way of doing things which shouldn't ever be the default.

hephaisto commented 3 days ago

@thestinger Yes and no. I reported a state A which was buggy. This was changed to state B, which was not buggy but suboptimal to me. It's okay that it doesn't get changed to C. But B is still an improvement over A. The original report wasn't about the app being stopped per se, but being terminated in a way which lost all the data. So this is actually resolved, not "won't fix". At least per the original bug description.

thestinger commented 3 days ago

Well, it does save the data now, but we don't have background recording as an option. Can close it as complete then.

anonfaded commented 2 days ago

well you can use other camera apps that are specifically made with a foreground recording feature.

thestinger commented 1 day ago

It's a feature which could be implemented in this app but it's a separate request from what was requested here.

anonfaded commented 1 day ago

It's a feature which could be implemented in this app but it's a separate request from what was requested here.

Yeah but he can use other alternatives until its officially added to the main camera app, anyways the chat here is very old and he probably isn't even seeing the latest replies.