Originally created by: rogerx....@gmail.com
After upgrading to flightgear-2.12.0, the keyboard 3/9 or PgDn/PgUp keys do not work for the throttle controller.
I have checked the internal properties to make sure those keys have the correctly assigned key codes, and yet flightgear is still not using those keys for throttle, if at all.
The only method of using the throttle within flightgear-2.12.0 is to use the mouse and push/pull the 3D throttle controller on the 3D cockpit view.
I've unplugged the joystick/rudder controllers to makes sure those were not conflicting, however, the joystick throttle controller does not work either as the throttle. (Other joystick axis or buttons do work.)
(I have also recompiled flightgear-2.12.0 without any extra CFLAGS with without any obvious improvements.)
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerx....@gmail.com
$ uname -a
Linux localhost4.local 3.10.7-gentoo-[r1] #2 SMP PREEMPT Tue Oct 15 02:24:21 AKDT 2013 x86_64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz GenuineIntel GNU/Linux
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: NasalMusician
Can you uncomment line #39 of keyboard.xml and confirm that the value of PageUp/Down is 360/361?
Labels: Inputs
Status: NeedInfo
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
Odd. I'm not getting anything within --log-level=bulk containing the word 'key' after uncommenting the said line!
ie.
## uncomment this line to get keycode reports printed to the terminal window
setlistener("devices/status/keyboard/event", func(n) debug.dump(n.getValues()));
Guessing setlistener is a function mapped to a printf statement and should be sending lines containing "devices/status/keyboard/event" when log-level=bulk or even at debug level?
Yes. "360/361" is mapped appropriately within similation prop frontend, as well as the correct keycodes for 3/9 keys.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: NasalMusician
Uh, the setlistener sets a function that is called whenever a key press occurs (that is, when devices/status/keyboard/event is triggered), and the function set in the above lines prints out a hash to the console - i.e. the debug.dump is the printf here (it's purpose is to handle other types of variables, e.g. as returned from n.getValues()). To view the output, it's best to watch the console output with no log level at all. When you press a key, you can therefore see the corresponding output. (Also, I wouldn't recommend bulk level, there are at the very least threading issues, and most of the output is beyond irrelevant for non-core issues.) Anyways.
I don't know what the issue is here. No Nasal errors? All aircraft? Other controls work? I can't think of anything at all that changed between releases.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
Yes. No output with the code line uncommented.
And I do not get any output or stdout via command line "$ fgfs". It's pretty quiet. (I've also recompiled with CFLAGS="-g -Wall -ggdb" for kicks. Even running within gdb is really quiet except for 'New Thread' and 'New Thread Exited'.)
All other controls via keyboard or joystick appear to work. (Albeit, I wouldn't be surprised if a few more keys are not working.)
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
I've also run the Win32 version of flightgear-2.12.0 under Windows 8.1 and the throttle is recognized there, or going from memory from yesterday.
I did find, AXIS 2 is my joystick throttle axis, while AXIS 5 is my rudder under /devices/status. Under /input, this throttle axis is mapped to the rudder and rudder to the throttle, however the simulation does have a working rudder using AXIS 5. Also, /device/status does show a working throttle axis 2.
Under js_demo, throttle is axis 3 and rudder is axis 6. Nothing more then seemingly cosmetic effects here.
I also find the mod-shift look-back-right and look-right-front works with the PageUp and Page Down keys. (ie. /input/keyboard/360/ & 361/) Seems to be something very specific to the throttle function. Seems the throttle function isn't working with keyboard/joystick input, and only via mouse.
I have just checked the Win32 build, and everything I stated previously of the internal properties under Linux, looks identical within the internal properties of the win32 build.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
I'm happy to say, I finally have found the solution to this problem.
The problem occurs with compiling =dev-games/simgear-2.12.0 with CFLAGS/CXXFLAGS "-Ofast -funroll-loops -march=corei7 -pipe". Recompiling simgear using safer CFLAGS (ie. "-g -Wall -ggdb" ;-) resolves the problem and the throttle controller is now successfully linking into the throttle controller as well as the keyboard. (ie. 3, 9, PgUp, PgDn)
However, "$ fgfs --fg-root=/usr/share/games/flightgear/" console is extremely quite with the above keyboard.xml debug printf hack. (I have both, USB & PS2 keyboards here and, flightgear and simgear are compiled with more than adequately safe CFLAGS/CXXFLAGS.)
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
Testing a little further, with -funroll-loops and -ggdb, pressing some keys created a segfault after launch. Default config, with no args.
[Thread 0x7ffff7353700 (LWP 20601) exited]
[New Thread 0x7ffff7353700 (LWP 20609)]
[New Thread 0x7ffff0ab8700 (LWP 20610)]
[New Thread 0x7fffe8ffe700 (LWP 20611)]
[Thread 0x7ffff3886700 (LWP 20604) exited]
Program received signal SIGSEGV, Segmentation fault.
_______________________________________________________________________________
eax:00000000 ebx:01AB6590 ecx:00000003 edx:FFFFCFA0 eflags:00010206
esi:00000010 edi:08D00F30 esp:FFFFCF40 ebp:08CFA8E8 eip:Error while running hook_stop:
Value can't be converted to integer.
naiHash_newsym (hash=0x8d00f30, sym=0x10, val=val@entry=0x7fffffffcfa0) at /var/tmp/portage/dev-games/simgear-2.12.0/work/simgear-2.12.0/simgear/nasal/hash.c:257
257 struct naStr *s = PTR(*sym).str;
gdb> bt
#0 naiHash_newsym (hash=0x8d00f30, sym=0x10, val=val@entry=0x7fffffffcfa0) at /var/tmp/portage/dev-games/simgear-2.12.0/work/simgear-2.12.0/simgear/nasal/hash.c:257
#1 0x00007ffff745581d in setupArgs (ctx=0x8cfa8e0, ctx@entry=0x8cff0b0, args=<optimized out>, args@entry=0x7fffffffd100, nargs=nargs@entry=0x4, f=0x8cff0b0, f=0x8cff0b0) at /var/tmp/portage/dev-games/simgear-2.12.0/work/simgear-2.12.0/simgear/nasal/code.c:275
#2 0x00007ffff745944e in naCall (ctx=0x8cfa8e0, func=..., argc=0x4, args=0x7fffffffd100, obj=..., locals=...) at /var/tmp/portage/dev-games/simgear-2.12.0/work/simgear-2.12.0/simgear/nasal/code.c:877
#3 0x0000000000d83db7 in FGNasalSys::callMethod (this=0xb93ec40, code=..., self=..., argc=0x4, args=0x7fffffffd100, locals=...) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Scripting/NasalSys.cxx:245
#4 0x0000000000d83d3e in FGNasalSys::call (this=0xb93ec40, code=..., argc=0x4, args=0x7fffffffd100, locals=...) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Scripting/NasalSys.cxx:230
#5 0x0000000000d8899d in FGNasalListener::call (this=0xc658b60, which=0x2018700, mode=...) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Scripting/NasalSys.cxx:1294
#6 0x0000000000d88a69 in FGNasalListener::valueChanged (this=0xc658b60, node=0x2018700) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Scripting/NasalSys.cxx:1302
#7 0x00007ffff747d438 in SGPropertyNode::fireValueChanged (this=<optimized out>, node=0x2018700) at /var/tmp/portage/dev-games/simgear-2.12.0/work/simgear-2.12.0/simgear/props/props.cxx:2225
#8 0x0000000000bdcbca in FGKeyboardInput::doKey (this=0x7ffff449b010, k=0x33, modifiers=0x0, x=0x2cc, y=0x65) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Input/FGKeyboardInput.cxx:219
#9 0x0000000000bdcda6 in FGKeyboardInput::keyHandler (key=0x33, keymod=0x0, mousex=0x2cc, mousey=0x65) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Input/FGKeyboardInput.cxx:259
#10 0x0000000000ebba1d in flightgear::FGEventHandler::handle (this=0x1611580, ea=..., us=...) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Viewer/FGEventHandler.cxx:213
#11 0x0000000000ad9d95 in osgGA::GUIEventHandler::handle (this=0x1611580, ea=..., aa=...) at /usr/include/osgGA/GUIEventHandler:69
#12 0x0000003f80a8e55d in osgViewer::Viewer::eventTraversal() () from /usr/lib64/libosgViewer.so.80
#13 0x0000003f80a96cf6 in osgViewer::ViewerBase::frame(double) () from /usr/lib64/libosgViewer.so.80
#14 0x0000000000ec207d in fgOSMainLoop () at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Viewer/fg_os_osgviewer.cxx:322
#15 0x0000000000a3d88f in fgMainInit (argc=0x1, argv=0x7fffffffda78) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Main/main.cxx:369
#16 0x0000000000a1c3cd in main (argc=0x1, argv=0x7fffffffda78) at /var/tmp/portage/games-simulation/flightgear-2.12.0/work/flightgear-2.12.0/src/Main/bootstrap.cxx:244
gdb>
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: NasalMusician
CCing Tom so he can have a look - I'm not good with segfaults.
Cc: tom...@gmail.com
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tom...@gmail.com
I have recently fixed a bug while exposing C functions to Nasal. Please try again with latest fg/sg from git.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tom...@gmail.com
This fix is now also included in the simgear release/2.12.0 branch.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
I'm already using simgear-2.12.0. (Sorry, I forgot to mention the simgear version!)
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tmcmas...@bellsouth.net
I'm so new to this I don't know the difference between fg sg from git. It looks exactly like the problem I have with a fix. Can I get more help on this.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tmcmas...@bellsouth.net
Also my version of 2.12 was downloaded as the binaries. Thanks
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
tmcmas: You need to first verify the correct key codes are being passed to the keyboard throttle keys first. See Comment #2, "Can you uncomment line #39 of keyboard.xml and confirm that the value of PageUp/Down is 360/361?" You can also see the key assignments from within the FGFS/FlightGear menu bar "Debug > Browse Internal Properties > Input > Keyboard".
There are many open bugs already concerning Macs not correctly assigning the (correct) keyboard key code, and are apparently unrelated to this one.
The easiest method to see if this particular bug affects you, recompile with known stable CFLAGS/CXXFLAGS, or even use "-g -ggdb" CFLAGS/CXXFLAGS. Also, contact/forward this to your package maintainer to see if they are witnessing similar problems, and/or they compiled simgear using known risky CFLAGS/CXXFLAGS.
This bug within this thread is specifically caused by simgear being compiled with "-funroll-loops".
Once you've verified your 360/361 key codes are properly assigned and haven't resolved this, follow-up by posting your Linux Distribution & Linux Distribution Version.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: zakalawe@mac.com
Interesting - I am seeing a crash very similar to this on Mac, but only in release builds and only one one machine. Always in naiHash-newsy with a null sym ref, coming out of setupArgs.
Cc: zakalawe@mac.com
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
Pretty sure this bug has been narrowed down to simgear. (ie. simgear -2.12.0)
In my previous post, I further narrowed this down to the "-funroll-loops" compiler flag.
But I also think different CPU's or architectures could also spawn this bug using safe CFLAGS?
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: NasalMusician
Are we still talking about the crashing in naiHash_newsym? That's been merged into bug #1397 (now fixed - you can download and apply the patch over there).
Was the other "throttle not working" bug just a bad compiler flag somewhere, so we can close this now?
Related
Tickets:
#1397View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
If I have my flags correct, whether or not it was a flag that caused this bug, the flag merrily brought the issue to the surface. It is still bad code requiring a fix. Correct?
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
Although throttle is working flightgear-3.0.0, the segfault listed here seems to be much more worse now, and causing flightgear to segfault almost anytime when fiddling with the radio or FGCom. I've opened another bug specifically related to the segfault mentioned here at Bug #1446.
Related
Tickets:
#1446View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rogerxx@gmail.com
And yes, I think this bug is solved for the throttle being inoperable.
View and moderate all "codetickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: NasalMusician
(No comment was entered for this change.)
Status: Expired