Direct Bluetooth gamepad support

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5595
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Tue May 28, 2019 6:49 am

For me DS4 works fine. May be it was coincidence with some other your changes.
You can try to install previous update and see if it solves the problem.

User avatar
Xtro
Atari maniac
Atari maniac
Posts: 84
Joined: Fri Jan 09, 2015 11:47 am
Location: Spain

Re: Direct Bluetooth gamepad support

Postby Xtro » Tue May 28, 2019 10:31 pm

Hi I am trying to pair an 8bitdo M30 bluetooth controller with a bluetooth dongle I just purchased. I am using a powered USB 1.1 hub and not abble to pair, doesn't find nothing. The dongle is this one http://www.minihere.com/csr4-0-usb-2-0-bluetooth-4-0-adapter-driver-download.html but tried with other usb 2.1 and don't work neither. In windows both dongles pair correctly with 8bitdo controller. 8bitdo controller works ok with mister if used with usb cable.

EDIT: Now it works, don't know exactly what caused it, but I synced a DualShock 3 pad and then tried again with 8bitdo M30 and it just works fine

User avatar
ono
Atariator
Atariator
Posts: 20
Joined: Sun Aug 18, 2019 11:22 am
Location: Switzerland
Contact:

Re: Direct Bluetooth gamepad support

Postby ono » Wed Aug 28, 2019 11:34 pm

Little question, is it known issue that btpair fails with bash syntax error when hcitool reports multiple devices? In such case grep returns multiple MACs separated by new line, then everything gets assigned to single MAC variable, that is later used as if it held only one MAC. I saw that when running it from console. Otherwise from OSD it was showing "Nothing found".

Btw. does this bash script belong to some Github project other than https://github.com/MiSTer-devel/Linux_Image_creator_MiSTer? I could send some PR or a patch, but I need to know where to 8)
Last edited by ono on Wed Aug 28, 2019 11:45 pm, edited 2 times in total.
Grown up playing/learning to program Atari 130XE. FM synth and tech nerd. | github.com/nanoant

User avatar
ono
Atariator
Atariator
Posts: 20
Joined: Sun Aug 18, 2019 11:22 am
Location: Switzerland
Contact:

Re: Direct Bluetooth gamepad support

Postby ono » Wed Aug 28, 2019 11:35 pm

Btw. I wonder then what shall we do in such a case? Stop, pair first device only, try to pair them all, check if the device is USB joystick class (as long hci can tell us that) or give a choice to the user? WDYT? And is it okay btpair tries to pair anything blindly, even something that may not belong to us (and be harmful?)?
Grown up playing/learning to program Atari 130XE. FM synth and tech nerd. | github.com/nanoant

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5595
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Thu Aug 29, 2019 4:56 am

btpair is used in unattended way, so it expects only one scenario. Basically it's good to shutdown all your BT devise except the one you want to pair.

Otherwise you may create some script for dialog package which you can use in Linux framebuffer. Like ini settings script.
The repo you've mentioned is correct.

User avatar
ono
Atariator
Atariator
Posts: 20
Joined: Sun Aug 18, 2019 11:22 am
Location: Switzerland
Contact:

Re: Direct Bluetooth gamepad support

Postby ono » Thu Aug 29, 2019 11:13 am

Sorgelig wrote:Basically it's good to shutdown all your BT devise except the one you want to pair.

I believe the other device comes from the neighborhood, so there's nothing I can do about it. The radio is extremely cluttered here e.g. finding free WiFi channel is quite challenging.

Sorgelig wrote:Otherwise you may create some script for dialog package which you can use in Linux framebuffer. Like ini settings script. The repo you've mentioned is correct.

Using dialog package looks like a neat solution. I'll try to come with some btpair update that can handle multiple devices and will send you a patch if it proves to be useful.
Thanks.
Grown up playing/learning to program Atari 130XE. FM synth and tech nerd. | github.com/nanoant

Freddo
Atarian
Atarian
Posts: 6
Joined: Tue Apr 02, 2019 9:37 pm

Re: Direct Bluetooth gamepad support

Postby Freddo » Tue Sep 17, 2019 12:11 am

Just picked up this stick for some Neogeo action:

https://www.play-asia.com/hori-wireless-real-arcade-prov3-sa/13/706nb9

Wired mode is working great, no worries there, but the Bluetooth wont pair with MiSTer. It's claimed online this stick is "a dualshock 3 in a stick" so I was sort of hoping it would work. I'm following the procedure for pairing a PS3 controller with no luck.

Anything else I can do to get it working? maybe its ID just needs adding to a list of PS3 controller Ids or something I was hoping.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5595
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Tue Sep 17, 2019 6:15 am

Freddo wrote:Just picked up this stick for some Neogeo action:

https://www.play-asia.com/hori-wireless-real-arcade-prov3-sa/13/706nb9

Wired mode is working great, no worries there, but the Bluetooth wont pair with MiSTer. It's claimed online this stick is "a dualshock 3 in a stick" so I was sort of hoping it would work. I'm following the procedure for pairing a PS3 controller with no luck.

Anything else I can do to get it working? maybe its ID just needs adding to a list of PS3 controller Ids or something I was hoping.

i don't know to which extent it's the same as DS3. The one who has this controller and can tinker with Linux drivers can try to add support. I don't have such controller.

robbo43
Retro freak
Retro freak
Posts: 10
Joined: Sat Feb 03, 2018 10:58 pm

Re: Direct Bluetooth gamepad support

Postby robbo43 » Wed Sep 18, 2019 6:42 pm

Freddo wrote:Just picked up this stick for some Neogeo action:

https://www.play-asia.com/hori-wireless-real-arcade-prov3-sa/13/706nb9

Wired mode is working great, no worries there, but the Bluetooth wont pair with MiSTer. It's claimed online this stick is "a dualshock 3 in a stick" so I was sort of hoping it would work. I'm following the procedure for pairing a PS3 controller with no luck.

Anything else I can do to get it working? maybe its ID just needs adding to a list of PS3 controller Ids or something I was hoping.


Yes I have the same thing, I think it's due to being a 3rd party ps3 controller. I have one DS3 (genuine) that paired straight away, and another that was sold as a genuine DS3 controller that won't pair (turns out a chinese clone, it's pretty good quality though). The chinese clone works great when wired.

User avatar
ono
Atariator
Atariator
Posts: 20
Joined: Sun Aug 18, 2019 11:22 am
Location: Switzerland
Contact:

Re: Direct Bluetooth gamepad support

Postby ono » Wed Dec 04, 2019 10:28 pm

Can anyone provide a model of BT dongle that can support 3 gamepad connections? I have StarTech USBBT1EDR4 Class 1 BT 4.0 based listed as CSR8510 A10 and I can connect max two DS4 gamepads, third always fails to connect, whatever order I try connecting them.

Alexey provides some evidence at https://github.com/MiSTer-devel/Main_Mi ... /Bluetooth that having 3 gamepads is doable “Depends on environment condition (how many WiFi spots and active BT devices are around) you may connect more or less BT devices at the same time. In my place i could successfully connect 3 BT devices at the same time. The 4th one couldn't be connected till i turn off one of connected. Other BT dongle allowed only 2 gamepads at the same time.”

Unfortunately no specific information about dongle models were given there. And not sure what exactly makes one BT4 dongle support more and other less devices.
Grown up playing/learning to program Atari 130XE. FM synth and tech nerd. | github.com/nanoant

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5595
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Wed Dec 04, 2019 10:42 pm

Broadcom BT allowed me to connect 3 gamepads. CSR usually 2.

User avatar
ono
Atariator
Atariator
Posts: 20
Joined: Sun Aug 18, 2019 11:22 am
Location: Switzerland
Contact:

Re: Direct Bluetooth gamepad support

Postby ono » Thu Dec 05, 2019 5:57 pm

Sorgelig wrote:Broadcom BT allowed me to connect 3 gamepads. CSR usually 2.

Thanks for the response. I have progressed a little further and the problem may be not with the devices/chips themselves, but with Linux BT stack having some problem with handling more than two devices connected in SLAVE mode as suggested at: https://askubuntu.com/questions/1072565 ... ad/1081436

I followed description from the link above and I managed to connect my 3 DualShocks with CSR dongle. The trick was to switch the one/ones connected already to master mode via hcitool sr MAC m then connecting 3rd one succeeds connecting as SLAVE. It requires escaping to console, but works. Possibly this could allow connecting even 4, but I don't have that many :)

Code: Select all

/root# hcitool con
Connections:
   > ACL 01:xx:xx:xx:xx:xx handle 63 state 1 lm SLAVE AUTH ENCRYPT
   > ACL 02:xx:xx:xx:xx:xx handle 71 state 1 lm SLAVE AUTH ENCRYPT
/root# hcitool sr 02:xx:xx:xx:xx:xx m
/root# hcitool con
Connections:
   > ACL 01:xx:xx:xx:xx:xx handle 63 state 1 lm SLAVE AUTH ENCRYPT
   > ACL 02:xx:xx:xx:xx:xx handle 71 state 1 lm MASTER AUTH ENCRYPT
   > ACL 03:xx:xx:xx:xx:xx handle 81 state 1 lm SLAVE AUTH ENCRYPT
(real MACs edited out)

Could you check on your BCM20702 dongle if you can get 3 devices connected as SLAVE? If not this would confirm observations above.
Grown up playing/learning to program Atari 130XE. FM synth and tech nerd. | github.com/nanoant

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5595
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Thu Dec 05, 2019 7:56 pm

Very interesting findings!
Currently i cannot check it on my setup as i need to prepare the config.
But i did nothing special to connect 3 gamepads to BCM.
Will check later.

balakov
Atarian
Atarian
Posts: 1
Joined: Wed Aug 07, 2019 5:28 pm

Re: Direct Bluetooth gamepad support

Postby balakov » Fri Dec 20, 2019 8:40 am

I've just picked up a Logitech K380 bluetooth keyboard (mostly because it was the top rated one on Wirecutter, and it was on sale), and it doesn't pair with MiSTer out of the box unfortunately. For anyone else who gets to this thread via Googling, I managed to get it to pair by making a small change to the "/sbin/btpair" script.

if you find this line

Code: Select all

pair-agent hci0 $MAC

and change it to

Code: Select all

pair-agent hci0 $MAC -c KeyboardOnly

You should get the correct pairing promt (it will ask you to type '1234' and enter)

I've no idea why the K380 doesn't respond to the default "KeyboardDisplay" bluetooth capability, and after the couple of hours I spent debugging this last night, I'm not that keen on spending more time finding out! In theory you should be able to revert the btpair changes after pairing the K380.


Return to “MiSTer”

Who is online

Users browsing this forum: Atmosfear, reflex and 7 guests