We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4024 - GameController error "Unexpected controller element"
Summary: GameController error "Unexpected controller element"
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: don't know
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-04 08:53 UTC by Sylvain
Modified: 2019-01-21 22:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain 2018-01-04 08:53:20 UTC
I don't know if this is really an error, but it sets the error variable.

On linux, my Logitech Gamepad F310 will tell "Unexpected controller element" but appears to run correctly.

here's some log message : 

SDL_JOYDEVICEADDED: 0 'Logitech Gamepad F310'
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'a', 'b0')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'b', 'b1')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'back', 'b6')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'dpdown', 'h0.4')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'dpleft', 'h0.8')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'dpright', 'h0.2')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'dpup', 'h0.1')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'guide', 'b8')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'leftshoulder', 'b4')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'leftstick', 'b9')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'lefttrigger', 'a2')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'leftx', 'a0')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'lefty', 'a1')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'rightshoulder', 'b5')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'rightstick', 'b10')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'righttrigger', 'a5')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'rightx', 'a3')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'righty', 'a4')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'start', 'b7')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'x', 'b2')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, 'y', 'b3')
INFO: SDL_PrivateGameControllerParseElement(0x345cb30, '', '')
INFO: Unexpected controller element
Comment 1 Sylvain 2019-01-16 12:36:33 UTC
There is a comma "," at the end of each controller line in SDL_gamecontrollerdb.h

Not sure if we should be removed them ? 

Also "sort_controllers.py" always re-add it
Comment 2 Sylvain 2019-01-16 13:10:53 UTC
Fixed in https://hg.libsdl.org/SDL/rev/66498ac4cff7

- Only remove the trailing comma of SDL_gammecontrollerdb.h
- fix sort_controllers.py not to add it
- fix 1 hard-coded mapping
- modify also SDL_CreateMappingForAndroidController()


BTW: SDL_gammecontrollerdb.h could also be re-sorted by sort_controllers.py

With "diff SDL_gamecontrollerdb.h SDL_gamecontrollerdb.h.new",  this line would be moved:

"03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,platform:Linux,start:b5,x:b3,y:b2",
Comment 3 Sylvain 2019-01-17 07:40:03 UTC
Re-opened: 
- probably have to be reverted to avoid crazy merge between various mapping files.
Comment 4 Sylvain 2019-01-21 19:54:30 UTC
Revert SDL_gamecontrollerdb.h and sort_controllers.py:

https://hg.libsdl.org/SDL/rev/f9d4bc2af027
Comment 5 Sylvain 2019-01-21 22:42:48 UTC
Fixed https://hg.libsdl.org/SDL/rev/05aff4771d9a

If mapping string is terminated with a comma, there is no more values to parse.