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

x11: make dependancy on libudev optional #3708

Merged
merged 1 commit into from
Feb 14, 2016

Conversation

27thLiz
Copy link
Contributor

@27thLiz 27thLiz commented Feb 14, 2016

fixes #3702
Udev monitoring can be optionally enabled by compiling with udev=yes, removes the gamepad flag.
Else, we loop through /dev/input/event0 to event31 once per second to discover new devices.
Disconnection should be instant.

ping @punto-

@punto-
Copy link
Contributor

punto- commented Feb 14, 2016

Looks good. Do you know how many times the function process_joysticks has
to actually skip the frame because it can't lock the mutex (I guess maximum
once per second in this case). I'm wondering if it's not better to just
lock the mutex, and maybe open 1 device every ~35ms instead of all at once.
I've no idea if it makes a difference tho (and skipping 1 frame of input
every 1 second is not bad as long as the events are still there for the
next frame)

On 14 February 2016 at 10:27, Hondres [email protected] wrote:

fixes #3702 #3702
Udev monitoring can be optionally enabled by compiling with udev=yes,
removes the gamepad flag.
Else, we loop through /dev/input/event0 to event31 once per second to
discover new devices.
Disconnection should be instant.

ping @punto- https://github.com/punto-

You can view, comment on, or merge this pull request online at:

#3708
Commit Summary

  • x11: make dependancy on libudev optional

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#3708.

punto- added a commit that referenced this pull request Feb 14, 2016
x11: make dependancy on libudev optional
@punto- punto- merged commit 1448593 into godotengine:master Feb 14, 2016
@punto-
Copy link
Contributor

punto- commented Feb 14, 2016

(in any case, I'm merging this one, that stuff is just thoughts.. this is
pretty great either way)

On 14 February 2016 at 13:48, Ariel Manzur [email protected] wrote:

Looks good. Do you know how many times the function process_joysticks has
to actually skip the frame because it can't lock the mutex (I guess maximum
once per second in this case). I'm wondering if it's not better to just
lock the mutex, and maybe open 1 device every ~35ms instead of all at once.
I've no idea if it makes a difference tho (and skipping 1 frame of input
every 1 second is not bad as long as the events are still there for the
next frame)

On 14 February 2016 at 10:27, Hondres [email protected] wrote:

fixes #3702 #3702
Udev monitoring can be optionally enabled by compiling with udev=yes,
removes the gamepad flag.
Else, we loop through /dev/input/event0 to event31 once per second to
discover new devices.
Disconnection should be instant.

ping @punto- https://github.com/punto-

You can view, comment on, or merge this pull request online at:

#3708
Commit Summary

  • x11: make dependancy on libudev optional

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#3708.

@27thLiz
Copy link
Contributor Author

27thLiz commented Feb 14, 2016

Ok, I just tested that by adding a print statement when it skips the frame and letting it run for ~15 minutes. It has been printed twice ^^
Also: even if this happens, the events will still be available on the next frame. So yeah, this doesn't have much of an impact.

What I'm wondering about is if there's gonna be a case where the device is something else than dev/input/eventX.
Are these names standardized?

@punto-
Copy link
Contributor

punto- commented Feb 14, 2016

I don't know.. maybe udev uses some standard way to find out? (does sdl use
udev too?)

On 14 February 2016 at 14:26, Hondres [email protected] wrote:

Ok, I just tested that by adding a print statement when it skips the frame
and letting it run for ~15 minutes. It has been printed twice ^^
Also: even if this happens, the events will still be available on the next
frame. So yeah, this doesn't have much of an impact.

What I'm wondering about is if there's gonna be a case where the device is
something else than dev/input/eventX.
Are these names standardized?


Reply to this email directly or view it on GitHub
#3708 (comment).

@purpleorangegames
Copy link

I think when you made:

-   if (env["gamepad"]=="yes" and platform.system() == "Linux"):
+   if (platform.system() == "Linux"):
+       env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])

You forced joystick on linux.

@27thLiz
Copy link
Contributor Author

27thLiz commented Feb 15, 2016

Yes, is that a problem? There are no more dependancies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libudev packaging problems
5 participants