Friday, May 27, 2016

Switching Audio to Rift when Launching ED

This technique is a workaround for programs launched directly from Windows. Programs launched from within Oculus Home switch audio automatically. Unfortunately I do not have a solution for SteamVR games. If you find a way I'd be interested to know.

1. Download and install AudioSwitch
2. Run AudioSwitch from the commandline to display audio devices
cd "C:\Program Files (x86)\AudioSwitch"
audioswitch /l
3. Take note of your device numbers
C:\Program Files (x86)\AudioSwitch>Audioswitch.exe /l
C:\Program Files (x86)\AudioSwitch>
 Devices available:
  0  Headphones (Rift Audio)
  1  Realtek Digital Output(Optical) (Realtek High Definition Audio)
  2  Realtek Digital Output (Realtek High Definition Audio)
 <3> Speakers (6- Bose USB Audio)
  4  Headset Earphone (2- ASTRO Wireless Transmitter )
In my case the Rift is device 0 while my speakers are device 3.

4. Create a .BAT file on your desktop and enter the following lines.
@echo off
cd "C:\Program Files (x86)\AudioSwitch\"
echo Switching Audio to Rift
Audioswitch.exe /s 0
echo Starting ED Launcher
"C:\Program Files (x86)\Frontier\EDLaunch\EDLaunch.exe"
Audioswitch.exe /s 3
5. Double-click on the BAT file to Run
The batch file should open a cmd window. Your default audio device becomes the Rift. Then the Elite Dangerous Launcher starts. When the Elite Dangerous Launcher is closed, the script switches default audio back to speakers before closing.

Update: If you want to launch programs like VoiceAttack, Captail's Log and such before the ED Launcher use following syntax:
start "" "Program Executable"
My current launcher looks like this
@echo off
cd "C:\Program Files (x86)\AudioSwitch\"
echo Switching Audio to Rift
Audioswitch.exe /s 0
start "" "C:\Program Files (x86)\VoiceAttack\VoiceAttack.exe"
echo Starting ED Launcher
"C:\Program Files (x86)\Frontier\EDLaunch\EDLaunch.exe"
Audioswitch.exe /s 3

Monday, May 9, 2016

Mounting a Leap Motion on Oculus CV1

So we have a short term problem. The CV1 has a curved face while the Leap Motion is flat. Also the new VR Mount, as of this writing, is still some weeks away. Turns out you don't need a special mount or even a 3d printed one if you have a supply store nearby.

Mounting Putty (e.g. Velcro White Tack Putty, Blu Tack, FunTak etc.)
Painter's tape
USB 3.0 extension cable
Velcro ties

Most of the above you can find in Home Depot if you're in the States. The painter's tape is to mark where the leap motion should go. It has to be painter's tape because I want this to be cleanly removable. The same reason for using mounting putty/tack instead of Sugru. The Velcro ties is for fastening the Leap Motion's cable together with the CV1's. The USB 3.0 extension cable is optional though recommended to reach the nearest spare USB 3.0 port on the PC.


It's best to use a cheaper webcam that leaks some IR lights. I tried to use my phone's camera but its IR filter was so good I couldn't see the Rift's lights.

Finding the lights
Open the Windows Camera App (Windows 10, 8) or any equivalent application that will let you live view your camera. Start up Oculus Home then point your Rift so the camera can see it. You should see the lights on the front of the Rift. We want to mount the Leap Motion in a way that covers the fewest lights.

Cut a piece of painters tape in the size of the Leap Motion.

Using the webcam as a guide, mount the painter's tape on the Rift avoiding the lights. Give the lights as much room as you can.

Some Cameras may have stronger IR filtering.

Roll a piece of tack and mount to the back of the Leap Motion toward one end. Repeat for the other end. Leave the center unoccupied. The two ends will accomodate the curve of the Rift.

Reinforce the mount by adding additional tack to the top and bottom of the Leap Motion.

Route the Leap's main cable to the opposite side of the Rift.

Use Velcro ties to fasten the Leap USB cable to the Rift cable. Make it as tight as possible so the Leap doesn't get yanked from the face.

Extend the Leap USB cable as necessary. I used a 6 foot cable.

Depending on the angle to the camera some lights may be obscured but it doesn't appear to affect tracking.

Have fun!