flathub / sh.ppy.osu

https://flathub.org/apps/details/sh.ppy.osu
MIT License
26 stars 14 forks source link

Audio options for PipeWire and JACK not showing up #80

Open Thesola10 opened 1 year ago

Thesola10 commented 1 year ago

I can only select direct ALSA access or Pulseaudio when running through Flatpak. I have a working install of PipeWire, and the AppImage version correctly reports JACK and PipeWire as options.

This is annoying seeing as PipeWire is the only reliable way to get low latency audio on Linux, and if I understand correctly, it should be relayed through the Flatpak sandbox, right?

Thesola10 commented 1 year ago

LD_DEBUG=libs reports that osu does not attempt to open libjack.so.0 (owned by PipeWire). It does when loaded using LD_PRELOAD but still doesn't "see" the audio option afterwards. I tried "feeding" it the PipeWire socket directly using --filesystem=xdg-run/pipewire-0 to no avail.

TheComputerGuy96 commented 4 months ago

The BASS audio library used by osu!(lazer) only supports ALSA for audio output (so PulseAudio/PipeWire have a compatibility layer)

Thesola10 commented 4 months ago

This does not explain the discrepancy with AppImage.

Thesola10 commented 4 months ago

@TheComputerGuy96 Okay, that was exactly correct actually, another thorough strace revealed that my system had additional ALSA config files for Pipewire and JACK under /etc/alsa/conf.d, which this Flatpak does not have. Should this issue be upstreamed to FreeDesktop Runtime?

It's especially odd given that the FreeDesktop runtime does have the requisite libasound_module_pcm_pipewire.so and libasound_module_ctl_pipewire.so libraries.

Thesola10 commented 4 months ago

This could be worked around by:

  1. Shipping /etc/alsa/conf.d/50-pipewire.conf from the Pipewire Project, likely in /app/etc/alsa/conf.d
  2. Appending :/app/etc/alsa/conf.d to the $ALSA_CONFIG_PATH env var.
Thesola10 commented 4 months ago

Upstream issue filed to Freedesktop SDK: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1722

Thesola10 commented 3 months ago

Upstream has been merged, this will be closed once this package is updated to the latest Runtime, or the backported fix makes it to Flathub