Skip to content
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

Missing Linux features #43

Open
8 of 14 tasks
username223 opened this issue Jan 12, 2019 · 7 comments
Open
8 of 14 tasks

Missing Linux features #43

username223 opened this issue Jan 12, 2019 · 7 comments
Labels
enhancement New feature or request Linux Linux related items.

Comments

@username223
Copy link
Member

username223 commented Jan 12, 2019

The following features are missing from the project in order to achieve feature parity with Windows:

@username223 username223 added the enhancement New feature or request label Jan 12, 2019
@frostworx
Copy link

sorry, if this doesn't belong here, but I'd like to ask if revive should work via steamplay.
now with latest steam client beta allowing you to install windows versions of games where a linux port exists this is getting interesting imho

@icewind1991
Copy link
Collaborator

I have never tried revive but I wouldn't give much hope to wine properly being able to bridge both ways between the windows and linux openvr, it's always worth a try if you have a use case for it though.
Other than that you'll have to contact the revive devs for more info

@frostworx
Copy link

thanks for your thoughts.
I don't think as well that it will work, but thought it was worth to ask if someone actually knows it.
I can perfectly live without those few games in vr.

@username223 username223 added the Linux Linux related items. label Mar 25, 2019
username223 added a commit that referenced this issue Apr 8, 2020
Source outputs must all be moved to new default source.
Reference topic
https://askubuntu.com/a/72076

* Adds microphone controls on Linux via PulseAudio (PA) for several
points in
#43.

It can not be overstated how unsuited the public AudioManager API is for
using the PA API.

It can also not be overstated how undocumented and horrible the PA API
is. The PA way of doing audio is very unlike the Windows way of doing
audio, which the AudioManager is heavily influenced by.

Since I don't have a Linux machine I have not been able to personally
test this. https://github.com/feilen/ has graciously helped with
testing.

PulseAudio is very undocumented and not very widely used for what we
need outside of official utilities. As such there's most likely a better
way of doing things than I've done.
Additional information can be found at
https://github.com/username223/pulseaudio-device-changing.

The "complex" PA API is asynchronous. Since our current AudioManager is
running synchronously and would not work asynchronously (functions are
expected to return valid data on function return) it is necessary to
massage the PA API until it runs synchronously.

This is done with a general workflow of

1. Register a callback function (`pa_context_get_source_info_list()`,
        for example).
2. Run the PA loop through `customPulseLoop()`. This will trigger
any registered callbacks. Sometimes a `void*` is passed through the
callback that can be used for custom data. `successCallback()` uses
this to set the success variable.
3. Run the callback function and do required work.
4. Return to original function, do work or return values.

It is not possible to run a `customPulseLoop()` inside of an already
running loop (inside a callback), as this will lead to a PA assert
error on runtime.
username223 added a commit that referenced this issue Apr 8, 2020
Source outputs must all be moved to new default source.
Reference topic
https://askubuntu.com/a/72076

* Adds microphone controls on Linux via PulseAudio (PA) for several
points in
#43.

It can not be overstated how unsuited the public AudioManager API is for
using the PA API.

It can also not be overstated how undocumented and horrible the PA API
is. The PA way of doing audio is very unlike the Windows way of doing
audio, which the AudioManager is heavily influenced by.

Since I don't have a Linux machine I have not been able to personally
test this. https://github.com/feilen/ has graciously helped with
testing.

PulseAudio is very undocumented and not very widely used for what we
need outside of official utilities. As such there's most likely a better
way of doing things than I've done.
Additional information can be found at
https://github.com/username223/pulseaudio-device-changing.

The "complex" PA API is asynchronous. Since our current AudioManager is
running synchronously and would not work asynchronously (functions are
expected to return valid data on function return) it is necessary to
massage the PA API until it runs synchronously.

This is done with a general workflow of

1. Register a callback function (`pa_context_get_source_info_list()`,
        for example).
2. Run the PA loop through `customPulseLoop()`. This will trigger
any registered callbacks. Sometimes a `void*` is passed through the
callback that can be used for custom data. `successCallback()` uses
this to set the success variable.
3. Run the callback function and do required work.
4. Return to original function, do work or return values.

It is not possible to run a `customPulseLoop()` inside of an already
running loop (inside a callback), as this will lead to a PA assert
error on runtime.
@username223
Copy link
Member Author

@Goofybud16 uses a script to emulate the mirror device:

pactl load-module module-loopback sink=alsa_output.usb-Yamaha_Corporation_MG-XU-00.analog-stereo source=alsa_input.usb-Valve_Corporation_Valve_VR_Radio___HMD_Mic_8B37344787-LYM-01.mono-fallback
pactl load-module module-null-sink sink_name=Youtube
pacmd update-sink-proplist Youtube device.description=Youtube
pactl load-module module-loopback source=Youtube.monitor sink=alsa_output.usb-Yamaha_Corporation_MG-XU-00.analog-stereo
pactl load-module module-loopback source=Youtube.monitor sink=alsa_output.pci-0000_2f_00.1.hdmi-stereo-extra3

Although this also creates a sink for outputting Youtube audio to the microphone.

The pactl and pacmd sources should help with this.

According to this SO link, paprefs may also be used for this, or the source inspected.

I believe paprefs uses module-combine-sink internally based on this.

@Goofybud16
Copy link
Contributor

Just want to make a clarification:

Since being shown module-combine-sink, I've updated my script to use that.

Also, the script with the null-sink and loopback introduces much more latency than the combine-sink, while achieving the same goal [one audio sink that plays to two physical devices that can individually have the playback volume turned up/down from the sink vs other audio sources].

@username223
Copy link
Member Author

@Goofybud16 Thanks. Could you paste the new script here, just for completeness?

@Goofybud16
Copy link
Contributor

pactl load-module module-loopback sink=alsa_output.usb-Yamaha_Corporation_MG-XU-00.analog-stereo source=alsa_input.usb-Valve_Corporation_Valve_VR_Radio___HMD_Mic_8B37344787-LYM-01.mono-fallback
pactl load-module module-combine-sink sink_name=Youtube slaves=alsa_output.usb-Yamaha_Corporation_MG-XU-00.analog-stereo,alsa_output.pci-0000_2f_00.1.hdmi-stereo-extra3
pacmd update-sink-proplist Youtube device.description=Youtube

and to undo that setup

pactl unload-module module-loopback
pactl unload-module module-combine-sink

The configuration this sets up is echoing the Index mic into my mixer [MG-XU], as well as creating a mirrored sound-source that plays into the Index headphones and the mixer.

The mirrored sound-source has individually controllable volumes, and I usually keep the one going into the mixer muted [I just manually mute it in pavucontrol once the script is run.]

Applications then pick up the microphone input from the mixer.

It allows me to apply EQ to the HMD mic, as well as occasionally play a snippet of audio or something when relevant to a conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Linux Linux related items.
Projects
None yet
Development

No branches or pull requests

4 participants