Black screen while using screen share in android 11 with JitsiMeetView

Hello everyone,

Using JitsiMeetView (No Activity), in android 11, when I share screen, it is shared, but it is a black screen. In versions up to 9 it works perfectly for me.

I read that it could be because of permissions to the JitsiMeetOngoingConferenceService, so in the manifest I have the following.


uses-permission android:name=“android.permission.FOREGROUND_SERVICE”

service
android:name=“org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService”
android:foregroundServiceType=“mediaProjection”

But being the service started by the library, I don’t know if I have to define it like this, in the manifest of the app.

Any clue where to look?

Regards,

What do you see in adb logcat?

Hi,
when I click on share screen, a security warning pops up, then I click start, and the logcat shows this.

2022-08-10 17:58:12.957 7494-7494/net.jitsi.sdktest D/SensorManager: registerListener :: 1, accelerometer_icm42607, 200000, 0,
2022-08-10 17:58:12.959 7494-9894/net.jitsi.sdktest I/org.webrtc.Logging: EglBase14Impl: Using OpenGL ES version 2
2022-08-10 17:58:12.973 7494-7494/net.jitsi.sdktest D/com.oney.WebRTCModule.WebRTCModule: MediaStream id: cd28a017-0568-4a81-9f6b-47a37fd11176
2022-08-10 17:58:12.973 7494-7494/net.jitsi.sdktest I/System.out: jitsi:Se produce Activity result con requestcode=10457 resultCode=-1 data=Intent { (has extras) }
2022-08-10 17:58:12.974 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: stopped(false) old=false
2022-08-10 17:58:12.975 7494-7494/net.jitsi.sdktest I/System.out: jitsi: onResume
2022-08-10 17:58:12.984 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388698864]
2022-08-10 17:58:12.984 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388698864]
2022-08-10 17:58:12.984 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388390640]
2022-08-10 17:58:12.984 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388390640]
2022-08-10 17:58:12.984 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: [modules/RTC/JitsiLocalTrack.js] Setting new MSID: 2b398818-99a8-e4f8-d09e-694b6eb8a9d8 2ade5fe4-f465-4b87-97f5-4a8bdfd0ebf3 on LocalTrack[undefined,video]
2022-08-10 17:58:12.985 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: [JitsiMeetJS.js] MediaStreamTrack contentHint attribute not supported
2022-08-10 17:58:12.985 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [JitsiConference.js] _doReplaceTrack - no P2P JingleSession
2022-08-10 17:58:12.995 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388357488]
2022-08-10 17:58:12.995 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388357488]
2022-08-10 17:58:12.995 7494-7494/net.jitsi.sdktest I/SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/@0x2466b9c / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1836 android.view.ViewRootImpl.relayoutWindow:9132 android.view.ViewRootImpl.performTraversals:3422 android.view.ViewRootImpl.doTraversal:2671 android.view.ViewRootImpl$TraversalRunnable.run:10094 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
2022-08-10 17:58:12.997 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/TraceablePeerConnection.js] TPC[id=4,type=JVB] Clearing primary video SSRC!
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622389067344]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622389067344]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388749376]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388749376]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388915024]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388915024]
2022-08-10 17:58:12.997 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: Relayout returned: old=(0,0,1920,1200) new=(0,0,1920,1200) req=(1920,1200)0 dur=7 res=0x1 s={true -5476376617557156224} ch=false fn=1469
2022-08-10 17:58:12.998 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@32847 sc = Surface(name=Bounds for - net.jitsi.sdktest/net.jitsi.sdktest.MainActivity@0)/@0x587f874 frame = 1469
2022-08-10 17:58:13.000 7494-8387/net.jitsi.sdktest I/ReactNativeJS: Halt: There are no SSRC groups in the remote description.
2022-08-10 17:58:13.003 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: mAttachInfo.mThreadedRenderer.draw, mView = DecorView@3a7e75a[MainActivity] w = 1920 h = 1200
2022-08-10 17:58:13.006 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2022-08-10 17:58:13.006 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/TraceablePeerConnection.js] TPC[id=4,type=JVB] adding LocalTrack[14,video]
2022-08-10 17:58:13.006 7494-7494/net.jitsi.sdktest D/InputMethodManager: prepareNavigationBarInfo() DecorView@3a7e75a[MainActivity]
2022-08-10 17:58:13.006 7494-7494/net.jitsi.sdktest D/InputMethodManager: getNavigationBarColor() -855310
2022-08-10 17:58:13.010 7494-7494/net.jitsi.sdktest D/InputMethodManager: prepareNavigationBarInfo() DecorView@3a7e75a[MainActivity]
2022-08-10 17:58:13.010 7494-7494/net.jitsi.sdktest D/InputMethodManager: getNavigationBarColor() -855310
2022-08-10 17:58:13.010 7494-7494/net.jitsi.sdktest V/InputMethodManager: Starting input: tba=net.jitsi.sdktest ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : false , NavTrans : false
2022-08-10 17:58:13.010 7494-7494/net.jitsi.sdktest D/InputMethodManager: startInputInner - Id : 0
2022-08-10 17:58:13.010 7494-7494/net.jitsi.sdktest I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2022-08-10 17:58:13.012 7494-7494/net.jitsi.sdktest D/InputTransport: Input channel constructed: ‘ClientS’, fd=190
2022-08-10 17:58:13.012 7494-7494/net.jitsi.sdktest D/InputTransport: Input channel destroyed: ‘ClientS’, fd=223
2022-08-10 17:58:13.031 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388390640]
2022-08-10 17:58:13.031 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388390640]
2022-08-10 17:58:13.031 7494-7494/net.jitsi.sdktest I/SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/@0x2466b9c / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1836 android.view.ViewRootImpl.relayoutWindow:9132 android.view.ViewRootImpl.performTraversals:3422 android.view.ViewRootImpl.doTraversal:2671 android.view.ViewRootImpl$TraversalRunnable.run:10094 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388698864]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388698864]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388557072]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388557072]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388357488]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388357488]
2022-08-10 17:58:13.032 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: Relayout returned: old=(0,0,1920,1200) new=(0,0,1920,1200) req=(1920,1200)0 dur=4 res=0x1 s={true -5476376617557156224} ch=false fn=1471
2022-08-10 17:58:13.054 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/xmpp/JingleSessionPC.js] JingleSessionPC[session=JVB,initiator=false,sid=f6fq27aifssur] Sending source-add for video ssrcs=3183151809,4277389051
2022-08-10 17:58:13.063 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/xmpp/JingleSessionPC.js] JingleSessionPC[session=JVB,initiator=false,sid=f6fq27aifssur] Replace track done!
2022-08-10 17:58:13.063 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/BridgeChannel.js] Sending SourceVideoTypeMessage with video type af7e4d1d-v0: desktop
2022-08-10 17:58:13.063 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [features/base/tracks] Replace video track - unmuted
2022-08-10 17:58:13.075 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: ExternalAPI Sending event: VIDEO_MUTED_CHANGED with data: { NativeMap: {“muted”:0} }
2022-08-10 17:58:13.076 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: JitsiConnectionService updateCall: 3E8F3791-251C-4850-B3E8-840A10765B8E hasVideo: true
2022-08-10 17:58:13.113 7494-7494/net.jitsi.sdktest I/ViewRootImpl@71009ed[MainActivity]: mAttachInfo.mThreadedRenderer.draw, mView = DecorView@3a7e75a[MainActivity] w = 1920 h = 1200
2022-08-10 17:58:13.195 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: ExternalAPI Sending event: SCREEN_SHARE_TOGGLED with data: { NativeMap: {“participantId”:“af7e4d1d”,“sharing”:true} }
2022-08-10 17:58:13.234 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/BridgeChannel.js] SenderSourceConstraints: {“sourceName”:“af7e4d1d-v0”,“maxHeight”:0}
2022-08-10 17:58:13.235 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: [modules/qualitycontrol/SendVideoController.js] Sender constraints for source:af7e4d1d-v0 changed to maxHeight:0
2022-08-10 17:58:13.235 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/xmpp/JingleSessionPC.js] JingleSessionPC[session=JVB,initiator=false,sid=f6fq27aifssur] setSenderVideoConstraint: 0, sourceName: af7e4d1d-v0
2022-08-10 17:58:13.236 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/BridgeChannel.js] SenderSourceConstraints: {“sourceName”:“af7e4d1d-v0”,“maxHeight”:0}
2022-08-10 17:58:13.326 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/RTC/BridgeChannel.js] SenderSourceConstraints: {“sourceName”:“af7e4d1d-v0”,“maxHeight”:2160}
2022-08-10 17:58:13.326 7494-8388/net.jitsi.sdktest D/JitsiMeetSDK: [modules/qualitycontrol/SendVideoController.js] Sender constraints for source:af7e4d1d-v0 changed to maxHeight:2160
2022-08-10 17:58:13.326 7494-8388/net.jitsi.sdktest I/JitsiMeetSDK: [modules/xmpp/JingleSessionPC.js] JingleSessionPC[session=JVB,initiator=false,sid=f6fq27aifssur] setSenderVideoConstraint: 2160, sourceName: af7e4d1d-v0
2022-08-10 17:58:13.345 7494-8548/net.jitsi.sdktest D/InsetsAnimationCtrlImpl: finish: control=android.view.InsetsAnimationControlImpl@989c84a, types=2, mCancelled=false, mCancelRequested=false
2022-08-10 17:58:13.346 7494-8548/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject s[-5476376622388730672]
2022-08-10 17:58:13.346 7494-8548/net.jitsi.sdktest I/SurfaceControl: nativeRelease nativeObject e[-5476376622388730672]

I don’t see any errors there :-/

Yep, me neither…

actually screen sharing works, at least it doesn’t give error, but it’s sending a black screen, instead of the screen…

The same code works fine in android 9 and below…

I’ve tried with sdk 6 and 5.1.

It’s something similar to what was happening to you in this thread…

But you are using JitsiMeetOngoingConferenceService aren’t you? Just to check if it’s an error in the activity wiring, can you try to use JitsiMeetActivity to see if that works ok?

ok, good idea…

I have compiled the jitsiSDKTest, exactly as it comes, and the same thing happens, I can access the videoconference room with the camera and the video, but when I give it to share screen, I get the warnin popup, I give it start, but the same thing happens, it doesn’t send anything to the remote.

the tablet is Samsung Galaxy tab A8 with android 11

@Titus-Andrei_Moldova can you PTAL?

Yep,

As you insisted, against Chrome it still didn’t work, but I tried against an iphone and another tablet and it worked… with jitsimeetActivity, but with jitsimeetview it still didn’t work…

I’m going to try with a lenovo tablet with android 10 from a colleague, in a little while.

The same, in a Lenovo HD10, with android 10, the same thing happens, ruled out hardware issue, it has to be some permission of the JitsiMeetOngoingConferenceService service, which is in the library, but I do not know what else to do to give permission than what I have in the manifest…

Are you on the same LAN? I’m wondering if it’s bandwidth related :thinking:

Hello,

I don’t think so, it works fine on another tablet with android 9, in the same conditions…

Let’s see if someone who is using JitsiMeetView on android 11 and is getting screen sharing working correctly, can give me a hint, if he did something apart?