New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bluetooth passtrough? #155
Comments
|
+1 Bluetooth passthrough would be awesome! I have a wireless bluetooth spectrometer whose only two software choices are either a Windows software :( or an Android app. Together with Waydroid I could use it on my convertible laptop in classrooms. |
|
Yes please :-) This would be extremely useful :-))) |
|
In our initial tests, doing this leaves Linux host with no access to the hardware. We need to find a way for us to share access to BT hardware |
|
@electrikjesus I see! Thanks for letting us know! And best of luck (egoistically :-))) |
|
@electrikjesus would this help? I don't really know how much Android deviates from a "standard" Linux distro, that is too low level for me. https://medium.com/omi-uulm/how-to-run-containerized-bluetooth-applications-with-bluez-dced9ab767f6 Thanks a lot for all this work! :) |
|
I wonder if, as a workaround, it would be possible to utilize a (second) bluetooth dongle for bluetooth in waydroid exclusively, e.g. https://www.fivebelow.com/products/usb-c-bluetooth-adapter. |
|
Hi, would it be possible to get an update on this? (How the chances are that it might get added.) Many thanks!!! |
|
Bluetooth passthrough would be pretty nice! Any update on this? |
|
@electrikjesus i could use it even losing the bluetooth device from host machine while waydroid runs. i start waydroid service manually so i have no problem with that. |
|
A solution would be to implement a replacement (or overlay?) That would involve replacing a few of these classes with D-Bus stubs. Personally, I think we could leave out A2DP for now, it would conflict with the host's audio server anyway. Also, I think it has been done before, but with NDK BlueZ on bare-metal. |
|
Also also, a lot of the work connecting to BlueZ in Java has already been done in |
Are any of these kernel patches still necessary to run bluez-android (~2014?): http://bluez-android.github.io/#building-own-kernel |
|
@westurner doesn't look like it, they were patches back when Android's kernel was very bare-bones. Pretty much all Linux distros now have dynamic modules, Bluetooth and Ethernet bridging enabled as standard nowadays. Pretty sure those patches refer to running Bluez on an ancient Android kernel in the first place anyway. But using |
|
python-dbus-next
|
|
For me, I'd much rather have "bluetooth but the host system loses access to it" than "no bluetooth at all" -- the host system isn't actually using bluetooth for anything to begin with, so it's no loss, but I have a lot of uses for it in waydroid. |
|
Bluetooth for waydroid would be highly desirable. |
|
Did anybody find a workaround so far? |
|
Any news? Please we need it |
|
Hello With QEMU I use udev rules to pass usb device. I use a second bluetooth device for QEMU VM and a second webcam (an old one) in /etc/udev/rules.d/ with the contents #Logitech, Inc. C270 Webcam Broadcom Corp. BCM20702A0 Bluetooth 4.0SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="21e8", GROUP="kvm", MODE:="0666" then i update the rules sudo udevadm control --reload-rules Perhaps we can adapt the rules to waydroid. Perhaps we need to replace GROUP)="kvm" by GROUP="users" or something else. |
|
- Some dedicated USB Bluetooth adapters work with Waydroid in QEMU/KVM
- FWIU it is possible to share one Bluetooth adapter between Mac and
Windows for example, but you have to sync the pairing host keys between the
OSes.
- Presumably it's also possible to sync Bluetooth keys from a Linux host to
a Waydroid container or VM, running Gabeldorsche instead of Blues?
…On Wed, Jul 26, 2023, 10:31 AM promeneur ***@***.***> wrote:
Hello
With QEMU I use udev rules to pass usb device.
I use a second bluetooth device for QEMU VM and a second webcam (an old
one)
in /etc/udev/rules.d/
i create a file 50.qemu.rules
with the contents
#Logitech, Inc. C270 Webcam
SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0825",
GROUP="kvm", MODE:="0666"
Broadcom Corp. BCM20702A0 Bluetooth 4.0
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="21e8",
GROUP="kvm", MODE:="0666"
then
i update the rules
sudo udevadm control --reload-rules
sudo udevadm trigger --attr-match=subsystem=usb
Perhaps we can adapt the rules to waydroid.
Perhaps we need to change GROUP)="kvm" by GROUP="users" or something else.
—
Reply to this email directly, view it on GitHub
<#155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMNS4RP4SJZN62VF3FS4DXSES3VANCNFSM5GAKM4JQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Just thinking. In my very humble oppinion. A passthrough should be possible if waydroid being a container and therefore some sort of VM it could emulate the bluetooth hardware like it is done with the WiFi connection. Or am I wrong? It would really be good to sync at least sometimes apps over bluetooth. |
|
/? linux bluetooth simulator emulator bumble
gabeldorsche // bluez
|
|
the same goes for the Sennheiser app, bluetooth passthrough would be very useful to change configs or even download firmware updates. Smartwatch apps too, Gadgetbridge, so many things. Essential for linux phones and just enabling that would solve it a lot |
|
I have this problem too. I need it for Sphero Edu. |
Oh so Gabeldorsche does support vendor-HAL Bluetooth, this is awesome news! (although it does mean we will have to enable Gabeldorsche in system by default, or use it as an "experimental Bluetooth support" switch) Basically we need to update vendor with a Gabeldorsche driver that communicates with host Bluez over D-Bus, and patches |
|
from what I could understand from the Arch wiki, waydroid uses a linux container (lxc), so according to these guys: https://forum.proxmox.com/threads/bluetooth-device-on-container.123772/ It should just work (? I mean, if it works with anbox, which is what I think is running inside the container, idk) maybe add a line corresponding to your device here https://github.com/waydroid/waydroid/blob/main/tools/actions/container_manager.py#L71 (in my pc it is here /usr/lib/waydroid/tools/actions/container_manager.py, use find -name container_manager.py to figure out where it is in yours) Haven't tested it myself, seems like a time sink... EDIT: I think this container_manager is only called when you create the waydroid image or something, so changing things there did nothing. With a little more digging I figured out that I could share the device putting this line: in I did I tried adding: to something like: Checking logcat with waydroid shell I can see that Bluetooth Intent fails. Then checking Truly a time sink. If anyone figures this out let me know. |
|
What we're discussing is allowing the Bluetooth device to be co-owned by the host and Waydroid guest. I don't believe amputating Bluetooth functionality from the host is part of Waydroid's design goals. |
|
Any workarounds in the meantime are appreciated. I rarely use Bluetooth devices on the host and would be happy to hand over the entire device to my Waydroid guest, temporarily. |
|
@Thesola10 No I dont think this is the idea. If its not possible to co-own bluetooth on two hosts, a switch could be implemented to do this on demand, and switch owners. But as it looks, as Waydroid runs in a container, it should be able to use Bluetooth from the Container. |
|
As noted earlier, for my part, the host doesn't use bluetooth at all, but it's absolutely mandatory on the guest for some of the stuff I want to use it for, so the guest stealing it from the host would be a-ok. If it's not possible for them to share, a |
|
This suggests that `--privileged` is not actually necessary, but it is
necessary to stop Bluetooth on the host, or presumably at least to only run
host bluez on Bluetooth devices not for use for a container:
https://stackoverflow.com/questions/28868393/accessing-bluetooth-dongle-from-inside-docker/57453220#57453220
:
docker run --cap-add=SYS_ADMIN --cap-add=NET_ADMIN --net=host -it
debian:jessie
https://www.google.com/search?q=%22bluetooth%22+pci+device+passthrough+docker
…On Sun, Nov 19, 2023, 9:05 AM B. Kelly ***@***.***> wrote:
As noted earlier, for my part, the host doesn't use bluetooth at all (I'm
not sure it even has a bluetooth controller) but it's absolutely mandatory
on the guest for some of the stuff I want to use it for, so the guest
stealing it from the host would be a-ok. If it's not possible for them to
share, a --bluetooth-takeover option or something seems appropriate.
—
Reply to this email directly, view it on GitHub
<#155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMNSYIVWW2NXJPZLPDDOTYFIGY7AVCNFSM5GAKM4J2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRG44DMNJUGUYQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Waydroid should have access to bluetooth devices connected to the host machine mainly, not the BT hardware itself as it compromises the use of other BT devices on the host. If the system administrator decides, Waydroid should be able to own BT hardware. |
Couldn't agree more with @IPlayZed. I have a cheap WiFi + Bluetooth dongle on hand, if it were easy to pass in that one USB device I would have all of the wireless capability I'm looking for in Waydroid for with none of the (valid) ownership issues mentioned above. |
|
Here are a number of methods of getting the docker/podman/nerdctl
`--device` flag to work with cgroups and hotplugging:
https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device
Would dumb_udev help with lower-level bluetooth passthrough?
- https://github.com/Steam-Headless/dumb-udev/blob/master/dumb_udev/service.py
- https://github.com/Steam-Headless/docker-steam-headless/blob/6cc9f56155f3c7f9fc6bc9c22ef2cbf555029c00/Dockerfile.debian#L501-L518
- https://github.com/Steam-Headless/docker-steam-headless/blob/6cc9f56155f3c7f9fc6bc9c22ef2cbf555029c00/overlay/etc/supervisor.d/udev.ini
- https://github.com/Steam-Headless/docker-steam-headless/blob/6cc9f56155f3c7f9fc6bc9c22ef2cbf555029c00/overlay/usr/bin/start-udev.sh
- https://github.com/Steam-Headless/docker-steam-headless/blob/6cc9f56155f3c7f9fc6bc9c22ef2cbf555029c00/overlay/usr/bin/start-dumb-udev.sh
|
|
any news..? |
I am sure that if progress is made you will se it in the thread, polluting it is useless. You can also help out yourself either by commenting ideas or providing changes. |
|
I read the whole thread and it's rather difficult for me to guess the outcome....and sorry if the following is non sense 😊... |
|
What you are referring to is a portals-like solution. In that scenario, the container does not get full control over the given hardware, but represents itself as a virtual device. Waydroid is LXC based, I am not sure how this would work, LXC's capabilities would determine this. The other option is passthrough where a given hardware entity responsible for Bluetooth is assigned to the container (similar to GPU passthrough), this the container has full control of the hardware. This might be required for Bluetooth or similar hardware to work correctly in the container. In my opinion the issue is not only Bluetooth but a lack of universal hardware abstraction between the container and the host system. Not just Bluetooth, but webcams, FIDO keys, etc. whatever you can imagine. As the underlying stacks might not support it, this might be a significantly harder challenge then it seems like. I think an issue should be created and possibilities currently available regarding LXC's capabilities should be mapped out as a very first step. |
|
As someone who usually does not code, I am very interested in a solution and I highly apppreciate every contribution to resolve this issue. If waydroid Bluetooth path through works, I could get my Pinephone from the the screed and use it with Waydroid, Softmaker Office and a Bluetooth keyboard. Since LibreOffice on the Pinephone was a very negative experience for someone like me who usually does not code: https://forum.pine64.org/showthread.php?tid=16614 Thank you all for being active resolving this isse, I am very interested in a solution. The Pinephone can also be used with the non Bluetooth Pinephone keyboard, but Waydroid Bluetooth pass through makes also Ubports phones again interesting for us personally. |
|
- determine which Bluetooth stack is on the host
- determine which Bluetooth stack is in the container (Waydroid: )
- determine which Bluetooth device to passthrough:
- PCI/USB ID
- kernel module
- device file path in /dev
- blacklist and/or uninitialize the host PCI || USB Bluetooth device before
starting the container
- determine how to not use a BT device with the host stack's
configuration system
- `echo "install modulename /bin/true" > /etc/modprobe.conf`
- start the container with all of /dev (not secure, because /dev/mem etc)
- start the container with just the necessary device files in /dev/
- start the necessary components in the container
- Linux: systemd, bluez, dbus?, bluetoothctl
- ChromiumOS: bluez,
- Android <= ?: bluez, dbus
- Android: fluoride, binder
- Android >= 13: gabeldorsche, binder
- Waydroid:
- LineageOS:
.
- https://source.android.com/docs/core/connect/bluetooth
- https://developer.android.com/guide/topics/connectivity/bluetooth
.
- https://android.googlesource.com/platform/packages/modules/Bluetooth
- https://android.googlesource.com/platform/system/bt
- https://github.com/LineageOS/android_system_bt/tree/lineage-19.1
-
https://github.com/LineageOS/android_packages_modules_Bluetooth/tree/lineage-20.0
-
https://github.com/LineageOS/android_packages_modules_Bluetooth/tree/lineage-21.0
- https://github.com/orgs/LineageOS/repositories?q=Bluetooth
Gabeldorsche
- "Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust"
https://news.ycombinator.com/item?id=26647981
https://www.google.com/search?q=Android+binder+Bluetooth ...
- https://github.com/droidian/bluebinder :
bluebinder is a simple proxy for using android binder based bluetooth
through vhci.
... "Vhci"
https://www.google.com/search?q=vhci
USB Virtual Host Controller Interface
.
https://esphome.io/components/bluetooth_proxy.html :
Note that while this component is named bluetooth_proxy, only BLE devices
(and their Home Assistant integrations) are supported
https://www.google.com/search?q=android+Bluetooth+proxy+site%3Agithub.com
- https://gist.github.com/joinAero/64e68c9d63987284f7f0
- https://github.com/IvBaranov/RxBluetooth
…On Sun, Feb 4, 2024, 5:42 AM Meditation Research Institute Switzerland < ***@***.***> wrote:
As someone who usually does not code, I am very interested in a solution
and I highly apppreciate every contribution to resolve this issue. If
waydroid Bluetooth path through works, I could get my Pinephone from the
the screed and use it with Waydroid, Softmaker Office and a Bluetooth
keyboard. Since LibreOffice on the Pinephone was a very negative experience
for someone like me who usually does not code:
https://forum.pine64.org/showthread.php?tid=16614
Thank you all for being active resolving this isse, I am very interested
in a solution.
—
Reply to this email directly, view it on GitHub
<#155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMNS6UODKMBKJJIC447YTYR5Q27AVCNFSM5GAKM4J2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJSGU3DSMRXGI2Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
- Bumble
- ANDROID EMULATOR TRANSPORT:
https://google.github.io/bumble/transports/android_emulator.html
- VHCI transport: https://google.github.io/bumble/transports/vhci.html :
The VHCI transport allows attaching a virtual controller to the
Bluetooth stack on operating systems that offer a VHCI driver (Linux, if
enabled, maybe others)
…On Sun, Feb 4, 2024, 2:12 PM Wes Turner ***@***.***> wrote:
- determine which Bluetooth stack is on the host
- determine which Bluetooth stack is in the container (Waydroid: )
- determine which Bluetooth device to passthrough:
- PCI/USB ID
- kernel module
- device file path in /dev
- blacklist and/or uninitialize the host PCI || USB Bluetooth device
before starting the container
- determine how to not use a BT device with the host stack's
configuration system
- `echo "install modulename /bin/true" > /etc/modprobe.conf`
- start the container with all of /dev (not secure, because /dev/mem etc)
- start the container with just the necessary device files in /dev/
- start the necessary components in the container
- Linux: systemd, bluez, dbus?, bluetoothctl
- ChromiumOS: bluez,
- Android <= ?: bluez, dbus
- Android: fluoride, binder
- Android >= 13: gabeldorsche, binder
- Waydroid:
- LineageOS:
.
- https://source.android.com/docs/core/connect/bluetooth
- https://developer.android.com/guide/topics/connectivity/bluetooth
.
- https://android.googlesource.com/platform/packages/modules/Bluetooth
- https://android.googlesource.com/platform/system/bt
- https://github.com/LineageOS/android_system_bt/tree/lineage-19.1
-
https://github.com/LineageOS/android_packages_modules_Bluetooth/tree/lineage-20.0
-
https://github.com/LineageOS/android_packages_modules_Bluetooth/tree/lineage-21.0
- https://github.com/orgs/LineageOS/repositories?q=Bluetooth
Gabeldorsche
- "Android's new Bluetooth stack rewrite (Gabeldorsh) is written with
Rust" https://news.ycombinator.com/item?id=26647981
https://www.google.com/search?q=Android+binder+Bluetooth ...
- https://github.com/droidian/bluebinder :
> bluebinder is a simple proxy for using android binder based bluetooth
through vhci.
... "Vhci"
https://www.google.com/search?q=vhci
USB Virtual Host Controller Interface
.
https://esphome.io/components/bluetooth_proxy.html :
> Note that while this component is named bluetooth_proxy, only BLE
devices (and their Home Assistant integrations) are supported
https://www.google.com/search?q=android+Bluetooth+proxy+site%3Agithub.com
- https://gist.github.com/joinAero/64e68c9d63987284f7f0
- https://github.com/IvBaranov/RxBluetooth
On Sun, Feb 4, 2024, 5:42 AM Meditation Research Institute Switzerland <
***@***.***> wrote:
> As someone who usually does not code, I am very interested in a solution
> and I highly apppreciate every contribution to resolve this issue. If
> waydroid Bluetooth path through works, I could get my Pinephone from the
> the screed and use it with Waydroid, Softmaker Office and a Bluetooth
> keyboard. Since LibreOffice on the Pinephone was a very negative experience
> for someone like me who usually does not code:
>
> https://forum.pine64.org/showthread.php?tid=16614
>
> Thank you all for being active resolving this isse, I am very interested
> in a solution.
>
> —
> Reply to this email directly, view it on GitHub
> <#155 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAMNS6UODKMBKJJIC447YTYR5Q27AVCNFSM5GAKM4J2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJSGU3DSMRXGI2Q>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Thank you for your reply! |
Thank
Thank you very much for your detailed reply. Would this apply to both portals-like and passthru scenario or passthru only? |
Is it not possible for waydroid devs to add this package? Looks like it's 90% there - we just need to add in the "drivers" or the package on the Android side and it should have been working then? Most of the users here are happy to transfer the whole control to waydroid, if that means waydroid can use Bluetooth perfectly. |
|
As a "temporary" solution (like @ToxicFrog mentioned), I think it is important to pass main BT device to Waydroid. We also can design it to use multiple interfaces (if exists), so that host still can use BT. (And container will, too) First, check all BT devices currently connected to host. If multiple, (hci0, hci1, hci2...) check which one of these being actively used on host, and pass the "inactive" one. |

will this be added or not? or is it already?
The text was updated successfully, but these errors were encountered: