Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS Mojave Mirroring doesn’t work #6

Closed
kevin-hv opened this issue Aug 4, 2019 · 4 comments
Closed

MacOS Mojave Mirroring doesn’t work #6

kevin-hv opened this issue Aug 4, 2019 · 4 comments

Comments

@kevin-hv
Copy link

kevin-hv commented Aug 4, 2019

Extending the display works, but when I try to mirror it, the screen resolutiom changes on the Mac and there is a black screen on the RPi

@FD-
Copy link
Owner

FD- commented Aug 4, 2019

I'm able to reproduce the problem and have traced it back to the max_dec_frame_buffering injection in the video renderer. I played around with the max_dec_frame_buffering value a bit, and it seems reducing it to 4 works with iOS (portrait and landscape) and mirroring the native monitor and a 1080p external monitor from macOS.

So, please modify line 301 of renderers/video_renderer_rpi.c to:

h->sps->vui.max_dec_frame_buffering = 4;

And let me know if that helps!

If you don't want macOS to change the screen resolution while mirroring the native monitor, change the "Optimise for" monitor setting to "Built-in Retina Display" in the system settings.

Technical background:
The max_dec_frame_buffering injection is used to reduce video pipeline latency on the Raspberry Pi GPU. The idea is mentioned in a thread on the RPi forums, but since we don't have any control over the stream creation, we have to inject it into the SPS NAL at the receiver end, which is hacky on its own (And I don't really know why only certain values work, while values slightly higher or lower don't). From my testing, the h264 library RPiPlay uses isn't 100% reliable, so that adds another potential error source.

While implementing max_dec_frame_buffering injection, for a while the code for constructing modified_data had a bug that I only noticed when I tested iOS portrait before publishing my code. The currently used max_dec_frame_buffering value 8 was tested with macOS and iOS while that bug was still present.

@FD- FD- added the fix confirmation needed A potential solution has been found, but is yet to be confirmed by the issue reporter label Aug 4, 2019
@FD-
Copy link
Owner

FD- commented Aug 4, 2019

@kevin-hv Can you confirm the fix?

@kevin-hv
Copy link
Author

kevin-hv commented Aug 4, 2019

Just Building it, sry I wasn’t available.
Commenting asap.

@kevin-hv
Copy link
Author

kevin-hv commented Aug 4, 2019

Now the mirroring works, thank you for the quick fix.

@kevin-hv kevin-hv closed this as completed Aug 4, 2019
FD- added a commit that referenced this issue Aug 4, 2019
@FD- FD- removed the fix confirmation needed A potential solution has been found, but is yet to be confirmed by the issue reporter label Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants