Amiberry: Bluetooth controller doesn't reconnect after sleep mode

Created on 5 Jan 2018  Â·  12Comments  Â·  Source: midwan/amiberry

As the title says. I think RetroArch and EmulationStation tries a reconnect every few seconds in the background and enables you to awake the controller during a game. Amiberry can't do this.

enhancement

Most helpful comment

@waal
I haven't had a chance to work on this issue yet, and we're currently on code freeze in the dev until the next release. But we'll look into it after that release is out, as part of the next beta.

As this will require some changes in the logic, I wouldn't want to risk introducing new bugs in something that has been tested already. ;)

All 12 comments

This will b possible with SDL2 but isn’t supported by SDL1.

It’s something i’ll be looking at on the next round of improvements (I.e after the next release)

Thanks, because it is really a big problem when contrôler shut down in game with batterie low :(

The next official release will be the last one that supports SDL1, so we can clean up the code and focus on utilizing SDL2 only.
We can look into this as well at that time (i.e. after the next release, due shortly)

Hi,

Sorry if I bump an old topic but is this issue already fixed with the SDL2 build ?

I'm currently waiting to have confirmation that Batocera 5.24 beta on the RPI3 features this version but I'm nearly certain that this is the case.

Once a game is launched, I can't retake control of the emu after my controler, 8bitdo SNES pro or XBOX360, entered sleep mode. I have to kill the emu through SSH or to plug a controler or use a keyboard (which is logical for a computer some would say but well, you know... gamers. :))

Thank you all for your help (and for the great work, anyway).

Same for me same controller, if shut down it, and restart, it is lost by Amiberry. I must kill Amiberry in SSH to return to ES :(
I'm on Batocera 5.24 alha.

@waal
I haven't had a chance to work on this issue yet, and we're currently on code freeze in the dev until the next release. But we'll look into it after that release is out, as part of the next beta.

As this will require some changes in the logic, I wouldn't want to risk introducing new bugs in something that has been tested already. ;)

@midwan
Any news on this?
The issue for me is using the 8bitdo PRO 2 bluetooth controller and watching Amiga demos. Controller shuts down/goes to sleep and I have to restart my Pi to get back in to watch another demo.

I'd be willing to test dev builds if this has been added.

Otherwise Amiberry rocks! Tip of the hat!

Workaround: While waiting for this feature, I have solved it by using jslisten to kill Amiberry process when I press a specific combination of buttons on my 8bitdo PRO 2 controller. As this returns me to EmulationStation. It works even if my controller has been sleeping.

Please try after the latest commit above, and let me know how it works for you?
I've tested it with a couple controllers here:

  • XBox One controller: I could disconnect it, reconnect it and it worked normally
  • PS4 DualShock controller: This controller is a bit of a special case, as it shows up as 2 devices in the system: One is the controller itself, a second one is the Sensors (e.g. gyro). After reconnecting it, it happened to use the sensors as JOY1 instead of the controller device, which of course is not what we want. We'll have to see if there's a better workaround for this one.

My tests were done by having a cable connected to the controller, physically disconnecting it during emulation and re-connecting it, to see how it behaves. It should do the same with Bluetooth connected controllers, but I didn't test that scenario. :)

Additionally, the logfile will now indicate when these events were detected and show a relevant message (if you have the logfile creation enabled, of course).

Followed the instructions on how to compile, but getting errors:

In file included from src/include/sysdeps.h:339,
from src/osdep/amiberry.cpp:21:
src/osdep/target.h:26:39: error: invalid digit "8" in octal constant
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/target.h:21:21: note: in definition of macro ‘GETBDY’
#define GETBDY(x) ((x) / 1000000 + 2000)
^
src/osdep/target.h:26:22: note: in expansion of macro ‘MAKEBD’
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/amiberry.cpp:1152:14: note: in expansion of macro ‘AMIBERRYDATE’
y = GETBDY(AMIBERRYDATE);
^~~~
src/osdep/target.h:26:39: error: invalid digit "8" in octal constant
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/target.h:22:22: note: in definition of macro ‘GETBDM’
#define GETBDM(x) (((x) - (((x) / 10000) * 10000)) / 100)
^
src/osdep/target.h:26:22: note: in expansion of macro ‘MAKEBD’
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/amiberry.cpp:1153:14: note: in expansion of macro ‘AMIBERRYDATE’
*m = GETBDM(AMIBERRYDATE);
^~~~
src/osdep/target.h:26:39: error: invalid digit "8" in octal constant
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/target.h:22:30: note: in definition of macro ‘GETBDM’
#define GETBDM(x) (((x) - (((x) / 10000) * 10000)) / 100)
^
src/osdep/target.h:26:22: note: in expansion of macro ‘MAKEBD’
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/amiberry.cpp:1153:14: note: in expansion of macro ‘AMIBERRYDATE’
*m = GETBDM(AMIBERRYDATE);
^~~~
src/osdep/target.h:26:39: error: invalid digit "8" in octal constant
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/target.h:23:21: note: in definition of macro ‘GETBDD’
#define GETBDD(x) ((x) % 100)
^
src/osdep/target.h:26:22: note: in expansion of macro ‘MAKEBD’
#define AMIBERRYDATE MAKEBD(2020, 05, 08)
^~
src/osdep/amiberry.cpp:1154:14: note: in expansion of macro ‘AMIBERRYDATE’
*d = GETBDD(AMIBERRYDATE);
^~~~
make:
[: src/osdep/amiberry.o] Error 1
make: *
Waiting for unfinished jobs....

Compilation was execute on a recently updated RPi4 with Buster executing make -j2 PLATFORM=rpi4

I changed the #define AMIBERRYDATE MAKEBD(2020, 05, 08) to #define AMIBERRYDATE MAKEBD(2020, 05, 07) in src/osdep/target.h and that solved the issue.
08 is not an octal number :)

Probably an easy fix.

Meanwhile I will test with my "custom" build.

Confirmed working with my 8bitdo Pro2 Bluetooth Controller.

Awesome. Thank you and a very happy Friday!

Great!
Meanwhile, I also noticed and fixed the compilation problem.

On Fri, May 8, 2020, 16:01 mindtripper notifications@github.com wrote:

Confirmed working with my 8bitdo Pro2 Bluetooth Controller.

Awesome. Thank you and a very happy Friday!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/midwan/amiberry/issues/193#issuecomment-625830458,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5ST5JYFJ7VFHPJ4XUJI73RQQGEZANCNFSM4EKR3HXQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vretro picture vretro  Â·  5Comments

nemo93 picture nemo93  Â·  10Comments

Shawson picture Shawson  Â·  7Comments

jabulonboaz picture jabulonboaz  Â·  9Comments

phalkon13 picture phalkon13  Â·  3Comments