ValveSoftware / SteamVR-for-Linux

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

Bluetooth functionality #96

Open ChristophHaag opened 6 years ago

ChristophHaag commented 6 years ago

We know, there is no bluetooth stuff for Linux implemented in SteamVR. But the GUI exposes the settings and doesn't even say that it's not available and instead gives nondescript error messages like screenshot_20180226_015734 or screenshot_20180226_020442

My commit to enabling the Vive Bluetooth Adapter in the kernel has been released upstream for quite a and my basestations are paired. Implementing bluetooth support on top of bluez should not be that hard at this point.

h1z1 commented 6 years ago

This is one weird little bug because I've had bluetooth work, then fail for completely unknown reasons. Sometimes resetting the devices works but others I have to restart steam entirely. Was still never able to get the bricked firmware updated on one of the lightboxes though.

ChristophHaag commented 6 years ago

Interesting, I was under the impression it just wasn't implemented at all. But indeed I see some messages. with grep Bluetooth ~/.local/share/Steam/logs/vrmonitor.txt that look like it's trying to do something:

Do Mär 01 2018 18:33:55.406612 - [Bluetooth Controller] BaseStation Controller Init.
Do Mär 01 2018 18:33:55.406814 - [Bluetooth Controller] Activate Basestation Controller.
Do Mär 01 2018 18:33:55.419402 - [Dismissable Warning Added] Bluetooth service not found (0x0400)
Do Mär 01 2018 18:34:05.707778 - [Bluetooth Controller] Shutdown: Power managing these bases: LHB-084071D2,LHB-925017E7
Do Mär 01 2018 18:34:05.707787 - [Bluetooth Controller] Shutdown: Bluetooth Link stopping...
Do Mär 01 2018 18:34:05.707809 - [Bluetooth Controller] Base Station Controller Worker Shutdown.
Do Mär 01 2018 18:34:05.807876 - [Bluetooth Controller] Base Station Controller Worker Shutdown done.
Do Mär 01 2018 18:34:05.807993 - [Bluetooth Controller] Shutdown: Wait for shutdown (0)
Do Mär 01 2018 18:34:05.808003 - [Bluetooth Controller] Shutdown: Wait for worker thread to finish...
Do Mär 01 2018 18:34:05.808036 - [Bluetooth Controller] Shutdown: Completed.
ChristophHaag commented 6 years ago

A week ago HTC added the bluetooth firmware to linux-firmware. A sign for bluetooth support in SteamVR coming?

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

h1z1 commented 6 years ago

I had no problem with Bluetooth. Both lighthouses ended up bricking themselves trying to update the damn firmware. HTC nor Valve ever resolved it. Waste of around 1k in hardware because of a firmware bug.

Thanks Valve.

ChristophHaag commented 6 years ago

Interesting. Since the last bluetooth update it doesn't pretend to do the update over bluetooth anymore, it just tells me to do the usb update, even when the basestation is paired and trusted: https://youtu.be/rxpgh4A4hCM Maybe it just doesn't work with the bluez version 5.49 on archlinux...

Anyway, from what I read here, the firmware update over usb does break the basestation when done from linux, but it should work again when repeating the update over usb from windows. Is that still possible with your basestations?

h1z1 commented 6 years ago

Weird. I deleted a comment about your screenshot not showing the SteamVR logo only to realize it did but you trimmed it. Appears it also deleted my original reply.. hm.

Playing with VR again I can confirm the client now prefers USB over Bluetooth and the trick I did to make Steam recognize Bluetooth, no longer works. Strangely enough mounting the lightbox results in some corruption which may explain (at least now), why Steam is not able to detect the box in FRU:

# hdparm -I /dev/sdg   | head -10
SG_IO: bad/missing sense data, sb[]:  70 00 02 00 00 00 00 0a 00 00 00 00 30 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

/dev/sdg:

ATA device, with non-removable media
    Model Number:       ����-����U��������u�����
    Serial Number:      �����[���d�����
    Firmware Revision:  ��3���
Standards:
    Used: unknown (minor revision code 0x1c0f) 
    Supported: 14 13 11 10 9 7 6 
[root@localhost ~]# cat /sys/block/sdg/device/{model,vendor}
LPC1XXX IFLASH  
NXP     
[root@localhost ~]# ls -al /mnt/fw
total 133
drwxr-xr-x   2 root root    512 Dec 31  1969 .
drwxr-xr-x. 10 root root   4096 May 11 07:13 ..
-rwxr-xr-x   1 root root 131072 Feb  6  2009 firmware.bin
[root@localhost ~]# md5sum /mnt/fw/firmware.bin 
58abb55f171cc7d7729505ec9a873f26  /mnt/fw/firmware.bin
[root@localhost ~]# 

Build date in firmware is 2016-05-05 17:08:43

tareko commented 6 years ago

Hello all,

I was wondering where this bug stood now, a few months after the last update. Using Ubuntu 18.04, it is not clear to me how to activate the base stations in any way.

tarek : )

silelmot commented 6 years ago

since steamplay i gave steamvr for linux a shot again and bluetooth still shows the known error. i have to cut the base stations from power and power them on again to have them search for the hmd and each other

zlondrej commented 6 years ago

This is really shame though. I know it's possible to turn on the lighthouses using sync mode button, but one of my lighthouse is really high and I can't normally reach it without a chair. Plus then I would have to unplug them (but the plug is not really accessible) or boot into windows anyway to turn them off.

kalda341 commented 6 years ago

This would be very good to get resolved

unlimitedbacon commented 6 years ago

Doesn't work for me either. I just get this in ~/.local/share/Steam/logs/vrmonitor.txt

Sat Oct 06 2018 23:43:46.419265 - [Bluetooth Controller] Activate Basestation Controller.
Sat Oct 06 2018 23:43:46.420156 - [Dismissable Warning Added] Bluetooth service not found (0x0400)

Bluez is running (version 5.50) and I've connected to the lighthouses. This is on Arch.

ilar commented 5 years ago

Is there any updates on this? Even a subset of bluetooth functionality, like bluetooth power management, would be a huge step forward in usability for SteamVR-Linux.

Zamundaaa commented 5 years ago

So they seem to have fixed a lot of this in the latest updates (somehow that's not mentioned in the patch notes (?) ) but it still doesn't fully work. It does show me the two base stations (without and with manually having paired them before) but it won't shut down the base stations. In the base station power management menu it shows that I should "Refresh" the base stations (whatever it means) but clicking it won't do anything by the looks of it. In vrmonitor.txt it shows this:

Fri Jan 04 2019 12:58:04.314315 - [Bluetooth Controller] OnWorker_BaseStationScan HTC BS (Failed) (0.00 seconds) Fri Jan 04 2019 12:58:21.991433 - [Bluetooth Controller] Power Management: LHB-C3880DD6, Not Found, Extend, Fail. Fri Jan 04 2019 12:58:22.862967 - [Bluetooth Controller] Power Management: LHB-C3880DD6, Not Found, Extend, Fail.

and then this two lines with power management repeated pretty often. They seem to appear every time it automatically tries to refresh and definitely appear every time I try to refresh manually. Here's the system report: https://gist.github.com/Zamundaaa/eba6249429aa8c8a8e389fe03be317cb

ChristophHaag commented 4 years ago

This project supposedly implements power management of the v1 basestations. I did not test it yet https://github.com/risa2000/lhctrl

Seegras commented 4 years ago

Is this still an issue for v2 Base stations? Namely:

TiagoTiago commented 4 years ago
* How am I supposed to set the channel without bluetooth?

I think there's a pin-button somewhere in them to change the channel

DidierLoiseau commented 2 years ago

This project supposedly implements power management of the v1 basestations. I did not test it yet https://github.com/risa2000/lhctrl

There is also this one for v2 (Valve Index): https://github.com/risa2000/lh2ctrl

After checking out the project, just run

lh2ctrl.py --off <base stations mac addresses>

to shutdown the stations.

Use --on to start them again, or without flag to keep them on as long as the script is running (stop/kill the script to turn them off again).

No more high pitch noise for me! 😌

edit: I have now contributed a change to add the --on and --off options which makes it easier to use as launch options for SteamVR like:

lh2ctrl.py --on <mac-addresses> & %command%; lh2ctrl.py --off <mac-addresses>