BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
656 stars 87 forks source link

SDL 2 | DietPi Autostart | Keyboard input in emulator is sent to underlying console / vt #78

Closed rabejens closed 6 years ago

rabejens commented 7 years ago

I set up DietPi to boot into Amiberry, and I exchanged the version that is shipped with the new SDL2 build.

The root console gets started in the background and everything I type in the emulator also gets sent to the underlying console.

Steps to reproduce:

  1. Install DietPi with Amiberry ("The complete distribution" from the Amiberry site)
  2. Build the SDL2 version
  3. Drop the generated executable and the TopazNew font to the appropriate locations under /etc/uae4arm-rpi
  4. Change the symlink that is called by the run script to point to the new binary
  5. Reboot the Pi
  6. Open a shell on the emulated Amiga after booting a Workbench, and enter: echo "Hello"
  7. Quit UAE4ARM

You will now see that echo "Hello" got sent to the console and was executed.

Fourdee commented 7 years ago

@rabejens Thanks for the report 👍 We'll be implementing AmiBerry SDL 2 soon into DietPi, i'll take a look at the reported issues at the same time. https://github.com/Fourdee/DietPi/issues/850

midwan commented 7 years ago

Duplicate of #71 Need to check if the solution that was tested and worked on Raspbian and RetroPie has any issues with DietPi, otherwise this can be closed.

midwan commented 7 years ago

Relates to fix https://github.com/RetroPie/SDL-mirror/commit/294906558e67f7046b01bb2dc13da6c59a27db44 in RetroPie's SDL2 mirror.

@Fourdee this may be related to the fact that we're switching tty in the boot options to avoid displaying the boot messages?

midwan commented 7 years ago

@Fourdee

Confirmed:

This must be related to something changing in the autostart function of DietPi. Didn't have time to test more for now, but at least we have something to focus on.

Fourdee commented 7 years ago

@midwan

DietPi v148 with Amiberry Autostart (either Standard or Quick mode): keyboard input leaks to the console

Thanks 👍

I'll take a look, most likely needs a service tweak for SDL2 version.

solskogen commented 7 years ago

This also happens on Arch Linux. It's probably a bug in SDL2.

midwan commented 7 years ago

@solskogen It seems to be. The RetroPie team solved it by patching their mirror of SDL2 and deploying that, but their patch is only for tty0 - so if the service starts the application from another console you still get the bug.

Fourdee commented 7 years ago

@midwan

DietPi v148 with Amiberry Autostart (either Standard or Quick mode): keyboard input leaks to the console

Unable to replicate this with our non-retropie SDL2 compiled debs:

Edit: Yes it does

wget http://dietpi.com/downloads/binaries/rpi/sdl2_rpi.7z -O package.7z
7z x -y package.7z -osdl2_rpi
rm package.7z

dpkg -i sdl2_rpi/no_opengl_x11/*.deb
rm -R sdl2_rpi

That package also contains optional SDL2 with OpenGL and X11 enabled. https://github.com/Fourdee/DietPi/issues/850#issuecomment-294767845


Options/Notes:

midwan commented 7 years ago

@Fourdee I believe the RetroPie team patched SDL2 to get around this: https://github.com/RetroPie/SDL-mirror/commit/294906558e67f7046b01bb2dc13da6c59a27db44

But their patch only handles tty0 from what I could see.

midwan commented 7 years ago

@Fourdee Good news, it looks like the SDL2 team picked this up! There's a new commit that should fix the problem: https://hg.libsdl.org/SDL/rev/fe9c7d01a093

We'll have to test with the latest snapshot to make sure: http://www.libsdl.org/tmp/SDL-2.0.zip

Bug report URL: https://bugzilla.libsdl.org/show_bug.cgi?id=3611

midwan commented 6 years ago

@Fourdee SDL2 stable is now at 2.0.6, which should include the bugfix regarding our problem. I'll try to test it out on DietPi to see if it's resolved or not... Let me know if you find the time to test it before I do! :)

midwan commented 6 years ago

@Fourdee SDL2 official release is now up to 2.0.7. I should be able to give it a try this weekend, if all goes according to plan. Hopefully this can be closed then.

midwan commented 6 years ago

Confirmed fixed with SDL2 v2.0.6 or higher (tested with 2.0.7)