Skip to content

macOS Build fixes, changes to proto-wine, changes to the X-Plane-plugin #1943

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

matatata
Copy link

@matatata matatata commented Oct 4, 2024

Hello Stanislav,

I have made a couple of tweaks that I'd like you to review and maybe merge.

Most notably:

  • I updated the x-plane plugin so that it plays nice with a popular plugin called X-Camera. I also added menu-items to control and see the plugins status.
  • Then I finally was able to build the proto-wine module on macOS and it does work with TrackIR enabled games on macOS ! However I did not like the fact that once the module is built with wine support you always must have wine installed and you cannot just use the native shared memory method, that is active anyway even with wine. For that I added an option that so you can choose to not actually start the wine executable. I thought it made sense to rename the module to "Wine/X-Plane". It can still be built without wine support and then it'S called X-Plane as before. Maybe you agree.
  • Fixed a bug on macOS where the selected camera was not used when there is more than one camera connected.

I plan to test things that could affect the linux build but I haven't had a chance yet. I also don't have X-Plane for linux but I'm confident I did not break anything.

Thank you in advance & best regards, Matteo

@matatata matatata changed the title macOS Build fixes, changes to port-wine, changes to the X-Plane-plugin macOS Build fixes, changes to proto-wine, changes to the X-Plane-plugin Oct 4, 2024
@matatata matatata force-pushed the matatata_pr branch 2 times, most recently from 6815147 to 44fe4b2 Compare October 4, 2024 21:39
@matatata matatata marked this pull request as draft October 5, 2024 19:23
@matatata matatata marked this pull request as ready for review October 7, 2024 15:13
@@ -42,6 +42,15 @@ cp -r "$install/Plugins" "$install/$APPNAME.app/Contents/MacOS/"
macdeployqt "$install/$APPNAME.app" -libpath="$install/Library"
#sh "$dir/install-fail-tool" "$install/$APPNAME.app/Contents/Frameworks"


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it's weird that this library even is a dependency. It shows up in the neuralnet-tracker.dylib. But it also shows up in the opentrack-wrapper.exe.so which was compiled by wineg++ with an absolute path /opt/local/lib/libundwind.1.dylib . That can't be right. No one will have that. I read things that it will be picked up and linked more or less by accident https://trac.macports.org/ticket/66250. not sure if it has something to do with that. In order to make opentrack-wrapper.exe.so work for others I had to replace that reference via install_name_tool

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually MacPorts fixed it recently :-) https://trac.macports.org/ticket/71052 . No more absolute references to libunwind in the build :-) I'll update the commit/PR

@Priton-CE
Copy link
Contributor

Priton-CE commented Dec 17, 2024

I dont really get that wine change.

Its a wine module, why give the user the option to launch without wine?

It just complicates the UI of the wine module with unnecessary stuff for the majority of users.

@Priton-CE
Copy link
Contributor

Priton-CE commented Dec 17, 2024

Also calling it Wine/X-Plane makes no sense

This is a compatibility layer for wine. There is no dependency on X-Plane. This would be like me calling it Wine/StarCitizen. It could imply to a user that this wine module is somehow tied to a specfic game when its not.

If anything the X-Plane reference should be largely removed and call it "native trackir" or smth like that. (Not quite familiar why this exists in the first place.)

@Priton-CE
Copy link
Contributor

My main concern here is that a user comes along and sees the following:

"I have this wine module! Cool! Ok but why can I launch without wine?"

The naming just isnt clear or intuitive. If there is an option to launch without wine the naming should be changed.

@matatata
Copy link
Author

matatata commented Jan 23, 2025

My main concern here is that a user comes along and sees the following:

"I have this wine module! Cool! Ok but why can I launch without wine?"

The naming just isn't clear or intuitive. If there is an option to launch without wine the naming should be changed.

I totally understand your concern. Let me explain a bit:

I don't know the history of the module, but there was a compile time option that would disable the wine functionality and changed the name from "Wine" to "X-Plane". The WINE-UI controls were still there but not functional... it was even more unintuitive. On macOS we need the a) shared-memory functionality for X-Plane and b) the WINE functionality for WINE-Games ( I guess I'm the only person in the world doing it). So I depending on the compile option I would have either a) or b) but not both. I probably should have split the module into two modules, but instead I changed the compile time option into a switch that would allow to have both at runtime.

So with my changes one could argue that the module is a module that publishes motion data into shared memory so that software like the x-plane plugin can read it directly. And on top of that it can forward motion data into the wine-layer with that trackIr protocol.

I agree that it currently only really makes sense for macOS users because X-Plane is the only use-case for the shared memory only option.

I think it would be best to split the module into two.. but until then perhaps let's change the name back to "WINE.." but label the option "X-Plane" differently perhaps "Shared-Memory only" and add some tooltip that explains that it is for software like the plane-plugin which natively reads the shared memory.

Or perhaps even better let's just leave it in my Mac fork and I'll take it away from this pull request.

Matteo Ceruti and others added 10 commits January 27, 2025 00:19
…ions using macports' development variant of wine-stable (9.0). There were compiler errors in winsock.h.
…o. This is very convenient, because installing a development environment of wine is currently very time consuming to set up on macOS
…8acfc regarding "QTs broken autoexclusive" RadioButtons. They need to be assigned to a group so QT knows where to apply exclusiveness.
- Add Menu-Items (needed to update SDK)
- Add X-Camera integration based on https://github.com/JT8D-17/X-Plane-Opentrack-Plugin
- Fixed drift when toggling tracking and input translation
- Plugin does not start tracking on start. Solves race-conditions with X-Camera detection. Also saves us from confusion when no tracking is happening.
…ect camera in case you have more than one.

- opencv expects index-numbers, but does not provide a way to enumerate them. QCameraInfo::availableCameras() did not return the same order opencv assumes.
…-Plane") from proto-wine. Now we have a dedicated wine protocol and a native shared mem protocol that is usable on macOS and Linux with X-Plane using the xplane-plugin. Before my refactoring one had to chosse at build-time. Now macOS and Linux users can use Wine and native X-Plane by selecting the appropriate output module.
…em neuralnet tracker et al. wont't build even if you specify OpenCV_DIR yourself when calling cmake
@matatata
Copy link
Author

matatata commented Jan 26, 2025

Hi @Priton-CE , so I have reverted my changes to the proto-wine and split the proto-wine module into two modules:
proto-wine basically stays the same it was, but I moved everything about that X-Plane business into a new module proto-native-shm. So both modules now are less complex and Linux and macOS users can now use the wine module for and only for Wine and we macOS guys and Linux users can use the new module with X-Plane by using opentrack's x-plane plugin where the plugin reads the motion data directly from shared memory. It really works well with native X-Plane on Linux by the way. In theory other native linux software could use the same module given that someone writes a plugin or some code that accesses that shared memory as well. Therefore I did not name the module proto-xplane, although currently I guess there's only one client i.e. the X-Plane-Plugin.

The commit is this db9ea5e

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

Successfully merging this pull request may close these issues.

2 participants