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

fix: Check for PipeWire as well as PulseAudio before falling back to ALSA #1565

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

alexhaydock
Copy link
Contributor

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

@alexhaydock alexhaydock changed the title Check for PipeWire as well as PulseAudio before falling back to ALSA fix: Check for PipeWire as well as PulseAudio before falling back to ALSA Jan 19, 2025
@szorfein
Copy link
Contributor

This will not work for pure Alsa system. Pipewire is always installed as dependencies for another app even if not used.

@szorfein
Copy link
Contributor

Maybe instead check if the pipewire service is running like

systemctl is-active pipewire

@alexhaydock
Copy link
Contributor Author

alexhaydock commented Jan 19, 2025 via email

@szorfein
Copy link
Contributor

szorfein commented Jan 19, 2025

if work for me if testing with pipewire-pulse if u can test

if ! command -v pacmd >/dev/null 2>&1 && ! command -v pipewire-pulse >/dev/null 2>&1; then

@alexhaydock
Copy link
Contributor Author

if work for me if testing with pipewire-pulse if u can test

if ! command -v pacmd >/dev/null 2>&1 && ! command -v pipewire-pulse >/dev/null 2>&1; then

Thanks! Have updated the PR to look for pipewire-pulse instead of just pipewire.

I think that's definitely more robust and I can confirm it works to solve the original bug still on Fedora 41. Should also cope with situations where the system is pure ALSA still, like you mentioned before.

@lj3954
Copy link
Member

lj3954 commented Jan 20, 2025

Could we not just check whether one of these servers is actively running?

if ! pidof pipewire 2>&1 /dev/null && ! pidof pulseaudio 2>&1 /dev/null; then

Copy link
Member

@lj3954 lj3954 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QEMU 8.1 added a pipewire audio backend. We should use it if possible. This should be a better solution in general.

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
@alexhaydock
Copy link
Contributor Author

QEMU 8.1 added a pipewire audio backend. We should use it if possible. This should be a better solution in general.

This looks good to me. Makes sense to actually use PipeWire natively if available in both QEMU and on the host. My testing on Fedora 41 suggests this works perfectly.

Having accepted your suggestion directly within the GitHub UI, there are now two commits with different solutions to the original issue so when merging it will make sense to squash them.

@lj3954 lj3954 merged commit 0c772d5 into quickemu-project:master Jan 20, 2025
4 checks passed
zen0bit pushed a commit to oSoWoSo/quickemu that referenced this pull request Feb 13, 2025
…ALSA (quickemu-project#1565)

* fix: Check for PipeWire as well as PulseAudio before falling back to ALSA

* fix: Use PipeWire backend if available, and where QEMU version is >8.1

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: VMs crashing on Fedora 41 as a result of #1480
3 participants