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

Linux and Mac OS X support #1

Open
ChristophHaag opened this issue Aug 29, 2016 · 6 comments
Open

Linux and Mac OS X support #1

ChristophHaag opened this issue Aug 29, 2016 · 6 comments

Comments

@ChristophHaag
Copy link

Looks like a nice GUI that's "almost" cross platform already.

I started doing some changes here: https://github.com/ChristophHaag/OSVR-CPI/commits/master

Some random things:

  1. Most of the GUI and serial stuff should work on linux (I haven't really tested much besides the Check FW Version button) but I haven't done the firmware update button yet.
  2. thePort->waitForReadyRead(5000) doesn't work on linux, it always returns false. Should only matter for the firmware update though.
  3. Serial port is hardcoded to /dev/ttyACM0, with a couple of minutes on google I didn't figure out how to get a serial port by USB ID.
  4. A hand rolled file watcher using windows APIs in the usersettingsplugin... I've removed that part of the code so far but I haven't found a good cross platform alternative. Candidates are
  5. QFileSystemWatcher. I just can't get it to work. Someone with better Qt knowledge may.
  6. fswatcher looks like it has a broken CMake setup. May be worth looking further into.
  7. efsw is simple and works easily, but it looks like it only notifies on directory changes, not file changes. You could just listen to all changes in the directory where the config file is but on linux I want to put it into ~/.config/osvr_user_settings.json and so you'd get notified about any and all changes in ~/.config. Alternatively the config file could go into ~/.config/osvr/osvr_user_settings.json.

If anyone has some tips how to proceed I'd be happy to try them.

@godbyk
Copy link

godbyk commented Aug 31, 2016

There is some code in the OSVR USBSerial library that might be useful in avoiding hard-coding the serial port. See also the osvr_list_usbserial app for an example usage.

@ChristophHaag
Copy link
Author

Nice, ChristophHaag@a2303e1 works like a charm (on linux at least).

Thanks for the tip.

@godbyk
Copy link

godbyk commented Sep 1, 2016

@ChristophHaag I'm glad it worked for you!

If you're searching for a device with a known VID/PID, you can pass those values as arguments to enumerate() and it will return a list of matching devices (instead of all of the devices). That'd save you having to check the results yourself.

@ChristophHaag
Copy link
Author

Yes, that works better. It's a pretty limited iterator though, for example it doesn't implement the necessary stuff for std::distance to work, so you still have to manually iterate over the entries in order to count them. But that's not a big deal, works fine.

For fswatch (I wrote fswatcher first, but that's another project without Mac OS X support so far) apparently you need to run autotools and configure first for the cmake project to work. Looks like that's going to be a bit of a hassle to set up to work on multiple operating systems in the cmake project. I tried it out with the library installed to the system (when the directory containing libfswatch/ is in the include path) and it seems to work fine. After the file is changed it prints inotify_rm_watch: Invalid argument but it probably doesn't hurt and osvr_server can't be killed with ctrl+c anymore. But it works...

@osvr-phabricator
Copy link
Contributor

Hello ChristophHaag@ Any chance to have your changes merged to this project?

Best,

@ChristophHaag
Copy link
Author

I have not started to make pull requests, because several of these changes break the functionality on windows or are at least likely to not work on windows.

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

3 participants