Wayland support - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: GSoC (https://forum.kodi.tv/forumdisplay.php?fid=299) +----- Forum: GSOC 2017 (https://forum.kodi.tv/forumdisplay.php?fid=274) +----- Thread: Wayland support (/showthread.php?tid=309254) Pages:
1
2
|
Wayland support - yol - 2017-03-10 Hi, I've seen that there is a suggested task in the Wiki list about (re)introducing Wayland support into Kodi, which I'm interested in. I've searched around a bit and found the old pull request that was rejected. But it seems that the Kodi Wayland fork of Max Kellermann is still being actively maintained and updated. So, for GSoC, what exactly should be done? Is it expected to grab Max' code and try to get it merged (with modifications if necessary)? If so, this would be very difficult to propose as a project without knowing exactly what kinds of problems the Kodi team sees with the current state of the code - which is probably quite different from back when the Wayland support was removed from the main repository. Or are there substantial problems with the current solution that require a complete rewrite from scratch? RE: Wayland support - RockerC - 2017-03-10 I read that Wayland was mainly removed because the developer maintaining quit maintenence on the code, but I now however suspect that it also did not fit with the work on the new agile VideoPlayer development: http://forum.kodi.tv/showthread.php?tid=237686 http://forum.kodi.tv/forumdisplay.php?fid=240 So if you have time right now then you could just try to merge the Wayland code into FernetMenta's "kodi-agile" fork of Kodi to see if it will even fit with all the reworked code changes for Kodi already in there: https://github.com/FernetMenta/kodi-agile/ Another tip is to checkout all the merged pull requests and the long dicussions in them about Wayland (and Mir windowing system too) in older pull requests before they was merged: https://github.com/xbmc/xbmc/pull/10898 https://github.com/xbmc/xbmc/pull/11040 https://github.com/xbmc/xbmc/pull/2978 https://github.com/xbmc/xbmc/pull/3001 https://github.com/xbmc/xbmc/pull/8980 In addition to that I suggest that you and all students head some of the general GSoC submission advice given here as well: http://forum.kodi.tv/showthread.php?tid=309218&pid=2545338#pid2545338 (2017-03-10, 11:24)RockerC Wrote: other than compiling Kodi and looking at the code, you and other students should really checkout all the accepted proposals from previous years of GSoC: RE: Wayland support - FernetMenta - 2017-03-11 (2017-03-10, 10:14)yolk Wrote: Hi, Hi, thanks for showing interest. New Wayland support should be implemented the same way like X11 or Mir. Mir support is relatively new can can be taken as a good example of how it should be. In Kodi's context Wayland is a platform or windowing systems. Check out X11, Windows, or Mir folders under xmbc/windowing: https://github.com/xbmc/xbmc/tree/master/xbmc/windowing The old implementation was done in the messy structure in egl (windowing/egl). EGL itself is not a platform or windowing systems, means that basically all platforms you find under the egl folder need rework. A requirment of the new Wyland support is a binding to OpenGL. GLES is optional and not required in the first round. The old code did only support GLES like the other plarforms that share the mess under windowing/egl. The new implementation should consider that we finally want support for wayland protocols like "presentation time". RE: Wayland support - yol - 2017-03-17 Hi, thanks for taking the time to guide me through the current state. (2017-03-10, 12:03)RockerC Wrote: So if you have time right now then you could just try to merge the Wayland code into FernetMenta's "kodi-agile" fork of Kodi to see if it will even fit with all the reworked code changes for Kodi already in there:I've taken a look at it, but it does not seem to affect the windowing code in a particularly relevant way (yet). (2017-03-11, 08:55)FernetMenta Wrote: Hi, thanks for showing interest. New Wayland support should be implemented the same way like X11 or Mir. Mir support is relatively new can can be taken as a good example of how it should be. In Kodi's context Wayland is a platform or windowing systems. Check out X11, Windows, or Mir folders under xmbc/windowing:Seems Max Kellermann has started dealing with this: https://github.com/MaxKellermann/xbmc/commit/5f0fbc9904b1123458fe3c3ef93b3ff140293619 - granted, it's only renaming files, but it shows that he might be considering to continue to work on this. I would want to avoid having two people work separately on this, which means some coordination/communication might be required. So going forward, am I understanding you correctly that you want relevant portions of the EGL code (which will still be needed since Wayland requires EGL for GL contexts) moved/copied to the Wayland windowing system, like it was done with Mir? Or do you want some kind of central place for the EGL code, just not the way it is now (thinking about the other platforms based on egl that will also need to be modified some day)? I think that the CGLContextEGL required for Wayland would be mostly equal to the one Mir currently uses. (2017-03-11, 08:55)FernetMenta Wrote: The new implementation should consider that we finally want support for wayland protocols like "presentation time".Am I correct that you are referring to this? Should it be used for implementing CVideoSync or do you have anything else in mind? Also, it seems that sadly no compositor except weston even supports it at the moment (I've quickly checked the arguably most important ones, mutter and KWin). RE: Wayland support - FernetMenta - 2017-03-17 (2017-03-17, 00:42)yolk Wrote: Seems Max Kellermann has started dealing with this: https://github.com/MaxKellermann/xbmc/commit/5f0fbc9904b1123458fe3c3ef93b3ff140293619 - granted, it's only renaming files, but it shows that he might be considering to continue to work on this. I would want to avoid having two people work separately on this, which means some coordination/communication might be required. First time I see this. Max Kellermann seems not to accept any guidance so this approach may take forever. (2017-03-17, 00:42)yolk Wrote: So going forward, am I understanding you correctly that you want relevant portions of the EGL code (which will still be needed since Wayland requires EGL for GL contexts) moved/copied to the Wayland windowing system, like it was done with Mir? Or do you want some kind of central place for the EGL code, just not the way it is now (thinking about the other platforms based on egl that will also need to be modified some day)? I think that the CGLContextEGL required for Wayland would be mostly equal to the one Mir currently uses. At this time I don't see any benefit from common code for EGL. It's only few line anyways. Have a look at the history of the egl floder. There are only platform specific changes. If it turns out that some common code could be factored out, it can be done at a later time. (2017-03-17, 00:42)yolk Wrote: Am I correct that you are referring to this? Should it be used for implementing CVideoSync or do you have anything else in mind? Also, it seems that sadly no compositor except weston even supports it at the moment (I've quickly checked the arguably most important ones, mutter and KWin). Yes, we need a solution for CVideoSync because CVideoSyncDRM and CVideoSyncGLX are deprecated. Using wp_presenatation was actually a suggestion by Intel developers. RE: Wayland support - yol - 2017-03-17 (2017-03-17, 18:20)FernetMenta Wrote: First time I see this. Max Kellermann seems not to accept any guidance so this approach may take forever.I asked him by mail directly and he said that he's working on it from time to time but he does not intend to have it merged into mainline Kodi at the moment or anytime soon, so that's that. (2017-03-17, 18:20)FernetMenta Wrote: At this time I don't see any benefit from common code for EGL. It's only few line anyways. Have a look at the history of the egl floder. There are only platform specific changes. If it turns out that some common code could be factored out, it can be done at a later time.Agreed. (2017-03-17, 18:20)FernetMenta Wrote: Yes, we need a solution for CVideoSync because CVideoSyncDRM and CVideoSyncGLX are deprecated. Using wp_presenatation was actually a suggestion by Intel developers.Yep it seems like the natural choice. Might have to try to push compositor implementors to actually support it, though. OK, so is there anything else you would want to have in the Wayland implementation (or possibly related topics)? I'm still unsure whether I can convincingly fill a 3-month timeline with it as-is. RE: Wayland support - FernetMenta - 2017-03-19 (2017-03-17, 23:44)yolk Wrote: OK, so is there anything else you would want to have in the Wayland implementation (or possibly related topics)? I'm still unsure whether I can convincingly fill a 3-month timeline with it as-is. CVideoSync should work. That is for driving video player clock by vertical retrace. In addition we need some means to tell how long it will take for a submitted frame to be on screen. Currently we don't really know. We try to guess based on double/triple bufer setting. Proper handling of multiple monitors. Assume you have configured Kodi to use the projector. User powers up the system with projector being off. Later projector comes online. Output should switch to projector automatically. Rework use of OS sreensaver. I think this is partly broken in current version. RE: Wayland support - yol - 2017-03-19 (2017-03-19, 09:44)FernetMenta Wrote: CVideoSync should work. That is for driving video player clock by vertical retrace.If presentation-time is supported, that can probably be calculated from the time difference between calling commit() on the surface and the time in the presentation event. (2017-03-19, 09:44)FernetMenta Wrote: Rework use of OS sreensaver. I think this is partly broken in current version.Doesn't seem to be implemented at the moment. There's an unstable wayland protocol (idle-inhibit) for it, but it's also not implemented on all compositors. Alternative would be to use the org.freedesktop.ScreenSaver interface on DBus. That's not wayland-specific, though. I'll write up a proposal based on the discussions, shall I make a new thread or just post it as reply here? RE: Wayland support - FernetMenta - 2017-03-19 (2017-03-19, 20:54)yolk Wrote: If presentation-time is supported, that can probably be calculated from the time difference between calling commit() on the surface and the time in the presentation event. Don't underestimate. Main/gui thread may be blocked for what reason ever and only output every other frame or so. (2017-03-19, 20:54)yolk Wrote: I'll write up a proposal based on the discussions, shall I make a new thread or just post it as reply here? Great. I think posting it here is fine. RE: Wayland support - yol - 2017-03-20 Wayland Support Name: Philipp Kerling Forum: yolk Summary: Wayland is a set of protocols for communication between applications and compositors that is expected to replace Xorg in the Linux graphics stack in the next years. Mainline Kodi currently lacks support for Wayland and must thus use an Xwayland-emulated X11 session for display which is not optimal in the long run. Therefore, native support for Wayland should be implemented in Kodi. How will I achieve this: There was a prior implementation of Wayland support that was removed: 8980 (PR). However, taking the existing code at https://github.com/MaxKellermann/xbmc and fixing the problems that lead to the removal is more efficient than re-implementing from scratch, so this is what I would do. In detail, the Mir windowing system support that is already implemented in Kodi will serve as model for the parts that integrate into Kodi while many components interacting with Wayland can be taken from the current Wayland code. Additional features (see goals) can then be added after the cleanup. What will the project focus on: The main focus is getting basic Wayland support ready for merging into Kodi first and then implement additional features. Compositor interoperability testing will focus on Weston (Wayland reference compositor), mutter (GNOME) and KWin (KDE). Benefits: Users can run Kodi natively on Wayland compositors which are the default already in some Linux distributions (e.g. Fedora) and enjoy improved performance and video playback since the Xwayland X11 emulation is no longer necessary. Going forward, Wayland support will become increasingly important as more distributions make the switch. Thus native support for Wayland is a prerequisite for Kodi being able to offer a competitive user experience on Linux in the future. Goals:
What does it touch in Kodi:
Requirements:
Possible problems:
Possible mentors: tbd RE: Wayland support - FernetMenta - 2017-03-20 Sounds good! Some comments: 1) I won't use the old egl base as a starting point but that is your decision. 2) I would stress the benefits more. Wayland support is absolutely essential for Kodi on Linux. X11 is dying. 3) VDPAU won't work because it requires X11. Currently it looks like VDPAU is dead too. RE: Wayland support - yol - 2017-03-21 Thanks for your comments! (2017-03-20, 21:56)FernetMenta Wrote: 1)I was thinking more along the lines of using the Wayland support code that is there (like the protocol objects etc.) and marry it with the EGL/Kodi code from Mir, so I've clarified that part. Guess another approach would be to just copy the files that would still be relevant without a complete rebase of the old code, which would save some time if you're fine with losing the history (shouldn't matter much). (2017-03-20, 21:56)FernetMenta Wrote: 2)I've tried to make it a bit more dramatical ;-) (2017-03-20, 21:56)FernetMenta Wrote: 3)Ah OK - I didn't look specifically into VDPAU. But if that's clear there is no reason to include it in the proposal, so I've removed it. RE: Wayland support - RockerC - 2017-03-21 (2017-03-21, 00:24)yolk Wrote:Could substitute VDPAU with VAAPI (VA API)? http://en.wikipedia.org/wiki/Video_Acceleration_API(2017-03-20, 21:56)FernetMenta Wrote: 3)Ah OK - I didn't look specifically into VDPAU. But if that's clear there is no reason to include it in the proposal, so I've removed it. RE: Wayland support - FernetMenta - 2017-03-21 (2017-03-21, 14:33)RockerC Wrote:(2017-03-21, 00:24)yolk Wrote:Could substitute VDPAU with VAAPI (VA API)? http://en.wikipedia.org/wiki/Video_Acceleration_API(2017-03-20, 21:56)FernetMenta Wrote: 3)Ah OK - I didn't look specifically into VDPAU. But if that's clear there is no reason to include it in the proposal, so I've removed it. AMD is working on this. RE: Wayland support - RockerC - 2017-03-21 (2017-03-21, 17:14)FernetMenta Wrote:Nvidia is working on VAAPI support to replace VDPAU? Or is AMD working on VAAPI support to replace XvBA?(2017-03-21, 14:33)RockerC Wrote:AMD is working on this.(2017-03-21, 00:24)yolk Wrote: Ah OK - I didn't look specifically into VDPAU. But if that's clear there is no reason to include it in the proposal, so I've removed it.Could substitute VDPAU with VAAPI (VA API)? http://en.wikipedia.org/wiki/Video_Acceleration_API |