Direct Bluetooth gamepad support

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

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

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Direct Bluetooth gamepad support

Postby Sorgelig » Fri Mar 29, 2019 2:41 pm

After thinking and judging different options i came to conclusion: it's better to add direct BT dongles support in Linux.
There is a question how to make pairing convenient. I will release first version with just enabled BT support and command line utilities to pair the devices. Probably some reliable way can be found later and implemented.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Fri Mar 29, 2019 7:24 pm

Update: BT works fine. Connected two SN30 Pro controllers to one BT receiver (robbed my RPi2). So it's definitely a good way.
The only quirk is manual pairing through console.
May be some script can be used for pairing.

Nuclear3D
Retro freak
Retro freak
Posts: 16
Joined: Thu Dec 13, 2018 8:20 pm

Re: Direct Bluetooth gamepad support

Postby Nuclear3D » Sat Mar 30, 2019 12:04 am

woah i cant wait for this feature to be fleshed out as i own a bunch of 8bitdo controllers and at 20 dollars a pop for the bt receivers its getting a bit much for both USB space and money.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Sat Mar 30, 2019 8:23 am

PS3 over BT works bad. It seems accelerometer sends the same axes codes as left stick. This is weird. May be driver problem.
So, for PS3 (and probably PS4) still 8bitdo or Mayflash is required.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Sat Mar 30, 2019 1:24 pm

Today i've bought 3 more BT dongles in local store. All are different (at least from appearance).
All of them started to work right away. (I wish WiFi dongles would work the same way).

So, direct BT support is less problematic than WiFi.
I've made a pairing script. It works OK in general, so can be used till better pairing procedure will be provided.

brNX
Atari maniac
Atari maniac
Posts: 79
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Direct Bluetooth gamepad support

Postby brNX » Sat Mar 30, 2019 3:10 pm

Sorgelig wrote:Today i've bought 3 more BT dongles in local store. All are different (at least from appearance).
All of them started to work right away. (I wish WiFi dongles would work the same way).

So, direct BT support is less problematic than WiFi.
I've made a pairing script. It works OK in general, so can be used till better pairing procedure will be provided.


Hi

I believe most bluetooth dongles use the CSR ( Cambridge Silicon Radio) or Broadcom chips , so in this case it's good that you don't have a lot of choice :D. I have yet to find one that needed special support on linux.

Nuclear3D
Retro freak
Retro freak
Posts: 16
Joined: Thu Dec 13, 2018 8:20 pm

Re: Direct Bluetooth gamepad support

Postby Nuclear3D » Sat Mar 30, 2019 3:21 pm

This is great news for a lot of different reasons, one of my most wanted additions for mister is now coming and i couldn't be happier.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Sat Mar 30, 2019 8:17 pm

After checking on Windows, 3 dongles are CSR8510 and one dongle is BCM207x
So, yeah, not a big choice which is definitely good.

zomgugoff
Atari nerd
Atari nerd
Posts: 47
Joined: Tue Jan 29, 2019 10:12 am

Re: Direct Bluetooth gamepad support

Postby zomgugoff » Sat Mar 30, 2019 11:58 pm

By not using the 8bitdo dongles, I'm assuming we're going lose PSC combos. Do you have plans to replicate this ability?

glaucon1984
Atariator
Atariator
Posts: 29
Joined: Fri Aug 04, 2017 12:23 pm

Re: Direct Bluetooth gamepad support

Postby glaucon1984 » Sun Mar 31, 2019 2:37 am

Can this be also used to pair a BT mouse or keyboard (or combo)?
Is it possible to map one of the 3 buttons on the I/O board to initiate the pairing of controllers? It would be great if we can use one of the LED indicators to signal the pairing/searching/connected mode by its blinking speed.

THaase
Captain Atari
Captain Atari
Posts: 169
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: Direct Bluetooth gamepad support

Postby THaase » Sun Mar 31, 2019 6:53 am

zomgugoff wrote:By not using the 8bitdo dongles, I'm assuming we're going lose PSC combos. Do you have plans to replicate this ability?

We do not loose anything - it's an (great) addition - so feel free still to use the 8bitdo receiver

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Sun Mar 31, 2019 12:46 pm

A big dilemma: BlueZ 4 or BlueZ 5?
BlueZ 5 from what really useful i've noticed only has SixAxis plugin. But from my testing PS3 controller is completely unreliable - somehow it reports accelerometer as left analog stick which means messages flood.
Big drawback of BlueZ 5 completely bastardized pairing procedure. You have to use bluetoothctl utility which has no way to control it from script. All scripts i've found are based on interprocess communicating by catching bluetoothctl's output and feed the commands simulating keyboard input. It's slow and not so reliable. Couldn't find a simple commands through dbus-send for pairing.

BlueZ 4 doesn't have SixAxis plugin but as far as i know there is 3rd party app helping with pairing of PS3 gamepad. But as i've told above need to find the way to shut down the accelerometer first.
BlueZ4 has a good and simple way to pair through script which at this stage looks as a big advantage over v5.

I don't have other BT gamepads besides those from 8bitdo. I found that if i connect all my 3 8bitdo gamepads then after recconnect at least one of them (every time different) doesn't want to connect and i have to pair it again. No idea if this is 8bitdo specific or BlueZ problem. It's the same for BlueZ 4 and 5.

Nuclear3D
Retro freak
Retro freak
Posts: 16
Joined: Thu Dec 13, 2018 8:20 pm

Re: Direct Bluetooth gamepad support

Postby Nuclear3D » Sun Mar 31, 2019 10:29 pm

I know it sounds kinda selfish on my part but i'd rather have the 8bitdo controllers work over the ps3 or ps4 controllers seeing as you can get 8bitdo controllers with analogs anyway

glaucon1984
Atariator
Atariator
Posts: 29
Joined: Fri Aug 04, 2017 12:23 pm

Re: Direct Bluetooth gamepad support

Postby glaucon1984 » Sun Mar 31, 2019 10:55 pm

In my opinion I think it's preferable to give priority to devices that try to follow standards first, and leave proprietary/custom/exotic protocols as a secondary objective.

I would much prefer to ensure a painless support of standard BT devices like 8bitdo gamepads, which in general are cheaper, and in many cases better suited for the kind of systems supported by MiSTer.

zomgugoff
Atari nerd
Atari nerd
Posts: 47
Joined: Tue Jan 29, 2019 10:12 am

Re: Direct Bluetooth gamepad support

Postby zomgugoff » Sun Mar 31, 2019 11:58 pm

Sorgelig wrote:I don't have other BT gamepads besides those from 8bitdo. I found that if i connect all my 3 8bitdo gamepads then after recconnect at least one of them (every time different) doesn't want to connect and i have to pair it again. No idea if this is 8bitdo specific or BlueZ problem. It's the same for BlueZ 4 and 5.


That's weird. It sounds like BlueZ isn't storing remote device addresses like it's supposed to. Maybe it's an option that's disabled? Or it's trying to store them somewhere that isn't permanent?

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Mon Apr 01, 2019 2:36 am

Nuclear3D wrote:seeing as you can get 8bitdo controllers with analogs anyway

i don't understand what you mean.
Analog sticks on 8bitdo gamepads are supported.

Nuclear3D
Retro freak
Retro freak
Posts: 16
Joined: Thu Dec 13, 2018 8:20 pm

Re: Direct Bluetooth gamepad support

Postby Nuclear3D » Mon Apr 01, 2019 3:53 am

What i meant was for people who want analogue controllers you can purchase a 8bitdo controller over a ps3 or ps4 controller because you were saying for now that the playstation controllers were acting up with the current bluetooth implementation

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Mon Apr 01, 2019 10:37 am

I've already fixed the PS3 gamepad by blocking the accelerometer.
It has no relation to analog sticks.

brNX
Atari maniac
Atari maniac
Posts: 79
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Direct Bluetooth gamepad support

Postby brNX » Mon Apr 01, 2019 2:43 pm

Sorgelig wrote:A big dilemma: BlueZ 4 or BlueZ 5?
BlueZ 5 from what really useful i've noticed only has SixAxis plugin. But from my testing PS3 controller is completely unreliable - somehow it reports accelerometer as left analog stick which means messages flood.
Big drawback of BlueZ 5 completely bastardized pairing procedure. You have to use bluetoothctl utility which has no way to control it from script. All scripts i've found are based on interprocess communicating by catching bluetoothctl's output and feed the commands simulating keyboard input. It's slow and not so reliable. Couldn't find a simple commands through dbus-send for pairing.

BlueZ 4 doesn't have SixAxis plugin but as far as i know there is 3rd party app helping with pairing of PS3 gamepad. But as i've told above need to find the way to shut down the accelerometer first.
BlueZ4 has a good and simple way to pair through script which at this stage looks as a big advantage over v5.

I don't have other BT gamepads besides those from 8bitdo. I found that if i connect all my 3 8bitdo gamepads then after recconnect at least one of them (every time different) doesn't want to connect and i have to pair it again. No idea if this is 8bitdo specific or BlueZ problem. It's the same for BlueZ 4 and 5.


Have you tried this script with Bluez5 ? https://gist.github.com/RamonGilabert/0 ... b4d9fb0055
was curious why it wouldn't work and found this thread over on linuxquestions https://www.linuxquestions.org/question ... 175615328/.

maybe it's what you are refering to.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Mon Apr 01, 2019 3:37 pm

brNX wrote:Have you tried this script with Bluez5 ? https://gist.github.com/RamonGilabert/0 ... b4d9fb0055
was curious why it wouldn't work and found this thread over on linuxquestions https://www.linuxquestions.org/question ... 175615328/.

yeah, i've tried it and played long time. I did many modifications to that script and even achieved some usable point. But it's nothing comparing how easy it's in BlueZ 4.
Anyway i've decided to go with BlueZ 4. I've made some modification to make possible to pair and use PS3 gamepad, so there are no real advantages in BlueZ 5 now.

brNX
Atari maniac
Atari maniac
Posts: 79
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Direct Bluetooth gamepad support

Postby brNX » Mon Apr 01, 2019 6:45 pm

yes I agree , there's probably no point in going BlueZ 5 for now.

guvner
Atariator
Atariator
Posts: 21
Joined: Sun Dec 09, 2018 12:32 am

Re: Direct Bluetooth gamepad support

Postby guvner » Wed Apr 03, 2019 10:55 pm

how can I remove devices from the trusted devices list?

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Thu Apr 04, 2019 3:34 am

guvner wrote:how can I remove devices from the trusted devices list?

never thought about this. Why you need it?
You can reset bluetooth settings by removing /linux/bluetooth file and reboot the MiSTer

guvner
Atariator
Atariator
Posts: 21
Joined: Sun Dec 09, 2018 12:32 am

Re: Direct Bluetooth gamepad support

Postby guvner » Thu Apr 04, 2019 10:32 am

I was testing, if your instructions for the ps3 controller would also work on a ps4 pad. It didn't work, but my MiSTer connected to something else instead. I don't usually keep bluetooth active in my devices when not in use, but I do see ones from my neighbours fairly regularly, so it might have been one of those...

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4730
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Direct Bluetooth gamepad support

Postby Sorgelig » Thu Apr 04, 2019 1:29 pm

PS4 is generic BT gamepad. So pairing must be like a standard gamepad.
Pairing procedure connects only to devices in pairing mode. So it's not related to those BT hosts in advertise mode.


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 2 guests

cron