jitsi / jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
https://jitsi.org/meet
Apache License 2.0
22.13k stars 6.59k forks source link

jitsimeet ipad camera rotation #14111

Open ysbutuner opened 7 months ago

ysbutuner commented 7 months ago

In jitsi meet iPad devices, the camera image does not rotate on its own screen in horizontal and vertical orientation, but it is displayed correctly to the participants on the opposite side.

saghul commented 7 months ago

Can you share a screenshot of the problem?

ysbutuner commented 7 months ago

jitsi

Of course, the device is standing vertically and I show my hand straight, but in my own camera view, it shows it as horizontal.

Important Note: It is not the case that the device does not detect horizontal and vertical rotation on the table, it is like this when I hold it vertically in my hand.

You can experience it by trying it on iPads in the current version.

saghul commented 7 months ago

Ah got it. This is a known issue with ipads. We are working to solve it. IN the meantime rotating the device twice should reset it.

ysbutuner commented 7 months ago

I understand, can you let me know when you solve it? I constantly encounter this bug.

thank you for your attention

saghul commented 7 months ago

Don't hold your breadth, it requires patching WebRTC and I tried once but the patch got rejected so I'll need to take another look.

ysbutuner commented 7 months ago

I understand, could you share with me the change you made in WEBRTC, I would like to add the change and see if the problem is solved.

ysbutuner commented 7 months ago

Can you provide support on this matter? @saghul

saghul commented 7 months ago

I don't have the patch link handy, but even if I did it would require that you make your own WebRTC build. Are you ready to do that?

ysbutuner commented 7 months ago

Yes, I am ready, but I could not find the source of the problem in the code, I can do it if you support me.

saghul commented 7 months ago

I'll find the link.

ysbutuner commented 7 months ago

Thank you, I'm waiting for your return

saghul commented 7 months ago

This is the CL: https://webrtc-review.googlesource.com/c/src/+/311420

ysbutuner commented 7 months ago

I will thank you for your interest, I will work on this issue and keep you informed.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lesinigo commented 5 months ago

We've been hitten by the same bug developing a custom iPad application that uses the Jitsi SDK.

@saghul thanks for the work on this issue on WebRTC's side. Afaict in the SDK you're actually using a build of WebRTC from your own mirror and with additional patches on top of the upstream version: would you consider to add your proposed WebRTC patch to your mirror's branch?

If that can't work out: is there an older, known good version of the Jitsi SDK that's not affected by this bug (possibly because it's using an older WebRTC build) ? By reading all the material here and on the WebRTC side I sill cannot pinpoint where the defect had initially appeared.

saghul commented 5 months ago

Our build does not include the patch. I need to revisit the approach since it wasn't accepted upstream.

AFAIK there is no version of WebRTC without this bug.

lesinigo commented 5 months ago

We took a look at it but we really aren't familiar with the tools used by the jitsi/webrtc build script.

Could you build and upload the WebRTC.xcframework.zip of the patched version somewhere? That would enable us to fork jitsi/jitsi-meet-ios-sdk-releases, point it at the patched WebRTC, build our app and report feedback on how it behaves... maybe that could be useful for reporting to upstream too, I see they asked for unit tests and are not moving forward from that.

saghul commented 5 months ago

Sorry I can't, it takes time and alas I don't have it now.

In terms of feedback, it did work for me, what's missing is to give it another try and see if the reviewer was right and a new approach is necessary. That is not something that testing as an end user will yield.

lesinigo commented 3 weeks ago

In the past months I had the pleasure to get to know how to recompile WebRTC.xcframework.zip and even automated it in our internal CI. This allowed us to rapidly iterate over the proposed patch and some variants thereof, but none have had any effect on the camera rotation bug, it only made it even worse.

As far as we can tell other people connected to the same room never see any camera rotation problem, the wrong orientation seems to affect only the screen of the device that's the source of the video stream. In other words, I see myself rotated but everyone else is seeing me correctly and I see everyone else correctly.

(EDIT: at least this is the behavior we observed using two different iPad models, but it seems that this bug manifests itself differently on different hardware SKUs so our sample could just be too small and there could be some different behavior that I'm not aware of)

When trying to hardcode a fixed UIDeviceOrientation* value in the patch (instead of actually reacting to different device orientations) we got the effect of having connected people seeing me rotated, while not fixing the bug of me seeing myself rotated. Additionally, when taking an actual screenshot it comes out correct, we had to photograph the iPad using another smartphone to get pictures of the defect.

This leads us to suspect that the bug lies in the code path between the camera and the display (some kind of hardware acceleration stuff that's not involved at screenshot time?), not between the camera and the network (because other people always see me correctly). I don't know if this means that it's on WebRTC side or on Jitsi Meet iPad app's UI side, but I can relate that to the WebRTC maintainer question of having some further test cases before considering the patch.

I'm trying to contact some involved parties directly (including 8x8 Inc) to try and find out if someone is willing to take ownership of this issue and fix it once and for all.