Menu

#767 SDL2 versions do crash

v2.4.x
closed-fixed
nobody
None
Windows
2016-08-27
2016-07-21
Querino
No

i gave the SDL2 versions a try under windows. it compiled, but on certain keystrokes (cursor keys, CTRL...) all emus crash. x128 even crashes right after launching.

what VICE version are you using? 2.4.28.31447
what operating system are you using? win 7
what did you do? press some keys, CTRL, ALT, Fxx, home, cursor...
what did happen? emus crash
what did you expect to happen? the obvious

btw. what's the benefit of SDL2 over SDL1? so far i could only see downsides:

  • the emus run slower
  • free windows scaling looks worse

Discussion

  • Daniel Mehrwald

    Daniel Mehrwald - 2016-07-30

    SDL2 does support OpenGL for Embedded Systems ( ES ), SDL1 not, on Windows @ the moment you have downsides but on tablets, smart phones, single board computers like ODROID which support OpenGLES it's accelerated and way faster then SDL1, SDL2 in general is faster

    SDL2 supports a lot more grafic backends like SDL1 !

     
  • Daniel Aarno

    Daniel Aarno - 2016-08-04

    I'm not sure if this is the same thing, but there is definetely a bug in sdlkbd_get_hotkey. Pressing the windows key (on ubuntu 14) yields a return value of 0x400000e3 from sdlkbd_key_mod_to_index which is used to look up an entry in the 8k large array sdlkbd_ui_hotkeys. This obviously causes a segmentation violation. A work-around is simple (check array bounds), but I'm not sure what the proper fix should be.

     
    • Greg King

      Greg King - 2016-08-08

      I'm not sure if this is the same thing; but, there is definitely a bug in sdlkbd_get_hotkey(). Pressing the windows key (on ubuntu 14) yields a return value of 0x400000e3 from sdlkbd_key_mod_to_index() which is used to look up an entry in the 8k large array sdlkbd_ui_hotkeys[]. That obviously causes a segmentation violation. A work-around is simple (check array bounds); but, I'm not sure what the proper fix should be.

      That huge number is caused by the SDL_SCANCODE_TO_KEYCODE() macro in "SDL_keycode.h". It is used on modifier keys, function keys, special function keys, cursor keys, and the keypad. The array's size is based on the number of scan-codes. But, SDL2 makes a huge distinction between scan-codes and key-codes! VICE's current SDL keyboard code isn't "forward-compatible" with SDL2. And, the menu connection to keyboard input will need to be different for SDL2.

       
  • Daniel Aarno

    Daniel Aarno - 2016-08-05

    Oh, and should note that this is with sdlui2 of course

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-05

    Will try to debug it tomorrow on my ubuntu 14 machine

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-06

    Just for correctness, the ticket belongs to windows port, but on windows this crashes are not happen on my machine, are you tested it on windows too or only on ubuntu 14 ?

    Secondly, if you have already investigated for a patch please share it on pastebin or so

     
  • Daniel Aarno

    Daniel Aarno - 2016-08-06

    I've only tested on ubuntu. Unfortunately due to my current employment contract I'm unable to submit a patch without going through legal approval. It's a bit silly since it is a two line patch, but that's the unfortunate state of affairs. However, I can say as much as checking the array bounds in sdlkbd_get_hotkey at least works around the problem.

     
  • Marco van den Heuvel

    There have been some changes to the SDL2x port key handling recently.

    With the current trunk does it still crash ??

     
    • Daniel Aarno

      Daniel Aarno - 2016-08-10

      I'm traveling, so can't check exact version, but this was trunk from about 1.5 weeks ago.

       
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-09

    As of today free window scaling with CRT render looks ok and aspect ratio is enabled

     
  • Querino

    Querino - 2016-08-13

    yes, crashes are goneunder windows too.

    but now the keys left to the return key don't do anything. but that might be the keymap file.

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-13

    Just for testing you could delete or rename the sdl_sym.vkm file, then keymap should be fine

     
  • Querino

    Querino - 2016-08-13

    ok, some do work if i use the sdl_pos_de.vkm but they aren't the same as in the SDL1 version.

    so after all i can say, using the same keymaps as in SDL1 gives in SDL2 different output.

     

    Last edit: Querino 2016-08-13
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-13

    Can you give me a hint what keys exactly those are ?

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-13

    Well, could test it for myself, i will look into, thx for reporting

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-13

    Looks like SDL1 doesn't ask underlying OS for keyboard layout, SDL2 does it, so if you switch to US/EN Keyboard in windows it will work

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-20

    fixed with r31554

     
  • Querino

    Querino - 2016-08-20

    hm... what exactly got fixed with r31554?

     
  • Daniel Mehrwald

    Daniel Mehrwald - 2016-08-20

    free windows scaling looks worse <--- that

    blackystardust fixed with r31537 the crashes with cursor keys

    i fixed with r31479 and r31476 x128 crash

     
  • Marco van den Heuvel

    • status: open --> closed-fixed
     
  • Daniel Aarno

    Daniel Aarno - 2016-08-27

    I can confirm that the issue I had with crashing on windows key appears to be gone in latest trunk!

     

Log in to post a comment.