RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

RtpService background camera stops when device is switched off.

Open RedwanSharafatKabir opened this issue 1 year ago • 3 comments

I am using RtpService for camera streaming in Android Kotlin Application. The service was perfect and was working in background even the device is switched off. But now It's not working.

I have a previous issue related this: Issue no. #1369: Title "Camera screen black when turn on device after switch off."

How to solve this issue.

RedwanSharafatKabir avatar Jul 15 '24 07:07 RedwanSharafatKabir

Hello,

I haven't enought info for this case.

Did you test using Screen example and replace ScreenSource to CameraSource? Remember update service permissions here: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/AndroidManifest.xml#L64 You need add camera and microphone like:

        android:foregroundServiceType="mediaProjection|camera|microphone"

If the problem persists check the service status (if the service die when you lock device). Check if you can recover camera after unlock device again or other any test to debug the case.

pedroSG94 avatar Jul 15 '24 08:07 pedroSG94

Hello,

I haven't enought info for this case.

Did you test using Screen example and replace ScreenSource to CameraSource? Remember update service permissions here: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/AndroidManifest.xml#L64 You need add camera and microphone like:

        android:foregroundServiceType="mediaProjection|camera|microphone"

If the problem persists check the service status (if the service die when you lock device). Check if you can recover camera after unlock device again or other any test to debug the case.

I am using for camera. Already added this code in Manifest.

  <service android:name=".utils.servicesBackgroundForeground.RtpService"
        android:foregroundServiceType="camera|microphone" />
        

Still not working.

RedwanSharafatKabir avatar Jul 15 '24 09:07 RedwanSharafatKabir

Did you tried the suggested above to debug your case? This seems a problem in the service side.

If the problem persists check the service status (if the service die when you lock device). Check if you can recover camera after unlock device again or other any test to debug the case.

pedroSG94 avatar Jul 15 '24 09:07 pedroSG94