Audio qube

Do you use USB keyboard with sys-usb?
And when you start sys-audio qube then layout switching is being unreliable?

Sorry I missed part of the directions. Please ignore.

I see this patch is still pending, was it ever sent as a PR? Or is there something blocking it being added officially? This guide has been helping many people for a long time so it would be nice to make it easier for more people to use.

I did sent a pull request last year.

Currently, there is quite a lot of activities on this subject by the QubesOS team: Dynamic audiovm switching · Issue #8975 · QubesOS/qubes-issues · GitHub

I did not sent a pull request for the the last ~5 lines of modification still currently required. Will do maybe later.

This guide has been helping many people for a long time so it would be nice to make it easier for more people to use.

Most of this guide could be automated with a bash script / Salt script. But currently, I don’t really want to try to understand how Salt work

2 Likes

Thanks for this guide. I’ve tried to follow it step by step but I’ve some problems to get it working. In the sys-audio qube when I test that sound works via aplay I get the error:

$ aplay /usr/share/sounds/alsa/Noise.wav
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

The status of pulseaudio service is:

● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
             /usr/lib/systemd/user/pulseaudio.service.d
             └─30_qubes.conf
     Active: activating (start-pre) since Thu 2024-05-23 20:11:40 CEST; 15s ago
TriggeredBy: ● pulseaudio.socket
  Cntrl PID: 1116 (qubesdb-read)
      Tasks: 1 (limit: 381)
     Memory: 212.0K
        CPU: 10ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pulseaudio.service
             └─1116 /usr/bin/qubesdb-read -w /qubes-audio-domain-xid

May 23 20:11:40 sys-audio systemd[623]: Failed to start pulseaudio.service - Sound Service.
May 23 20:11:40 sys-audio systemd[623]: pulseaudio.service: Scheduled restart job, restart counter is at 29.
May 23 20:11:40 sys-audio systemd[623]: Starting pulseaudio.service - Sound Service...

but when I try to start it, after a few seconds, I get the error:

systemctl --user start pulseaudio.service
Job for pulseaudio.service failed because a timeout was exceeded.
See "systemctl --user status pulseaudio.service" and "journalctl --user -xeu pulseaudio.service" for details.

Running pulseaudio -v outputs the error:

I: [pulseaudio] module.c: Loaded "module-filter-apply" (index: #19; argument: "").
W: [pulseaudio] cli-command.c: stat('/etc/pulse/default.pa.d'): No such file or directory
I: [pulseaudio] main.c: Daemon startup complete.
E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer 'org.bluez': unit failed
I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_07.0.hdmi-stereo idle for too long, suspending ...
I: [alsa-sink-HDMI 0] alsa-sink.c: Device suspended...
I: [pulseaudio] main.c: Got signal SIGINT.
I: [pulseaudio] main.c: Exiting.
I: [pulseaudio] main.c: Daemon shutdown initiated.

With journalctl I can see that pulseaudio is restarting continuously:

May 23 21:02:26 sys-audio systemd[623]: Failed to start pulseaudio.service - Sound Service.
May 23 21:02:27 sys-audio systemd[623]: pulseaudio.service: Scheduled restart job, restart counter is at 57.
May 23 21:02:27 sys-audio systemd[623]: Starting pulseaudio.service - Sound Service...
May 23 21:03:12 sys-audio systemd[623]: pulseaudio.service: start-pre operation timed out. Terminating.
May 23 21:03:12 sys-audio systemd[623]: pulseaudio.service: Failed with result 'timeout'.
May 23 21:03:12 sys-audio systemd[623]: Failed to start pulseaudio.service - Sound Service.
May 23 21:03:12 sys-audio systemd[623]: pulseaudio.service: Scheduled restart job, restart counter is at 58.
May 23 21:03:12 sys-audio systemd[623]: Starting pulseaudio.service - Sound Service...

I don’t know how to fix these problems. Help would be really appreciated.

Could be related to recent change in how audio work. Need to update the guide it you confirm the following things solve your issue.

In your sys-audio vm:

qubesdb-write '/qubes-audio-domain-xid' 1
systemctl --user restart pipewire

Does it work now ?
If it work, try to set the audiovm of sys-audio as itself.
In dom0

qvm-prefs sys-audio audiovm sys-audio
1 Like

It helped but not fixed completely the problem. After restarting pipewire I tried to play again the test sound. Now the pulseaudio is started but no sound is played:

$ aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE  '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rated 48000 Hz, Mono

and the prompt is not returned.

Do the other part of the guide too. Especially the “configure service” part

I’ve already done the full guide, but still I’m not able to make it work. Currently the sound test fails and in pavucontrol I only see my Nvidia card (HDMI) and vchan. No analog duplex. But I’ve two attached devices: Intel Corporation Comet Lake PCH cAVS and NVIDIA Corporation.

Anyway I will repeat the full process if it makes easier for you to help me.

It’s me again, and probably with a stupid question, but i just don’t know how to solve it.
After the last problem i followed all steps, the test sounds works. after sys-audio has started, the next qube starting shows an error

Blockquote
Denied: admin.vm.property.GetAll

In the guide it says that some files need to be patched, in one of it, there is a comment with:

Don’t use GetAll qubes policy request for audiovm

I just do not know how i don’t use GetAll - since this is the problem, i guess.

maybe someone can help me?
thanks a lot in advance for help

Followed the new tutorial and still can’t get it to work properly. The audio works in the sys-audio qube just fine, but doesn’t work in any other qube. Still can’t figure out what I’m doing wrong or whether it has something to do with my hardware.

Edit: Since only sys-audio works, I created a dedicated qube for audio which works out fine.

Hi again. I’ve not been able to make the sys-audio thing to work using a fedora template so I’ve repeated the process from scratch but now using a debian-12 template. The result is not yet good enough but I’ve made some progress. Currently I can attach an appVM to sys-audio via qvm-prefs command and get audio working in that appVM but something is wrong with the hardware detection. I have two audio cards, attached to sys-audio:

$ qvm-device pci ls sys-audio
BACKEND:DEVID  DESCRIPTION                                          USED BY
dom0:00_1f.3   Audio device: Intel Corporation Comet Lake PCH cAVS  sys-audio (no-strict-reset=True)
dom0:01_00.1   Audio device: NVIDIA Corporation                     sys-audio (no-strict-reset=True)

When I run pavucontrol in the appVM I see no audio cards in the configuration tab, the only input device is Qubes Virtual Audio Source and the only output device is Qubes Virtual Audio Sink. Running alsamixer, the sound cards are not detected.

In sys-audio pavucontrol starts but works badly (I cannot move from one tab to a different one). Running alsmixer both sound cards are detected.

How can I fix those problems? TIA

(I cannot move from one tab to a different one).

Like, it is very slow ? does sys-audio consume a lot of CPU or anything similar ?

In the “configuring policy” part of the guide, in the “recommended way” there is a patch for the file “qvm_start_daemon.py” that solve this issue

1 Like

Well, I don’t understand what happened yesterday but today everything works just fine :sweat_smile:. It seems I made too many changes and the system had to be restarted.

Like, it is very slow ? does sys-audio consume a lot of CPU or anything similar ?

No, no very slow. Simply non responsive, It was stuck in the Playback tab and I was totally unable to change to a different one. I don’t know about CPU usage cause I cannot reproduce the problem.

Anyway, thanks a lot for your great guide and for your valuable help.

1 Like

Simplified the “configuring policy” part based on this discussion: Monitor and update keyboard layout only if the qube asked to be a guivm by neowutran · Pull Request #237 · QubesOS/qubes-core-admin-client · GitHub

2 Likes

Thanks a lot for answering all question - finally it works how expected!

1 Like

I just started using bluetooth (because now I can, thanks!), but I cannot figure out why cairo-dock is listed as required for bluetooth. This is an application dock, like on MacOS. I have also removed it and used bluetooth with no difference.

On another note, I’m pretty sure that with pipewire, the libspa-0.2-bluetooth is required. Mine wouldn’t connect and gave a “br-connection-profile-unavailable” error, and I diagnosed it to be this package that was necessary, and installing it fixed everything. Given my inexperience, I’ll wait for confirmation, but if someone will confirm I’ll add it to the guide.

It was required for bluetooth to work with pipewire in debian-12-minimal:

1 Like

I’ll go ahead and change the dock, and I’ll add a note for debian-12-minimal for the other package.