ValveSoftware / SteamVR-for-Linux

Issue tracker for the Linux port of SteamVR
910 stars 45 forks source link

Bluetooth not available w/ Index #207

Open slavfox opened 5 years ago

slavfox commented 5 years ago

Your system information

Please describe your issue in as much detail as possible:

SteamVR shows "Bluetooth not available". It is not possible to enable Base Station power management or wake them from standby. The same config works without a hitch on Windows.

It's a big problem, because the Index base stations are very loud and it's extremely irritating for them to be running 24/7, yet Bluetooth is required to put them into standby.

Steps for reproducing this issue:

  1. Connect Valve Index to USB 3.1 port (an USB 3.0 port didn't show bluetooth as available even on Windows)
  2. Open SteamVR
  3. Navigate to settings->bluetooth image
kisak-valve commented 5 years ago

Possible duplicate of #96.

darkstego commented 5 years ago

I have the same issue. Bluetooth on Index doesn't seem to work on Linux.

Vash63 commented 4 years ago

Same issue here, though I agree that this seems to be a duplicate of #96

beniwtv commented 4 years ago

Same issue #96 seems to be for the Vive, not the Index though. On the Index, Bluetooth can not even be enabled at all.

JulianGro commented 4 years ago

Same issue on Linux Mint 19.1 (Ubuntu 18.04). I have a working Bluetooth dongle installed as well.

Utopiah commented 4 years ago

Same for Ubuntu 19.04

Termuellinator commented 4 years ago

same on Manjaro/Kernel 5.2 is there any other way to enable the power management for the lighthouses?

mnn commented 4 years ago

Doesn't work on 5.2.8 (Manjaro) with any bluetooth device. My motherboard has a bluetooth support and I also tried a dongle, nothing is detected.

Termuellinator commented 4 years ago

i can connect to the lighthouses via the bluetooth-settings of the OS, but even when they are paired and connected, it doesn't appear in steamvr-settings...

prefiks commented 4 years ago

I prepared simple python program for switching between standby/normal mode: https://gist.github.com/prefiks/e614116fc3983a8e7e5fe326800dc101

Accepts 'on' or 'off' parameter to switch between those two modes, and it does that for all devices that it detects over bluetooth. It may require root access, and possibly also pairing those devices?

mnn commented 4 years ago

@prefiks I see some confetti, so it is working for others? When I try with dongle I am getting:

$ sudo ./light_houses.py off
Traceback (most recent call last):
  File "./light_houses.py", line 28, in <module>
    scanner.scan(2)
  File "/usr/lib/python3.7/site-packages/bluepy/btle.py", line 854, in scan
    self.stop()
  File "/usr/lib/python3.7/site-packages/bluepy/btle.py", line 803, in stop
    self._mgmtCmd(self._cmd()+"end")
  File "/usr/lib/python3.7/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
    raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'scanend' (code: 11, error: Rejected)

Scanning with bluetoothctl works, so the dongle should be fine.

With built-in bluetooth it works only for one basestation:

$ sudo ./light_houses.py off
Found LightHouse LHB-CAB8FCD0: address = da:20:79:4f:89:33
Found LightHouse LHB-B0634E90: address = ce:50:43:be:55:c9
Connecting to da:20:79:4f:89:33
Connecting to ce:50:43:be:55:c9
Traceback (most recent call last):
  File "./light_houses.py", line 32, in <module>
    lh.connect(device, addrType = btle.ADDR_TYPE_RANDOM)
  File "/usr/lib/python3.7/site-packages/bluepy/btle.py", line 445, in connect
    self._connect(addr, addrType, iface)
  File "/usr/lib/python3.7/site-packages/bluepy/btle.py", line 439, in _connect
    raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral ce:50:43:be:55:c9, addr type: random

Any idea what could be wrong with my setup?

prefiks commented 4 years ago

The first one i also get when i run without sudo, looks like scan require some extra permissions, for the second one maybe try pairing that device from bluetooth panel?

leinardi commented 4 years ago

@prefiks Not working for me too:

$ sudo ./lh.py off
Traceback (most recent call last):
  File "./lh.py", line 28, in <module>
    scanner.scan(2)
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 852, in scan
    self.start(passive=passive)
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 790, in start
    self._mgmtCmd("le on")
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd
    raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 17, error: Invalid Index)
Anden commented 4 years ago

@leinardi That's what I get when I don't have a bluetooth controller. The Index bluetooth chip doesn't work (at least not for me), so you need an external bluetooth dongle (or one on the motherboard).

kedodrill commented 4 years ago

Have there been any updates on this? I'd like to update the firmware for my base stations, but it looks like that's not possible yet in Linux. I'm on the SteamVR Beta and it still does not work.

I'm sort of surprised that I can't update the firmware simply by plugging in a micro usb cable to them -> my computer...maybe that could be a possible temporary workaround? I'm sure it's not that simple or anything, just an idea.

jcc10 commented 4 years ago

I mean I would just like to turn the stupid things off when I'm not using them so I don't have to unplug them.

Also, this should probably be 3 separate issues.

In this case I can see my phone from the Bluetooth menu in my settings menu. (Also the lighthouses I think.) But SteamVR refuses to acknowledge that I have Bluetooth.

llamasking commented 4 years ago
  • No Bluetooth on Vive (Don't have a vive so I don't know if that's still true)

Can confirm. There is no bluetooth on the Vive. I do have a checkbox that is ticked, but Bluedevil does not see it as a device.

kedodrill commented 4 years ago

@kisak-valve Are there any plans in place to get bluetooth working in SteamVR for Linux? I've been seeing a lot of bug fixes in SteamVR Beta, so that makes me hopeful that more features will be added later on after this seemingly bug fixing phase...if there was some official confirmation on possible plans to get bluetooth working on Linux, that would make me (and probably a lot of other people here) happy. Thank you.

Seegras commented 4 years ago

For the desperate: here's how to set the channel on the Vive base station 2.0 without bluetooth: https://holocafe.de/en/blog/posts/how-to-set-up-multiple-steamvr-20-base-stations

(The other question is: can we update base 2.0 from Linux via USB without bricking it like the old one? If no, isn't bluetooth then kinda really needed?)

TheCraiggers commented 4 years ago

Does @prefiks script work on Lighthouse 2 devices? Near as I can tell, you can't even discover / pair them. Tried with multiple dongles and even my phone.

If not, than this issue is even bigger for me. Unplugging these devices requires a ladder for my setup, but the noise is just maddening enough to make me do it.

prefiks commented 4 years ago

It stopped working after my lighthouses were updated, i didn't manage to get that script working again.

TheCraiggers commented 4 years ago

Well, crap. :(

smirgol commented 4 years ago

I also experience issues when trying to toggle the lighthouse boxes (2.0), sometimes it works, then it doesn't. Sometimes it toggles one box, but not the other. When I retry often enough, it then works at some point. I now use an usb bluetooth dongle, as this seems to work more reliably than the Index bluetooth.

Still, with the script posted above I always have my issues, unfortunately. I went and created a different script which makes use of gatttool to toggle the boxes, which works better for me - not everytime, but most of the time. It is a little bit more work to set it up, though, as you need to get the MAC addresses and add them to the script. For those who are interested, here is a guide and the script: gatttool script If you know your lighthouse MAC addresses already, you can skip step 2+3.

Draic commented 4 years ago

I also experience issues when trying to toggle the lighthouse boxes (2.0), sometimes it works, then it doesn't. Sometimes it toggles one box, but not the other. When I retry often enough, it then works at some point. I now use an usb bluetooth dongle, as this seems to work more reliably than the Index bluetooth.

Still, with the script posted above I always have my issues, unfortunately. I went and created a different script which makes use of gatttool to toggle the boxes, which works better for me - not everytime, but most of the time. It is a little bit more work to set it up, though, as you need to get the MAC addresses and add them to the script. For those who are interested, here is a guide and the script: gatttool script If you know your lighthouse MAC addresses already, you can skip step 2+3.

gatttool is deprecated. Getting input/output errors and not working. Maybe if you use older hardware or bluez versions

RPGHiro commented 3 years ago

Using smirgol's gattool method works reliably 100% of the time for me with a cheap Logilink bluetooth dongle.

silelmot commented 3 years ago

gatttool is deprecated, is there another option?

waylonflinn commented 3 years ago

This modified version of @prefiks script is working for me right now on Ubuntu 20.04

https://gist.github.com/waylonflinn/d525e08674ec3abb5c98cd41d1fd2f24

silelmot commented 3 years ago

doesnt work for me... just get errors (on arch) File "./lh.py", line 39, in <module> lh.connect(device, addrType = btle.ADDR_TYPE_RANDOM) File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 445, in connect self._connect(addr, addrType, iface)

UPDATE: Works now with a new bluetooth-dongle. dont know if 5.0 is necessary or my old dongle wasnt ok, but it works great now. just for completion i wanna point to this great guide: https://www.reddit.com/r/virtualreality_linux/comments/g02bi5/automatically_turn_on_and_off_base_stations_when/

  1. Set the launch options in Steam for SteamVR. /path/to/lh.py on; %command%; sleep 5; VR_PID=$(pidof vrserver); if [ -z $VR_PID ]; then echo "VR Server not found"; else while [ -d /proc/$VR_PID ]; do sleep 5; done; /path/to/lh.py off; fi; This simply runs the lh.py to turn the base stations on. Then executes the normal SteamVR stuff. And then waits for the process vrserver to terminate to turn the base stations off again.
DavidRisch commented 3 years ago

I made an improved version of the scripts posted here previously by @prefiks and @waylonflinn. It is more reliable, can start automatically with SteamVR and includes some additional features (e.g. switching the audio device automatically). https://github.com/DavidRisch/steamvr_utils Based on the age of this issue i don't think Valve will add Base Station power management to Linux any time soon. So feel free to suggest improvements to the utility.

Patola commented 3 years ago

Great, but at least for me, SteamVR already switches the audio automatically. I reckon it might conflict?

DavidRisch commented 3 years ago

Great, but at least for me, SteamVR already switches the audio automatically. I reckon it might conflict?

Strange, I always had problems with that. You can simply disable the audio component in the config file.

Patola commented 3 years ago

I will make some tests and try to publicize your script. Congratulations for it! I have made a primitive thing on steamvr start for myself with shell script, but yours is much more scalable. I have three base stations, let's see if it works for all of them.

Termuellinator commented 3 years ago

Great, but at least for me, SteamVR already switches the audio automatically. I reckon it might conflict?

Strange, I always had problems with that. You can simply disable the audio component in the config file.

I haven't had time yet to try it out, but thankyou for this anyway! :+1: Will your script also change to the correct output? The most annoying thing on my side is that my second monitor is HDMI and thus available as an audio device - so i have to switch the hdmi-output to hdmi4 everytime the index is connected.

DavidRisch commented 3 years ago

Will your script also change to the correct output?

Currently not (only the correct sink, not a specific port on that device). But it looks like that should be possible using pactl set-card-profile. I will add that feature. Thanks for the suggestion!

DavidRisch commented 3 years ago

@Termuellinator: The script now searches for any port with a connected device named 'Index HMD' (or containing 'VIVE') and switches to that port automatically. If it does not work for you (or someone else), please create an issue and include the output of pactl list cards while SteamVR is running and the log file.

Patola commented 3 years ago

Hey, David. Just to let you know, I have made some mention of your script in an article I published about VR on Linux, where I also tell about this bluetooth problem and others like it. https://boilingsteam.com/the-state-of-virtual-reality-on-linux/

DavidRisch commented 3 years ago

Thanks! Great article. In the "VR Tools, Add-ons and Utilities" section you mention "steamvr-tools", judging from the context I think you meant "steamvr-utils".

Patola commented 3 years ago

I will correct that, thanks.

dromer commented 3 years ago

Wow, can't believe this is still an open issue. It is super annoying that we can't simply manage device settings.

This is stupid.

ultrabear commented 3 years ago

quite a few internet searches eventually ended me up here
its depressing to see after multiple years its still an issue :(

thisiswinks commented 2 years ago

@lostgoat @kisak-valve Any Update on this?

I've just installed Arch and ran into the same/multiple issues.

Computer:

OS: Arch Linux x86_64

``` `+oooo: Kernel: 5.13.4-arch2-1 `+oooooo: Uptime: 44 mins -+oooooo+: Packages: 1451 (pacman) `/:-:++oooo+: Shell: bash 5.1.8 `/++++/+++++++: Resolution: 3840x1080 `/++++++++++++++: DE: Plasma 5.22.3 `/+++ooooooooooooo/` WM: KWin ./ooosssso++osssssso+` Theme: Breeze Dark [Plasma], Breeze [GTK2/3] .oossssso-````/ossssss+` Icons: [Plasma], breeze-dark [GTK2/3] -osssssso. :ssssssso. Terminal: konsole :osssssss/ osssso+++. CPU: AMD Ryzen 7 5800X (16) @ 3.800GHz /ossssssss/ +ssssooo/- GPU: AMD ATI Radeon RX 6800/**6800 XT** / 6900 XT `/ossssso+/:- -:/+osssso+- Memory: 4841MiB / 32015MiB ```


Original issue:

Error 307

Which showed Error: setcap of vrcompositor-launcher failed. (https://github.com/ValveSoftware/SteamVR-for-Linux/issues/234)

I ran

sudo setcap CAP_SYS_NICE+ep ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher

Which got rid of the 307 error ( After reboot), but STILL does not have any controls for Bluetooth.

When I go to Bluetooth settings I See:

X Bluetooth not available

image image image


A few random notes,

I've also done these things https://wiki.archlinux.org/title/Virtual_reality#OpenVR_/_SteamVR

I'm just dumping everything here, but let me know what else is needed.

I'm more than willing to run tests if needed

G0BL1N commented 1 year ago

Another year has passed. @kisak-valve Is there any chance this will be fixed at some point? Can we get some updates on the issue?

earldbjr commented 1 year ago

A workaround I've been using flawlessly is an app called "Lighthouse PM" on the android app store (can't speak to apple's). Icon is a picture of a lighthouse with a RGB background. Works as flawlessly as the steamvr interface should.

Utopiah commented 1 year ago

In that case relying https://github.com/jeroen1602/lighthouse_pm#linux-builds might be better, no phone involved.

yaomtc commented 1 year ago

Also these Python scripts I have linked here...

EDIT: added steamvr_utils, linked below, to the document linked above.

Termuellinator commented 1 year ago

As they all rely on manual switching, i think mentioning https://github.com/DavidRisch/steamvr_utils again is worth it for those not reading the whole thread - putting the daemon in the steam vr launch arguments makes it really seamless :+1:

G0BL1N commented 1 year ago

Thank you all for mentioning alternative solutions. And it's definitely a good thing at least those has been developed (and many of them!), but I'm sure we all would really like to hear a reply from Valve. It would be really nice if this issue can be at least looked at and hopefully fixed.

Patola commented 1 year ago

I'm also very curious as to why such a basic feature wasn't implemented in Linux's SteamVR, maybe it's so different that adding code for it would make the main version -- the windows version -- have issues? It's not the only very basic feature that's missing, we have other things like the VR screenshot hotkey and the likes (and it seems to be only the screenshot hotkey, because the functionality seems to work in games that trigger it, like No Man's Sky).

Anyway, if Valve does not have time/resources to fix these issues, I think it should reveal the code with an open-source license for contributors to do it for them.

ViktorWalter commented 1 year ago

Agreed, we can probably make it work. But I'm yet to see a proprietary project that would get opened just to let community finish it.

yaomtc commented 1 year ago

HTC contributed the firmware for the Vive's Broadcom Bluetooth radio, under license from Broadcom:

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENCE.broadcom_bcm43xx?id=f472074db02b93ea4381d0aada906e28481cb7c6

The "Valve VR Radio" uses their own VID of 28de, but the PID is 2102, the same PID as Broadcom's ANYCOM Blue USB-200/250, which I can only find Windows drivers for. If this is the same radio, Valve would need to work with Broadcom to get a Linux driver.

EDIT: For reference, the Vive uses the Broadcom BCM920703, aka 0BB4:0306, "Vive Hub Bluetooth 4.1" / "Vive Bluetooth 4.1"

EDIT2: the driver already exists