Missing audio in libvirt/qemu/virt-manager VM, suspect missing audio driver

I sometimes play around with distros, but I’m missing audio.
And I noticed that for arch, they have a qemu-audio-pipewire plugin and I can’t seem to find in the guix package repository. Nor can I find the audio-pipewire.so library in the guix qemu package.

Is that why I have no audio?

If so, is there a quick way to fix this issue?

clone the guix source and grep for that string

git clone https://codeberg.org/guix/guix && cd guix
grep -re '\bqemu.*pipewire\b' gnu/packages # or something like that

guix search also accepts quoted regexp. once you find the package name, use guix edit $pkgname

… or are you already searching in the source?

1 Like

It looks like arch has something of a metapackage for qemu (see qemu-desktop in the PKGBUILD if you want).

it looks like that metapackage passes the options needed to build in build(). at some point, the _pick() function extracts the artifacts and packs them into individual packages… jeez whoever wrote _pick() really didn’t want anyone to understand it lol. it’s terse.

you may need to write something like:

(define qemu-with-pipewire
 (package
  (inherit qemu)
  (name "qemu-with-pipewire")
  ;; ...
))
  • Then slightly change the package’s inputs
  • add one or two build flags
  • ensure that any other files needed are also in their correct place.

However, that’s not a fantastic first package if you haven’t written one before. Iterating on that will take a long time, then you can only know it works by replacing the instance on your system. It’s slightly less burdonsome maybe if it’s in a VM … but not much easier.

Try modifying build flags and inputs for something that already exists or building a package that doesn’t. Definitely refer to “The perfect setup” section in the manual.

1 Like

… or are you already searching in the source?

No. I’m looking at this as too much work for now.
Stuff like this takes me a long time and I have yet to create my first package.

VM with audio is not my first priority if it becomes a small project in my list of small projects.

I had the same issue. Try installing the gst-plugins-good package, that fixed the issue for me.

1 Like

You will eventually need to write packages, especially if you’re using Guix as a daily driver. Fortunately, it’s much easier than on other distros.

1 Like

That didn’t work for me.
Does one have to reboot the host for it to work?

hmm, i don’t remember rebooting. Did you install it in your user profile or system-wide in your configuration? Cause i installed it system-wide, maybe that makes a difference.

1 Like

User profile, but I tried system-wide and that doesn’t seem to work either.
I added gst-plugins-base as well to no avail. I have noticed that virt-manager has issues with failing to load gstreamer plugins.

(.virt-manager-real:15921): GSpice-WARNING **: 21:23:07.102: Failed to create pipeline: pas d’élément « appsrc »
/gnu/store/h0raiynr5liyf8ri2sxkk9mpkdyrvdv8-python-pygobject-3.50.0/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
  return Gio.Application.run(self, *args, **kwargs)
/gnu/store/h0raiynr5liyf8ri2sxkk9mpkdyrvdv8-python-pygobject-3.50.0/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
  return Gio.Application.run(self, *args, **kwargs)
/gnu/store/h0raiynr5liyf8ri2sxkk9mpkdyrvdv8-python-pygobject-3.50.0/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  return Gio.Application.run(self, *args, **kwargs)

(.virt-manager-real:15921): GSpice-WARNING **: 21:23:07.103: Failed to create pipeline: pas d’élément « autoaudiosrc »```

What else have you installed system-wide that might be used by virt-manager?

Hmm, that’s strange. I don’t remember the exact error i encountered, but it does look similar to what i had. Aside from gst-plugins-good, the only other audio-related package in my system config is alsa-utils, but i don’t think that would do anything. I suppose it’s worth a try though.

That didn’t work either.

What about virt-manager itself? Do you have that installed system-wide?