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

FreeBSD, runtime error related with haptic support #105

Closed
filux opened this issue Jan 7, 2016 · 6 comments
Closed

FreeBSD, runtime error related with haptic support #105

filux opened this issue Jan 7, 2016 · 6 comments
Milestone

Comments

@filux
Copy link
Contributor

filux commented Jan 7, 2016

Since switching to SDL2 I had a problem during launch game binary (FreeBSD 10.2 - latest stable) because of error like:
SDL not built with haptic (force feedback) support.
Game can't be successfully launched and by this impossible is test of the status for issues #72 and #73 .

Error is pretty clear and for users mean: ~ "broken sdl2 port", so

  • first step was upgrade of freebsd ports but this didn't change the situation,
  • next step (many hints from the BSD topics) was try to build sdl2 from ports' source with not disabled haptic in options and I found out haptic was enabled by default and this also didn't didn't change the situation (funny is like people are writing "compilation with haptic helped", good joke you bsd-trolls :P),
  • third attempt was try to compile SDL2-2.0.4 from original source but it is not possible because missing patches which if get from ports seems to be not fully compatible.

Then I found this bug report which seems to be close to true: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200854

So Imo if it is possible we need something like:

If [ not BSD ]; then SDL_INIT_HAPTIC; fi

or for now MG is not supporting BSD anymore (I am curious how bsd-trolls will see this xD).

@filux filux added the bug label Jan 7, 2016
@filux filux added this to the sdl2 milestone Jan 7, 2016
@monwarez
Copy link
Contributor

One thing I does not understand, why MegaGlest need force feedback ?
For disabling HAPTIC , you can apply this patch

--- source/shared_lib/include/platform/sdl/platform_main.h.orig 2016-03-27 01:19:15 UTC
+++ source/shared_lib/include/platform/sdl/platform_main.h
@@ -666,8 +666,14 @@ int mainSetup(int argc, char **argv) {
             }
        }
        else {
+                auto failTimer =       (SDL_Init(SDL_INIT_TIMER) < 0);
+                auto failAudio =       (SDL_Init(SDL_INIT_AUDIO) < 0);
+                auto failVideo =       (SDL_Init(SDL_INIT_VIDEO) < 0);
+                auto failJoy   =       (SDL_Init(SDL_INIT_JOYSTICK) < 0);
+                auto failGC    =       (SDL_Init(SDL_INIT_GAMECONTROLLER) < 0);
+                auto failEvents=       (SDL_Init(SDL_INIT_EVENTS) < 0);
                 if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
-                if(SDL_Init(SDL_INIT_EVERYTHING) < 0)  {
+                if(failTimer || failAudio || failVideo || failJoy || failGC || failEvents)  {
                        if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
                        std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n";
                        return 3;

@filux
Copy link
Contributor Author

filux commented Mar 27, 2016

Well as I know MG doesn't need it (at least yet) but simple "init all" is very tempting 😃 when all works on linux & windows & macos where are done most/all of our tests.

Do you know something about: does someone is working on adding HAPTIC support for BSD? and how advanced is such work?

@monwarez
Copy link
Contributor

monwarez commented Mar 27, 2016

I made a port update for 3.12.0: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205485 , with the previous patch. From what I understand, the problem with HAPTIC support is that its use some GNU/Linux specific events (I suppose in kernel space ?), and I know that FreeBSD is not intended to be a GNU/Linux OS. I think it will be necessary to add HAPTIC support in SDL2 code directly.
Update: version 3.12.0 are on the port with patch to not load HAPTIC module
The final patch used for HAPTIC are here

@monwarez
Copy link
Contributor

Do you have this issue with the version 3.12.0 on the port ? issues: #72, and #73

@filux
Copy link
Contributor Author

filux commented Oct 28, 2016

Hehe, I am not a FreeBSD user :). Feel free to comment those issues about, can you reproduce them or not. Two voices are better than 1 ;).
...and v3.12.0 is based on later commit than tests were done :).

My last test was done ~ creation date of this issue and was related only with this issue.

@monwarez
Copy link
Contributor

monwarez commented Oct 28, 2016

I am sure that I don't have issue #73 (maybe it was OpenAL fault after all) , for the other #72 , I need to launch it on a terminal to see if error pop up. After some quick test I don't have issue #72

@filux filux closed this as completed in d40a6fd Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants