Linux pipewire integration (Audio + Microphone)
This is not done by any means, just put up for anyone to see how things are progressing So far: main flow (pipewire source, getting data from one place to another) is kinda done, but i've yet to determine why only thing i get is pops into mic, it might be a multiple issues at once (buffer overload + trying to push all at once) Other issues are listed in TODO's
I haven't reviewed completely. But linux specific code should go in crates/audio/src/linux.rs
I haven't reviewed completely. But linux specific code should go in
crates/audio/src/linux.rs
Please don't review it completely yet, its just in barely compilable state, not ready for any serious review of the code itself.
Cool! Any way to help?
Cool! Any way to help?
no not really unless you wanna pull a night of just reading documentation on oboe(not the rust crate but the google software one) oh and you somehow figure out what we're doing wrong so you have to know Rust too
Current progress: Both audio sink and microphone source are being created and working correctly! What's left to do: Refactor platform-specific code, overalll cleanup code and make UI edits to allow for native pipewire, make it default with fallback to cpal in case pipewire is missing or outdated (this specifically - unlikely scenario? code needs at least 0.3.49 pipewire).
I would say that the pipewire audio code can replace cpal for linux.
I think a fair amount of people still run pulseaudio and for them audio would not work at all. So either we make pipewire a hard requirement or we keep the cpal code around for the time being.
I've considered removing cpal, but i know that linux mint is still on pulse
That said, they won't have microphone and they can technically switch to pipewire (and they should really)
I'm 50/50 about this, but inclined to removing cpal from linux and going pipewire all the way, and point people to install pipewire.
I looked at it and basically all big distros (arch, debian, ubuntu, fedora, centos) have been shipping pipewire as default for at least a year, and every other sane distro has support for it. Even Mint will ship it as default in the upcoming release. So I think forcing pipewire should be the thing.
I looked at it and basically all big distros (arch, debian, ubuntu, fedora, centos) have been shipping pipewire as default for at least a year, and every other sane distro has support for it. Even Mint will ship it as default in the upcoming release. So I think forcing pipewire should be the thing.
Then i think that settles it, i would remove cpal from linux completely Would need to adjust ui with that as well, probably gonna make conditionals for audio section to remove parts of it on linux
I've considered removing cpal, but i know that linux mint is still on pulse
Linux Mint will be moving to PipeWire from the next release - https://blog.linuxmint.com/?p=4660. Obviously there will still be those on earlier versions of LM that are still on PulseAudio though, although maybe it'll be the nudge those users need to upgrade (or install PipeWire separately). :)
In current state:
Creates sink (ALVR Audio) and microphone (ALVR Microphone), they are working as a regular device (no different to others)
Replaced audio presets to just toggles
Advanced audio will be changed to hide older cpal device list for linux (not in this PR)
Only thing left to do is remove on connect script from setup guide, maybe even make a migration so that it will be removed to not interfere with pipewire from this PR
Opened PR for review, for suggestions, and will use it for the time being to find any inconsistencies or issues if there will be any
~~trying this PR, i cannot get the microphone (im using a quest 2) to work (i couldnt get it to work on master branch either), i built both the client and server from source on this branch, and with reset settings, with no pipewire connection scripts, all the audio stuff enabled with default settings~~ ~~i see the audio devices like this post, and pc -> quest audio works fine, but i cannot get quest -> pc mic working, theres just no audio on the device, is there something specific i have to do? i did give the app mic permissions~~
~~im using pipewire on latest arch linux as of writing, with wireplumber~~
EDIT: i seem to have a hardware/software fault in my headset making the microphone not function at all (even with a USB mic), so disregard the above
btw remaining issues causing CI failure are:
- macos is lacking an impl for AudioDevice, so that needs a stub
- linux CI is lacking the pipewire package, CI needs to install more pkgs
- windows is misc rust errors
Apart from the noted changes this lgmt, but I'm not fit to review rust code style