Problem with camera on Android with Samsung tablets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with camera on Android with Samsung tablets

Michael Goffioul
Hi,

I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.

Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:

    linphoneCall.enableCamera(true);
    CallParams params = mLinphoneCore.createCallParams(linphoneCall);
    params.enableVideo(true);
    linphoneCall.update(params);

The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:

    mLinphoneCore.setNativeVideoWindowId(remoteSurface);
    mLinphoneCore.setNativePreviewWindowId(localSsurface);

AFAIK AndroidPlatformHelper can deal with raw surfaces provided.

This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.

I can provide full logs, if it helps. Any idea or suggestion would be welcome.

Michael.


_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:

For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.

Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.

With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:

Could any linphone dev comment on the above?

Thanks,
Michael.


On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,

I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.

Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:

    linphoneCall.enableCamera(true);
    CallParams params = mLinphoneCore.createCallParams(linphoneCall);
    params.enableVideo(true);
    linphoneCall.update(params);

The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:

    mLinphoneCore.setNativeVideoWindowId(remoteSurface);
    mLinphoneCore.setNativePreviewWindowId(localSsurface);

AFAIK AndroidPlatformHelper can deal with raw surfaces provided.

This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.

I can provide full logs, if it helps. Any idea or suggestion would be welcome.

Michael.


_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

camera-preview-from-surface.diff (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.

So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.

Thanks,
Michael.


On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:

For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.

Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.

With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:

Could any linphone dev comment on the above?

Thanks,
Michael.


On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,

I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.

Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:

    linphoneCall.enableCamera(true);
    CallParams params = mLinphoneCore.createCallParams(linphoneCall);
    params.enableVideo(true);
    linphoneCall.update(params);

The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:

    mLinphoneCore.setNativeVideoWindowId(remoteSurface);
    mLinphoneCore.setNativePreviewWindowId(localSsurface);

AFAIK AndroidPlatformHelper can deal with raw surfaces provided.

This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.

I can provide full logs, if it helps. Any idea or suggestion would be welcome.

Michael.


_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.

So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.

Thanks,
Michael.


On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:

For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.

Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.

With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:

Could any linphone dev comment on the above?

Thanks,
Michael.


On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,

I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.

Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:

    linphoneCall.enableCamera(true);
    CallParams params = mLinphoneCore.createCallParams(linphoneCall);
    params.enableVideo(true);
    linphoneCall.update(params);

The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:

    mLinphoneCore.setNativeVideoWindowId(remoteSurface);
    mLinphoneCore.setNativePreviewWindowId(localSsurface);

AFAIK AndroidPlatformHelper can deal with raw surfaces provided.

This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.

I can provide full logs, if it helps. Any idea or suggestion would be welcome.

Michael.


_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
Hi Sylvain,

Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?

Michael.


On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.

So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.

Thanks,
Michael.


On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:

For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.

Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.

With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:

Could any linphone dev comment on the above?

Thanks,
Michael.


On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,

I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.

Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:

    linphoneCall.enableCamera(true);
    CallParams params = mLinphoneCore.createCallParams(linphoneCall);
    params.enableVideo(true);
    linphoneCall.update(params);

The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:

    mLinphoneCore.setNativeVideoWindowId(remoteSurface);
    mLinphoneCore.setNativePreviewWindowId(localSsurface);

AFAIK AndroidPlatformHelper can deal with raw surfaces provided.

This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.

I can provide full logs, if it helps. Any idea or suggestion would be welcome.

Michael.


_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?

//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON

Anything else that needs to be done?


On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers




_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
As a side note, there was also this warning in the logs:

04-17 10:02:00.459  4201  4201 W linker  : Warning: "/data/app/com.example.linphone-E82xyFWo76vtWH5vstBpBw==/lib/arm/libmsandroidcamera2.so" has no DT_SONAME (will use libmsandroidcamera2.so instead) and will not work when the app moves to API level 23 or later (https://android.googlesource.com/platform/bionic/+/master/missing-soname-enforced-for-api-level-23) (allowing for now because this app's target API level is still 19)

I'm using NDK 21.0.6113669


On Fri, Apr 17, 2020 at 10:17 AM Michael Goffioul <[hidden email]> wrote:
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini
In reply to this post by Michael Goffioul

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
Indeed, that's what the proposed patch is about.


On Fri, Apr 17, 2020 at 11:32 AM Sylvain Berfini <[hidden email]> wrote:

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini

That's not what I meant.

My point is the Android API doesn't support Surface objects for Camera1 API, so I can't do anything about that in our SDK.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:35, Michael Goffioul a écrit :
Indeed, that's what the proposed patch is about.


On Fri, Apr 17, 2020 at 11:32 AM Sylvain Berfini <[hidden email]> wrote:

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
Ping?

I'm reposting to the mailing list, I didn't realize the last exchange was not going through it.
I'm also including an updated patch that removes the unnecessary part. This provides support for Surface and camera1 API.

Thanks,
Michael.


On Sun, Apr 19, 2020 at 2:47 PM Michael Goffioul <[hidden email]> wrote:
Is there a chance to see the proposed patch integrated? It's just to know how I need to plan my dev work.
Thanks.

On Fri, Apr 17, 2020 at 11:47 AM Michael Goffioul <[hidden email]> wrote:
The one I sent here: https://lists.nongnu.org/archive/html/linphone-developers/2020-04/msg00082.html
Only the first part, for AndroidVideoApi5JniWrapper.java. As mentioned in a subsequent mail, the second part was just a ugly hack, which wasn't needed in the end.

On Fri, Apr 17, 2020 at 11:45 AM Sylvain Berfini <[hidden email]> wrote:

What patch are you talking about?

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:43, Michael Goffioul a écrit :
Technically, yes you can. You could accept the patch. This is a simple workaround that will work from Android Eclair to (at least) Android 10.


On Fri, Apr 17, 2020 at 11:36 AM Sylvain Berfini <[hidden email]> wrote:

That's not what I meant.

My point is the Android API doesn't support Surface objects for Camera1 API, so I can't do anything about that in our SDK.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:35, Michael Goffioul a écrit :
Indeed, that's what the proposed patch is about.


On Fri, Apr 17, 2020 at 11:32 AM Sylvain Berfini <[hidden email]> wrote:

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

camera-preview-from-surface.diff (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Sylvain Berfini

Hi,

Sorry for the delay. I'm ok to merge your patch. Did you signed the contributor agreement ?

Cheers,

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 25/04/2020 à 00:14, Michael Goffioul a écrit :
Ping?

I'm reposting to the mailing list, I didn't realize the last exchange was not going through it.
I'm also including an updated patch that removes the unnecessary part. This provides support for Surface and camera1 API.

Thanks,
Michael.


On Sun, Apr 19, 2020 at 2:47 PM Michael Goffioul <[hidden email]> wrote:
Is there a chance to see the proposed patch integrated? It's just to know how I need to plan my dev work.
Thanks.

On Fri, Apr 17, 2020 at 11:47 AM Michael Goffioul <[hidden email]> wrote:
The one I sent here: https://lists.nongnu.org/archive/html/linphone-developers/2020-04/msg00082.html
Only the first part, for AndroidVideoApi5JniWrapper.java. As mentioned in a subsequent mail, the second part was just a ugly hack, which wasn't needed in the end.

On Fri, Apr 17, 2020 at 11:45 AM Sylvain Berfini <[hidden email]> wrote:

What patch are you talking about?

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:43, Michael Goffioul a écrit :
Technically, yes you can. You could accept the patch. This is a simple workaround that will work from Android Eclair to (at least) Android 10.


On Fri, Apr 17, 2020 at 11:36 AM Sylvain Berfini <[hidden email]> wrote:

That's not what I meant.

My point is the Android API doesn't support Surface objects for Camera1 API, so I can't do anything about that in our SDK.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:35, Michael Goffioul a écrit :
Indeed, that's what the proposed patch is about.


On Fri, Apr 17, 2020 at 11:32 AM Sylvain Berfini <[hidden email]> wrote:

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Reply | Threaded
Open this post in threaded view
|

Re: Problem with camera on Android with Samsung tablets

Michael Goffioul
I just did. Thanks.


On Mon, Apr 27, 2020 at 11:29 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

Sorry for the delay. I'm ok to merge your patch. Did you signed the contributor agreement ?

Cheers,

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 25/04/2020 à 00:14, Michael Goffioul a écrit :
Ping?

I'm reposting to the mailing list, I didn't realize the last exchange was not going through it.
I'm also including an updated patch that removes the unnecessary part. This provides support for Surface and camera1 API.

Thanks,
Michael.


On Sun, Apr 19, 2020 at 2:47 PM Michael Goffioul <[hidden email]> wrote:
Is there a chance to see the proposed patch integrated? It's just to know how I need to plan my dev work.
Thanks.

On Fri, Apr 17, 2020 at 11:47 AM Michael Goffioul <[hidden email]> wrote:
The one I sent here: https://lists.nongnu.org/archive/html/linphone-developers/2020-04/msg00082.html
Only the first part, for AndroidVideoApi5JniWrapper.java. As mentioned in a subsequent mail, the second part was just a ugly hack, which wasn't needed in the end.

On Fri, Apr 17, 2020 at 11:45 AM Sylvain Berfini <[hidden email]> wrote:

What patch are you talking about?

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:43, Michael Goffioul a écrit :
Technically, yes you can. You could accept the patch. This is a simple workaround that will work from Android Eclair to (at least) Android 10.


On Fri, Apr 17, 2020 at 11:36 AM Sylvain Berfini <[hidden email]> wrote:

That's not what I meant.

My point is the Android API doesn't support Surface objects for Camera1 API, so I can't do anything about that in our SDK.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:35, Michael Goffioul a écrit :
Indeed, that's what the proposed patch is about.


On Fri, Apr 17, 2020 at 11:32 AM Sylvain Berfini <[hidden email]> wrote:

Actually Camera1 API has been deprecated for a while and it doesn't support Surface objects, only SurfaceHolder or SurfaceTexture.

Up to you to get one of those objects instead of a Surface.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 17:20, Michael Goffioul a écrit :
No, it's not compatible with Camera2 API. Hence it'd be nice to have a solution for Camera1 API. There are still many devices out there that do not support Camera2 API.


On Fri, Apr 17, 2020 at 11:12 AM Sylvain Berfini <[hidden email]> wrote:

Try rebooting your device.

If the issue persists, it means the camera on your tablet isn't compatible with Camera2 API, even if it's not that old.

Sylvain Berfini
Software Engineer @ Belledonne Communications
Le 17/04/2020 à 16:17, Michael Goffioul a écrit :
Well, this probably explains it:

04-17 10:02:00.460  4201  4201 I LinphonePhoneService: [Camera2 Capture] libmsandroidcamera2 plugin loaded
04-17 10:02:00.461  4201  4201 I LinphonePhoneService: [Camera2 Capture] Detecting cameras
04-17 10:02:00.466  4201  4201 W LinphonePhoneService: [Camera2 Capture] No camera detected !

And indeed 'dumpsys media.camera' only reports legacy cameras.

This is a Samsung TabA 2018 (WiFi) running Android-8.1, so it's not really old hardware or outdated yet.


On Fri, Apr 17, 2020 at 8:49 AM <[hidden email]> wrote:
Yes that should be enough.
Check your logs when the Core starts to see if there isn't an error.

17 avril 2020 14:39 "Michael Goffioul" <[hidden email]> a écrit:
My CMakeCache.txt contains the following, so I guess it's already enabled in the SDK, right?
//Android capture filter using Camera2 API for Android 8+
ENABLE_CAMERA2:BOOL=ON
Anything else that needs to be done?
On Fri, Apr 17, 2020 at 8:13 AM <[hidden email]> wrote:
Hi,

Simply add -DENABLE_CAMERA2=ON to the cmake arguments when you build the SDK.

Cheers,

17 avril 2020 14:06 "Michael Goffioul" <[hidden email]> a écrit:
Hi Sylvain,
Thanks for your answer. Could you point me to some documentation about how to activate the Camera2 filter implementation?
Michael.
On Fri, Apr 17, 2020 at 5:13 AM Sylvain Berfini <[hidden email]> wrote:

Hi,

You are using the legacy capture filter. We recommend you to switch to Camera2 capture filter implementation that does support what you need.

Cheers,

Sylvain Berfini Software Engineer @ Belledonne Communications
Le 16/04/2020 à 23:33, Michael Goffioul a écrit :
After further investigation, it appears the MSAndroidTextureDisplay filter was installed because my code was using Core.usePreviewWindow(true). It's kinda confusing that you need to provide 2 separate surfaces for local/remote videos, but usePreviewWindow is false. I suppose usePreviewWindow is mostly useful on non-Android platforms.
So in the end, the only thing needed was a way to handle a raw Surface object in AndroidVideoApi5JniWrapper.setPreviewDisplaySurface(). Is there a chance such change will make its way upstream? If course, if there's a better way to do this, I'm all ears.
Thanks,
Michael.
On Thu, Apr 16, 2020 at 5:01 PM Michael Goffioul <[hidden email]> wrote:
it turns out the reason the webcam is not started on the Samsung tablets is because Camera.setPreviewDisplay()/Camera.setPreviewTexture() is never called. Indeed, the case of providing a Surface object is not covered by this code:
For the Android-x86 device, having a preview surface is not a requirement, but for the Samsung tablets, it's a no-go.
Given that Camera.setPreviewDisplay(surfaceHolder) is just the same as Camera.setPreviewSurface(surfaceHolder.getSurface()), but the latter is hidden API, I worked around the issue with the attached patch, which implements a trivial SurfaceHolder just for the sake of going through the Camera API.
With this change, the Samsung tablet webcam started to work. However, I noticed a huge amount of EGL errors generated (on the Android-x86 device). After tracing the code, I realized that there seemed to be 2 components trying to draw on the same Surface object:
- the Camera preview
- the MSAndroidTextureDisplay filter
Honestly, I don't know why this is happening. It doesn't make sense to have the MSAndroidTextureDisplay filter trying to draw on the Surface, as the Camera API will take care of that. As a temporary ugly hack, I came up with the second part of the patch, which disable the filter for the webcam stream. It's unlikely to be the right solution, in particular this piece of code makes me think there shouldn't be a MSAndroidTextureDisplay filter installed:
Could any linphone dev comment on the above?
Thanks,
Michael.
On Wed, Apr 15, 2020 at 1:53 PM Michael Goffioul <[hidden email]> wrote:
Hi,
I'm using linphone-android SDK (org.linphone:linphone-sdk-android:4.3+) to build an audio/video SIP app, and I'm having problems with the webcam feed on Samsung tablets.
Linphone is used in an Android service. A client application binds to the service and interact with it through Android IPC. When the call is initially connected, video is disabled, and no native WindowId has been set yet. When the clients request to turn on video, the service executes the following:
linphoneCall.enableCamera(true);
CallParams params = mLinphoneCore.createCallParams(linphoneCall);
params.enableVideo(true);
linphoneCall.update(params);
The service then notifies the client (through IPC) that video is now active. The client creates 2 SurfaceView, and provides the underlying Surface objects to the service (again through IPC, Surface is parcelable). When the service receives the Surface objects, it executes:
mLinphoneCore.setNativeVideoWindowId(remoteSurface);
mLinphoneCore.setNativePreviewWindowId(localSsurface);
AFAIK AndroidPlatformHelper can deal with raw surfaces provided.
This constructs works fine on an Intel device running Android-x86 (webcam is started, displayed locally and sent to remote party). But it doesn't work on 2 Samsung tablets I have: TabE/Android-7.1.1 and TabA/Android-8.1. I can see in the logs that the camera is initialized, but no preview starts and no data is sent to remote party.
I can provide full logs, if it helps. Any idea or suggestion would be welcome.
Michael.
_______________________________________________ Linphone-developers mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/linphone-developers



_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers

_______________________________________________
Linphone-developers mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/linphone-developers