davidrisch / steamvr_utils Goto Github PK
View Code? Open in Web Editor NEWUtilities for SteamVR on Linux
License: GNU General Public License v3.0
Utilities for SteamVR on Linux
License: GNU General Public License v3.0
Hi,
Typo:
./scripts/steamvr_utils.py deamon
./scripts/steamvr_utils.py daemon
On Manjaro psutil for pip3 was missing, might help others ?
sudo pip3 install psutil
Nice Job tho ๐
When using OBS the Daemon will constantly switch my input devices back to the Radio Mic. We need a way to disable this portion of the switching as I cannot use steamvr_utils while streaming now. Even newly added capture sources have this issue. Specifically it will automatically set my desktop capture to the Radio Mic instead of the HDMI output and changing it in pavucontrol will see it change right back the next time the daemon makes it's check
Was just going to look into something in VR today and have been using steamvr_utils for some time now without problems.
click vr icon in steam where the master base station spins up (at a louder / faster mirror spin rate than normal) then stops, then repeats the same count as is stated in the config for attempt_count_set.
I tried switching from the current latest linux steamvr version to the linux beta version, same problem.
waited for the base station to spin down (fail out), then started steamvr without starting the base stations, then unplugged and replugged the power for the master base station (station b), it spins up (at a normal mirror spin rate) and triggers station c like it normaly would.
Now, this started happening only today so I suspect it might be something that changed with some f'ing update from ubuntu that messed with it.
Ubuntu 20.04.3
Kernel 5.17.1 generic (Mainline)
Mesa 22.1.0-devel
Any suggestions to what could be causing this ?
Hello again, this isn't a direct problem and more of a question.
I recently got a Vive Pro since I was suspecting my old Vive was starting to fail (It wasn't, but that's fine).
Now, with the new BS V2(?) they connect and operate in a different way then the V1(?) BS's.
They require that I run this utility as root (sudo) for it to work because of BLE.
I'm wondering if you have any method that would allow the user to be able to toggle the BS's power on and off without needing root (sudo) ?
It's not an actual problem, but more a hindrance to the automation of this script being run on SteamVR startup/shutdown since I now must run the script as root with on/off to power the BS's on/off.
for me, install.py returns python3 /home/termy/projects/git/steamvr_utils/./scripts/steamvr_utils.py daemon >>/tmp/steamvr_utils.out 2>&1; %command%;
where it should be python3 /home/termy/projects/git/steamvr_utils/scripts/steamvr_utils.py daemon >>/tmp/steamvr_utils.out 2>&1; %command%;
(notice the /./ "subfolder" before /scripts )
Edit: and i just noticed, the desktop files contain the wrong paths, too:
Exec=python3 /home/termy/projects/git/steamvr_utils/./scripts/steamvr_utils.py off
Icon=/home/termy/projects/git/steamvr_utils/./scripts/../images/icon_off.png
So /. is too much on Exec and /./scripts/.. is too much on Icon
I guess that might be because i followed the instructions in the readme and ran ./scripts/install.py
from the basedir?
Hi, saw a thread on /r/linux_gaming about this project so I decided to try it out so I wont have to write the script myself, but I can't get it to launch.
Getting the following output
[~/steamvr_utils] ./scripts/steamvr_utils.py daemon
2021-01-17 19:53:33 [DEBUG]: dry_run: False
2021-01-17 19:53:33 [DEBUG]: 'pactl list short sinks':
1 alsa_output.pci-0000_03_00.1.hdmi-stereo-extra2 module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_output.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
2021-01-17 19:53:33 [DEBUG]: normal sink: alsa_output.pci-0000_00_1f.3.analog-stereo
2021-01-17 19:53:33 [DEBUG]: vr sink: alsa_output.pci-0000_03_00.1.hdmi-stereo-extra2
2021-01-17 19:53:33 [INFO ]: SteamvrUtils stating daemon:
Terminated
The only thing I changed in the config was disable the base station feature and the regex for my headphones:
[~/steamvr_utils/config] diff config_template.yaml config.yaml
9c9
< enabled: true # Boolean. Enable the Base Station component.
---
> enabled: false # Boolean. Enable the Base Station component.
16c16
< normal_sink_regex: '' # Regex. Used to find the audio sink of the regular audio device. Leave empty to detect automatically (not recommended).
---
> normal_sink_regex: '.*analog.*' # Regex. Used to find the audio sink of the regular audio device. Leave empty to detect automatically (not recommended).
It also guesses wrong on the "vr sink" which should be hdmi-stereo-extra3, but the "device.product.name" wont show up in "pacmd list-cards" for my Index before starting SteamVR.
I've just recently switched from Win10 to Manjaro and am encountering some major audio issues for the VR (everything worked fine back in Win10).
I tried setting the vr_sink_regex in the config.yaml to .displayport. since the hmd is connected via DisplayPort to my computer. But even after trying this, the device wasn't found. My hmd is connected properly as I can play with it in vr - just without any sound.
The output from the hmd is also not listed within the OS sound settings, however the input mic is shown there.
Output from using 'pactl list cards'
[blue@Blue-Desktop scripts]$ python steamvr_utils.py on
2021-03-19 19:51:31 [DEBUG]: dry_run: False
2021-03-19 19:51:31 [DEBUG]: 'pactl list short sinks':
0 alsa_output.pci-0000_28_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
1 alsa_output.pci-0000_2a_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
2 combined module-combine-sink.c s16le 2ch 44100Hz RUNNING
2021-03-19 19:51:31 [DEBUG]: normal sink: alsa_output.pci-0000_2a_00.4.analog-stereo
2021-03-19 19:51:31 [DEBUG]: vr sink: alsa_output.pci-0000_28_00.1.hdmi-stereo
2021-03-19 19:51:31 [INFO ]: SteamvrUtils turning on:
2021-03-19 19:51:31 [INFO ]: Scanning for Base Stations:
2021-03-19 19:51:31 [INFO ]: Found Base Station LHB-EBEFA780 at address f0:34:ed:b1:8a:dc
2021-03-19 19:51:31 [INFO ]: Found Base Station LHB-8437B878 at address c4:dd:da:8f:dd:d1
2021-03-19 19:51:33 [INFO ]: Changing power state of Base Stations:
2021-03-19 19:51:33 [INFO ]: Connecting to f0:34:ed:b1:8a:dc
2021-03-19 19:51:33 [INFO ]: Turning on
2021-03-19 19:51:33 [INFO ]: Connecting to c4:dd:da:8f:dd:d1
2021-03-19 19:51:33 [INFO ]: Turning on
2021-03-19 19:51:33 [INFO ]: Success of attempt 1 of 5
2021-03-19 19:51:34 [INFO ]: Connecting to f0:34:ed:b1:8a:dc
2021-03-19 19:51:34 [INFO ]: Turning on
2021-03-19 19:51:34 [INFO ]: Connecting to c4:dd:da:8f:dd:d1
2021-03-19 19:51:34 [INFO ]: Turning on
2021-03-19 19:51:34 [INFO ]: Success of attempt 2 of 5
2021-03-19 19:51:34 [INFO ]: Connecting to f0:34:ed:b1:8a:dc
2021-03-19 19:51:34 [INFO ]: Turning on
2021-03-19 19:51:34 [INFO ]: Connecting to c4:dd:da:8f:dd:d1
2021-03-19 19:51:34 [INFO ]: Turning on
2021-03-19 19:51:34 [INFO ]: Success of attempt 3 of 5
2021-03-19 19:51:35 [INFO ]: Connecting to f0:34:ed:b1:8a:dc
2021-03-19 19:51:35 [INFO ]: Turning on
2021-03-19 19:51:35 [INFO ]: Connecting to c4:dd:da:8f:dd:d1
2021-03-19 19:51:35 [INFO ]: Turning on
2021-03-19 19:51:35 [INFO ]: Success of attempt 4 of 5
2021-03-19 19:51:35 [INFO ]: Connecting to f0:34:ed:b1:8a:dc
2021-03-19 19:51:36 [INFO ]: Turning on
2021-03-19 19:51:36 [INFO ]: Connecting to c4:dd:da:8f:dd:d1
2021-03-19 19:51:36 [INFO ]: Turning on
2021-03-19 19:51:36 [INFO ]: Success of attempt 5 of 5
2021-03-19 19:51:36 [WARNI]: Failed to find any port on any card matching "(Index HMD)|(VIVE)". Name of the product at every port:
alsa_card.pci-0000_28_00.1
-
alsa_card.usb-Valve_Corporation_Valve_VR_Radio___HMD_Mic_C57E1219BC-LYM-01
-
alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00
-
alsa_card.pci-0000_2a_00.4
-
-
-
-
-
-
2021-03-19 19:51:36 [DEBUG]: set_suspend_state pactl suspend-sink alsa_output.pci-0000_28_00.1.hdmi-stereo true
2021-03-19 19:51:46 [DEBUG]: set_suspend_state pactl suspend-sink alsa_output.pci-0000_28_00.1.hdmi-stereo false
2021-03-19 19:51:46 [DEBUG]: 'pactl list short sink-inputs':
212 2 11 protocol-native.c s16le 2ch 44100Hz
214 1 259 protocol-native.c float32le 2ch 44100Hz
217 1 264 protocol-native.c float32le 2ch 44100Hz
232 0 - module-combine-sink.c s16le 2ch 44100Hz
233 1 - module-combine-sink.c s16le 2ch 44100Hz
2021-03-19 19:51:46 [ERROR]: 'pactl move-sink-input 217 alsa_output.pci-0000_28_00.1.hdmi-stereo' (client_name: java) failed (count: 1), stderr:
Failure: Invalid argument
2021-03-19 19:51:46 [DEBUG]: last_pactl_sinks:
0 alsa_output.pci-0000_28_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
1 alsa_output.pci-0000_2a_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
2 combined module-combine-sink.c s16le 2ch 44100Hz RUNNING
2021-03-19 19:51:46 [DEBUG]: last_pactl_sink_inputs:
212 2 11 protocol-native.c s16le 2ch 44100Hz
214 1 259 protocol-native.c float32le 2ch 44100Hz
217 1 264 protocol-native.c float32le 2ch 44100Hz
232 0 - module-combine-sink.c s16le 2ch 44100Hz
233 1 - module-combine-sink.c s16le 2ch 44100Hz
2021-03-19 19:51:46 [DEBUG]: last_pactl_clients:
None
2021-03-19 19:51:46 [ERROR]: 'pactl move-sink-input 233 alsa_output.pci-0000_28_00.1.hdmi-stereo' (client_name: None) failed (count: 1), stderr:
Failure: Invalid argument
2021-03-19 19:51:46 [DEBUG]: last_pactl_sinks:
0 alsa_output.pci-0000_28_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
1 alsa_output.pci-0000_2a_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
2 combined module-combine-sink.c s16le 2ch 44100Hz RUNNING
2021-03-19 19:51:46 [DEBUG]: last_pactl_sink_inputs:
212 2 11 protocol-native.c s16le 2ch 44100Hz
214 1 259 protocol-native.c float32le 2ch 44100Hz
217 1 264 protocol-native.c float32le 2ch 44100Hz
232 0 - module-combine-sink.c s16le 2ch 44100Hz
233 1 - module-combine-sink.c s16le 2ch 44100Hz
2021-03-19 19:51:46 [DEBUG]: last_pactl_clients:
None
[blue@Blue-Desktop scripts]$ pactl list cards
Card #0
Name: alsa_card.pci-0000_28_00.1
Driver: module-alsa-card.c
Owner Module: 6
Properties:
alsa.card = "0"
alsa.card_name = "HDA ATI HDMI"
alsa.long_card_name = "HDA ATI HDMI at 0xf7a40000 irq 74"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:28:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.2/0000:28:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "1002"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
device.product.id = "aa68"
device.product.name = "Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series]"
device.string = "0"
device.description = "Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series]"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Profiles:
output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: output:hdmi-stereo
Ports:
hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo
Card #1
Name: alsa_card.usb-Valve_Corporation_Valve_VR_Radio___HMD_Mic_C57E1219BC-LYM-01
Driver: module-alsa-card.c
Owner Module: 7
Properties:
alsa.card = "3"
alsa.card_name = "Valve VR Radio & HMD Mic"
alsa.long_card_name = "Valve Corporation Valve VR Radio & HMD Mic at usb-0000:2a:00.3-1.3.3, full spee"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:2a:00.3-usb-0:1.3.3:1.1"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:2a:00.3/usb7/7-1/7-1.3/7-1.3.3/7-1.3.3:1.1/sound/card3"
udev.id = "usb-Valve_Corporation_Valve_VR_Radio___HMD_Mic_C57E1219BC-LYM-01"
device.bus = "usb"
device.vendor.id = "28de"
device.vendor.name = "Valve Software"
device.product.id = "2102"
device.product.name = "Valve VR Radio & HMD Mic"
device.serial = "Valve_Corporation_Valve_VR_Radio___HMD_Mic_C57E1219BC-LYM"
device.string = "3"
device.description = "Valve VR Radio & HMD Mic"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
Profiles:
input:mono-fallback: Mono Input (sinks: 0, sources: 1, priority: 1, available: yes)
input:multichannel-input: Multichannel Input (sinks: 0, sources: 1, priority: 1, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: input:multichannel-input
Ports:
analog-input: Analog Input (type: Analog, priority: 10000, latency offset: 0 usec, availability unknown)
Part of profile(s): input:mono-fallback
Card #2
Name: alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00
Driver: module-alsa-card.c
Owner Module: 8
Properties:
alsa.card = "2"
alsa.card_name = "USB MICROPHONE"
alsa.long_card_name = "MICE MICROPHONE USB MICROPHONE at usb-0000:2a:00.3-2, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:2a:00.3-usb-0:2:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:2a:00.3/usb7/7-2/7-2:1.0/sound/card2"
udev.id = "usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0005"
device.product.name = "Blue Snowball"
device.serial = "MICE_MICROPHONE_USB_MICROPHONE_201308"
device.string = "2"
device.description = "Blue Snowball"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
Profiles:
input:mono-fallback: Mono Input (sinks: 0, sources: 1, priority: 1, available: yes)
input:multichannel-input: Multichannel Input (sinks: 0, sources: 1, priority: 1, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: input:mono-fallback
Ports:
analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
Properties:
device.icon_name = "audio-input-microphone"
Part of profile(s): input:mono-fallback
Card #3
Name: alsa_card.pci-0000_2a_00.4
Driver: module-alsa-card.c
Owner Module: 9
Properties:
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xf7400000 irq 91"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:2a:00.4"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:2a:00.4/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1487"
device.product.name = "Starship/Matisse HD Audio Controller"
device.string = "1"
device.description = "Starship/Matisse HD Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Profiles:
input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: no)
output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: no)
output:analog-surround-21: Analog Surround 2.1 Output (sinks: 1, sources: 0, priority: 1300, available: no)
output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: no)
output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: no)
output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: no)
output:analog-surround-41: Analog Surround 4.1 Output (sinks: 1, sources: 0, priority: 1300, available: no)
output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: no)
output:analog-surround-50: Analog Surround 5.0 Output (sinks: 1, sources: 0, priority: 1200, available: no)
output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: no)
output:analog-surround-51: Analog Surround 5.1 Output (sinks: 1, sources: 0, priority: 1300, available: no)
output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: no)
output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5565, available: no)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: output:analog-stereo
Ports:
analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, latency offset: 0 usec, not available)
Properties:
device.icon_name = "audio-input-microphone"
Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo
analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, latency offset: 0 usec, not available)
Properties:
device.icon_name = "audio-input-microphone"
Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo
analog-input-linein: Line In (type: Line, priority: 8100, latency offset: 0 usec, not available)
Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo
analog-output-lineout: Line Out (type: Line, priority: 9000, latency offset: 0 usec, not available)
Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21, output:analog-surround-21+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo, output:analog-surround-41, output:analog-surround-41+input:analog-stereo, output:analog-surround-50, output:analog-surround-50+input:analog-stereo, output:analog-surround-51, output:analog-surround-51+input:analog-stereo
analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, available)
Properties:
device.icon_name = "audio-headphones"
Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo
Thanks for any help. I'm currently reaching my limits on how to fix the issue...
When i try to run steamvr_utils.py on/off/daemon, i get the follwing output:
~/.../steamvr_utils/scripts >>> ./steamvr_utils.py daemon [2]
2021-01-10 15:57:12 [DEBUG]: dry_run: False
2021-01-10 15:57:12 [DEBUG]: 'pactl list short sinks':
0 alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-game module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
1 alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-chat module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
4 alsa_output.pci-0000_12_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
5 alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_E5_040D00B00EX-00.analog-stereo module-alsa-card.c s24le 2ch 48000Hz SUSPENDED
8 alsa_output.pci-0000_10_00.1.hdmi-stereo-extra4 module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2021-01-10 15:57:12 [ERROR]:
Traceback (most recent call last):
File "/home/termy/projects/git/steamvr_utils/scripts/./steamvr_utils.py", line 101, in main
steamvr_utils = SteamvrUtils(
File "/home/termy/projects/git/steamvr_utils/scripts/./steamvr_utils.py", line 31, in __init__
self.audio_switcher = AudioSwitcher(config)
File "/home/termy/projects/git/steamvr_utils/scripts/audio_switcher.py", line 51, in __init__
default_sink_name = self.get_default_sink_name()
File "/home/termy/projects/git/steamvr_utils/scripts/audio_switcher.py", line 211, in get_default_sink_name
raise RuntimeError('No default sink was found.')
RuntimeError: No default sink was found.
pactl list cards: https://pastebin.com/bw7Rynyf
i'm not sure what i could try? Let me know if you need any other info :)
Hi,
in my PulseAudio setup I use the modules module-echo-cancel and module-loopback. Both will create sink inputs without a client ID:
$ pact list short sink-inputs
0 1 - module-echo-cancel.c float32le 2ch 32000Hz
3 4 - module-loopback.c s16le 2ch 44100Hz
resulting in a ValueError
2021-01-21 18:52:52 [ERROR]:
Traceback (most recent call last):
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_utils.py", line 124, in main
steamvr_utils.action(selected_action)
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_utils.py", line 45, in action
self.start_daemon()
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_utils.py", line 51, in start_daemon
SteamvrDaemon.create_daemon(self)
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_daemon.py", line 45, in create_daemon
steamvr_daemon.loop()
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_daemon.py", line 57, in loop
self.steamvr_utils.turn_on()
File "/home/cyberworm/Applications/steamvr_utils/scripts/steamvr_utils.py", line 69, in turn_on
self.audio_switcher.switch_to_vr()
File "/home/cyberworm/Applications/steamvr_utils/scripts/audio_switcher.py", line 99, in switch_to_vr
self.set_sink(self.vr_sink)
File "/home/cyberworm/Applications/steamvr_utils/scripts/audio_switcher.py", line 106, in set_sink
self.set_sink_for_all_sink_inputs(sink)
File "/home/cyberworm/Applications/steamvr_utils/scripts/audio_switcher.py", line 126, in set_sink_for_all_sink_inputs
sink_inputs = pactl_interface.SinkInput.get_all_sink_inputs(self)
File "/home/cyberworm/Applications/steamvr_utils/scripts/pactl_interface/sink_input.py", line 24, in get_all_sink_inputs
sink_inputs = [cls(line) for line in sink_inputs_lines]
File "/home/cyberworm/Applications/steamvr_utils/scripts/pactl_interface/sink_input.py", line 24, in <listcomp>
sink_inputs = [cls(line) for line in sink_inputs_lines]
File "/home/cyberworm/Applications/steamvr_utils/scripts/pactl_interface/sink_input.py", line 9, in __init__
self.client_id = int(line.split('\t')[2])
ValueError: invalid literal for int() with base 10: '-'
So I tried to run it on garuda linux and I'm unable to make it work. I installed all dependacy. I did manage to start my base station but since then I was never able to turn them off. Bluepy is always unable to connect to my base base station evens if he find them.. I'm going mad... I also I'm using pipewire but I disable the audio component since It make problem
Hello again!
I have recently been wondering if it is or would be possible to get the status of the base stations (on/off) as to use a toggle method for activating and deactivating the base stations.
Do you know if this is at all possible to poll from the stations and/or if it would be something of a usable feature for the steamvr_util.py
script ?
something along the lines of: steamvr_util.py status/active
returning something like: enabled / disabled / active / inactive / true / false
What do you think ?
I recently got my hands on a stream deck and am trying to build my own version of streamdeck-ui (I just want to).
So, what I was thinking was if I had a button set to poll the status of the base stations every so and so many seconds and change the icon and/or text accordingly.
Sorry for bugging you again, but I'm having some troubles with the audio component.
I adapted your script to work with the Vive lighthouses so I got that part figured out, what's missing for this setup to be perfect is the automatic audio switch.
For sure i configured something wrong (even though the debug strings it prints makes it look like it chose the right sinks) but whenever i start VrUtils it crashes with this error:
firestorm7893@firestorm7893-desktop:~/.steamvr_utils/scripts$ ./steamvr_utils.py on
2021-01-17 20:01:36 [DEBUG]: dry_run: False
2021-01-17 20:01:36 [DEBUG]: 'pactl list short sinks':
0 alsa_output.pci-0000_01_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_output.usb-Corsair_Corsair_VOID_PRO_Wireless_Gaming_Headset-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
2 alsa_output.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
4 PulseEffects_apps module-null-sink.c s16le 2ch 44100Hz IDLE
5 PulseEffects_mic module-null-sink.c s16le 2ch 44100Hz SUSPENDED
2021-01-17 20:01:36 [DEBUG]: normal sink: alsa_output.usb-Corsair_Corsair_VOID_PRO_Wireless_Gaming_Headset-00.analog-stereo
2021-01-17 20:01:36 [DEBUG]: vr sink: alsa_output.pci-0000_01_00.1.hdmi-stereo
2021-01-17 20:01:36 [INFO ]: SteamvrUtils turning on:
2021-01-17 20:01:36 [ERROR]:
Traceback (most recent call last):
File "./steamvr_utils.py", line 110, in main
steamvr_utils.action(selected_action)
File "./steamvr_utils.py", line 35, in action
self.turn_on()
File "./steamvr_utils.py", line 63, in turn_on
self.audio_switcher.switch_to_vr()
File "/home/firestorm7893/.steamvr_utils/scripts/audio_switcher.py", line 87, in switch_to_vr
self.port = self.get_port()
File "/home/firestorm7893/.steamvr_utils/scripts/audio_switcher.py", line 215, in get_port
cards = pactl_interface.Card.get_all_cards()
File "/home/firestorm7893/.steamvr_utils/scripts/pactl_interface/card.py", line 157, in get_all_cards
cards.append(cls(card_dict))
File "/home/firestorm7893/.steamvr_utils/scripts/pactl_interface/card.py", line 86, in __init__
self.ports.append(self.Port(port_dict, self))
File "/home/firestorm7893/.steamvr_utils/scripts/pactl_interface/card.py", line 31, in __init__
self.name = match.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
I'll also add my current configuration:
# copy to config.yaml to customize
dry_run: false # Boolean. Do not change anything.
log:
enabled: true # Boolean. Write a log for each execution.
basestation:
enabled: false # Boolean. Enable the Base Station component.
attempt_count_scan: 5 # Int >0. Maximum number of attempts to find Base Stations.
attempt_count_set: 5 # Int >0. Number of attempts to set the power state of Base Station.
audio:
enabled: true # Boolean. Enable the Base Station component.
vr_sink_regex: '.*hdmi.*' # Regex. Used to find the audio sink of the vr headset.
normal_sink_regex: '' # Regex. Used to find the audio sink of the regular audio device. Leave empty to detect automatically (not recomme>
excluded_clients_regexes: # List of regexes. Used to ignore some audio clients. Intended for application not needed in vr.
- 'firefox'
set_card_port: true # Boolean. Enable automatic changing the correct port.
card_port_product_name_regex: 'Valve VR Radio & HMD Mic' # Regex. Used to find the card and port on that card which the vr headset is co>
# Use `pactl list cards | grep 'device.product.name'` while SteamVR is running to find the name of your vr headset.
card_rescan_pause_time: 10 # Float. Number of seconds to wait between suspending and resuming a sink to rescan the ports of its card.
daemon:
watch_process_name: 'vrcompositor' # String. Name of the process which indicated SteamVR is running.
wait_after_quit: 60 # Float. Number of seconds to wait after SteamVR exits until Base Stations are turned off (and audio is switched). U>
So I'm having this very weird issue where if i use the Steam launch commands to launch steamvr my system will suddenly stop accepting passwords. Sometimes it happens on startup of SteamVR other times it happens when SteamVR is closed and hangs. The only solution is to reboot. Invoking the scripts manually does not cause this issue. I correctly set all all the parameters and am very perplexed by this. dmesg will output something about usb failures with the -110 code which isn't very helpful.
Standby (motor on, laser off) would be a good addition to the base station script.
To be fully honest, I am not even using the scripts provided in this repo, I just want to know what state to use in order to bring my base stations with original firmware to this mode, if possible at all.
Judging by the code in Lighthouse PM, the state should be 0x02, however it didn't do anything from my own testing. Perhaps I need to update my firmware (which may soon be a thing in SteamVR beta)?
My PC that I use for VR doesn't have any bluetooth capabilities but I have lots of running raspberry pis which I could use for this.
Would it be possible to have a configuration for an external command to execute instead of the regular bluetooth to switch the basestation on/off? Then I could set up a copy of this on a rpi and execute the command over ssh.
I understand if it's way out of scope for this project.
Hi,
after i updated my Arch Linux recently, the script doesn't seem to find the basestations anymore.
I have a feeling it has to do with a Python update to 3.11.3 but i can't seem to find the exact problem.
Here is a log from a recent try to activate the basestations, wich prior to updateing some weeks ago worked perfectly fine. Also i can use a android app to activate the basestations, so the stations are fine.
Any ideas what could be the problem here?
2023-08-04 16:34:42 [INFO ]: steamvr_utils version: 1.1.1
2023-08-04 16:34:42 [DEBUG]: dry_run: False
2023-08-04 16:34:42 [INFO ]: SteamvrUtils turning on:
2023-08-04 16:34:42 [INFO ]: Scanning for Base Stations:
2023-08-04 16:34:44 [ERROR]: Failure of attempt 1 of 5: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
2023-08-04 16:34:47 [ERROR]: Failure of attempt 2 of 5: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
2023-08-04 16:34:49 [ERROR]: Failure of attempt 3 of 5: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
2023-08-04 16:34:52 [ERROR]: Failure of attempt 4 of 5: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
2023-08-04 16:34:54 [ERROR]: Failure of attempt 5 of 5: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
2023-08-04 16:34:55 [ERROR]: No successful attempt in any of the 5 attempts. Last error:
2023-08-04 16:34:55 [ERROR]:
Traceback (most recent call last):
File "/home/kubax/bin/steamvr_utils/scripts/steamvr_utils.py", line 133, in main
steamvr_utils.action(selected_action)
File "/home/kubax/bin/steamvr_utils/scripts/steamvr_utils.py", line 47, in action
self.turn_on()
File "/home/kubax/bin/steamvr_utils/scripts/steamvr_utils.py", line 72, in turn_on
self.basestation_power_interface.action(basestation_interface.Action.ON)
File "/home/kubax/bin/steamvr_utils/scripts/basestation_interface/v2_interface.py", line 129, in action
attempt_loop(lambda: self.scan(), self.config.basestation_attempt_count_scan())
File "/home/kubax/bin/steamvr_utils/scripts/basestation_interface/v2_interface.py", line 126, in attempt_loop
raise last_error
File "/home/kubax/bin/steamvr_utils/scripts/basestation_interface/v2_interface.py", line 114, in attempt_loop
return function()
^^^^^^^^^^
File "/home/kubax/bin/steamvr_utils/scripts/basestation_interface/v2_interface.py", line 129, in <lambda>
attempt_loop(lambda: self.scan(), self.config.basestation_attempt_count_scan())
^^^^^^^^^^^
File "/home/kubax/bin/steamvr_utils/scripts/basestation_interface/v2_interface.py", line 77, in scan
raise RuntimeError('Bluetooth scan found no Base Stations. '
RuntimeError: Bluetooth scan found no Base Stations. If there are powered Base Stations near you, this is probably a problem with your Bluetooth device.
@Firestorm7893
I added support for V1 Base Stations in cb58f33.
Can you please test if works?
Your config:
basestation:
enabled: true # Boolean. Enable the Base Station component.
# ==== FOR V1 AND V2 BASE STATIONS ====
attempt_count_set: 5 # Int >0. Number of attempts to set the power state of Base Station.
# ==== FOR V2 BASE STATIONS (from Valve) ONLY ====
type: 'v1' # Enum(v1, v2). Version of your Base Stations.
attempt_count_scan: 5 # Int >0. Maximum number of attempts to find Base Stations.
# ==== FOR V1 BASE STATIONS (from VIVE) ONLY ====
lh_b_mac: '40:4E:36:BD:A8:45' # String(XX:XX:XX:XX:XX:XX). Bluetooth MAC address of Lighthouse B.
lh_b_id: '62F5DDD9' # String(XXXXXXXX). ID of Lighthouse B (printed on the back).
lh_c_mac: '40:4E:36:BD:A1:38' # String(XX:XX:XX:XX:XX:XX). Bluetooth MAC address of Lighthouse C.
lh_c_id: '0E97C927' # String(XXXXXXXX). ID of Lighthouse C (printed on the back).
# See https://github.com/risa2000/lhctrl for details.
2 script changes are needed for microphone switching to work (it's probably very similar for outputs):
Change line 25 in 'steamvr_utils/scripts/audio/source_switcher.py' from
from
return 'move-source-output'
to
return 'set-default-source'
Change line 142 in 'steamvr_utils/scripts/audio/stream_switcher.py'
from
arguments = ['pactl', self.get_move_stream_connection_command(), str(stream_connection.id), stream.name]
to
arguments = ['pactl', self.get_move_stream_connection_command(), stream.name]
Have a good one. I'll consider making a code contribution.
Hello everyone. After finding out that the lightouses on steam vr for linux are borked i wanted to give this script a try.
But unfortunately it seems like my computer hates bluethoot with a passion and it just refuses to work.
Whenever I launch the scrip for turning on the base stations the following error pops up:
2021-01-16 20:19:31 [DEBUG]: dry_run: False
2021-01-16 20:19:31 [INFO ]: SteamvrUtils turning on:
2021-01-16 20:19:31 [ERROR]: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
2021-01-16 20:19:31 [ERROR]: Failure of attempt 1 of 5
2021-01-16 20:19:31 [ERROR]: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
2021-01-16 20:19:31 [ERROR]: Failure of attempt 2 of 5
2021-01-16 20:19:32 [ERROR]: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
2021-01-16 20:19:32 [ERROR]: Failure of attempt 3 of 5
2021-01-16 20:19:32 [ERROR]: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
2021-01-16 20:19:32 [ERROR]: Failure of attempt 4 of 5
2021-01-16 20:19:33 [ERROR]: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
2021-01-16 20:19:33 [ERROR]: Failure of attempt 5 of 5
2021-01-16 20:19:33 [ERROR]: No successful attempt in any of the 5 attempts. Last error:
2021-01-16 20:19:33 [ERROR]:
Traceback (most recent call last):
File "./steamvr_utils.py", line 110, in main
steamvr_utils.action(selected_action)
File "./steamvr_utils.py", line 35, in action
self.turn_on()
File "./steamvr_utils.py", line 60, in turn_on
self.basestation_power_interface.robust_action(BasestationPowerInterface.Action.ON)
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 124, in robust_action
attempt_loop(lambda: self.scan(), self.config.basestation_attempt_count_scan())
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 122, in attempt_loop
raise last_error
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 110, in attempt_loop
return function()
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 124, in <lambda>
attempt_loop(lambda: self.scan(), self.config.basestation_attempt_count_scan())
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 63, in scan
raise e
File "/home/firestorm7893/Desktop/steamvr_utils/scripts/basestation_interface.py", line 49, in scan
scanner.scan(2)
File "/usr/local/lib/python3.8/dist-packages/bluepy/btle.py", line 852, in scan
self.start(passive=passive)
File "/usr/local/lib/python3.8/dist-packages/bluepy/btle.py", line 797, in start
self._mgmtCmd(self._cmd()+"end")
File "/usr/local/lib/python3.8/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 'scanend' (code: 13, error: Invalid Parameters)
It would be really cool if I managed to get it working
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.