Debian-minimal template for sys-audio

I recreated the template VM(using your commands, but excluded blueman) and changed my sys-audio’s template to the new template. It’s getting other VM’s streams in “Playback”, but it didn’t properly utilize my soundcard. It’s “Dummy Output” in “Output Devices”.

I then backup’ed sys-audio, deleted it and created a fresh AppVM, calling it sys-audio(to avoid playing with policies), and adding sevice “audiovm”. It’s also automatically receiving streams from newly started VMs. I didn’t even manually start the daemon! Although “Output Device” was still a mess. But that doesn’t seem to be your problem.

When I switched my newly created sys-audio’s audio back to deb11-min-audio (the old template), my soundcard was working again. So the main difference between the two templates is the soundcard problem. If this isn’t your problem, then I’m afraid I cannot reproduce your problem.

In your “Output Devices”, you may see a card called “Built-in Analog stereo Duplex”. If that’s the case, then you card is working properly.

Well, I also choose to recreate the template and sys-audio, it started run media but with broken sound, then I create snd.conf, and now works insanely perfect! Thanks for your help, I appreciate it!

Nice work!

Just a little notice:
I found that if you installed and enabled hardened-malloc on your template, sys-audio will not run properly, other vm’s will not truely passthrough to sys-audio (because the vm’s soundbar aren’t shown on sys-audio’s pavucontrol “Playback” section, which should be shown).

Maybe there’s a solution of using both of them but it seems need lots of works. I just disable it and it runs properly.

Because this is in line with how Qubes provides security: security through compartmentalization. With sys-audio, you don’t have to trust the huge code of PulseAudio running in dom0 anymore. Moreover, you can securely use Bluetooth without interfering with dom0. It’s basically the same reason as the one for the sys-gui.

2 Likes

After 5 days, sys-audio still works perfect but I now missed the shortcut keys “fn+F1/F2/F3”. Is it possible to make it persistent? Or possibilities of making shortcut keys on services qube?

To deal with Fn hotkeys needs to interact with EC on your motherboard, so it’s mostly impossible to keep it persistent. Maybe you can define a hotkey to run a script in dom0, that qvm-run some commands in sys-audio, that tunes volume in sys-audio.

1 Like

Is the format like qvm-run sys-audio '<commands-you-needed>'? which needs the " ’ " ?

amixer sset Master 2%+
amixer sset Master 2%-
amixer sset Master 0 (note that for better experience of switching between mute/unmute, using the same hotkey, see below)
Thanks @tzwcfq ,
amixer sset Master toggle

2 Likes

Go to dom0 → Settings Manager → Keyboard → Application Shortcut → +Add:

Command: qvm-run -p sys-audio ‘@augsch command’ (Increase, decrease, mute respectively)
Then make your decided keyboard shortcut.
Done!

2 Likes

Yep! I’ve also tested it.

In my KDE environment, I can reassign those Fn hotkeys, so it’s native experience.

Oh I’m using XFCE. I once used KDE in another linux distro, but this time in Qubes I tried to configure the looks in… should I called it raw? Anyway it is a good experience! :laughing:

To use Fn+F1 to switch between mute/unmute, I created 3 little script.

mute.sh:

#!/bin/sh
qvm-run sys-audio "amixer sset Master mute"
./swap.sh

unmute.sh:

#!/bin/sh
qvm-run sys-audio "amixer sset Master unmute"
./swap.sh

swap.sh:

#!/bin/sh
cat mute.sh > temp
cat unmute.sh > mute.sh
cat temp > unmute.sh

And in your desktop env, create a hotkey to run mute.sh.

This solution is better than the previous one.

It seems nice, I make this later!
But isn’t the swap.sh should looks like:

#!/bin/sh
cat ./mute.sh > temp
cat ./unmute.sh > ./mute.sh
cat temp > ./unmute.sh

this?

I’ve tested your version and doesn’t succeed to the goal, and I’ve tested different version, whether have ./ or not, whether in swap, or mute or unmute. I’m still testing and report if success…

Still cannot success…

I thought it was the wrong formatting but it’s not.
I ran it through terminal: sh mute.sh, the function of mute and unmute can be swap, but when ran the <mute-function-stored>.sh, it will return this error:

<mute-function-stored>.sh: line 4: h: command not found

“What? It is not possible! Maybe I’ve typed wrong” But the result of cat <mute-function-stored>.sh tells me, I typed correctly, there’s no line 4… Whatever, it works through terminal.
The point is, when I make the hotkey, press the hotkey, IT WON’T WORK.
The hotkey is just straightly mute.sh or unmute.sh right?
I’m sorry that maybe I’m still Linux noob, but I really don’t know what’s going wrong…

Well, I think that “./” just means to “execute” here. When using cat, you just need to provide the files’ directory. Maybe I’m wrong.

I experienced the same error, however, it simply doesn’t matter on my side. My speakers are correctly muted and unmuted.

Yes, but maybe you have to provide it with mute.sh's absolute directory. Or did you chmod +x mute.sh?

On my side, it doesn’t matter if it runs in terminal, however if it’s run through hotkey, it doesn’t works.

I’ve done all of two, still not work…