qubes-issues icon indicating copy to clipboard operation
qubes-issues copied to clipboard

Dynamic audiovm switching

Open marmarek opened this issue 11 months ago • 8 comments

How to file a helpful issue

The problem you're addressing (if any)

Currently, changing audiovm requires target qube restart in practice. Technically, it is possible to change it without qube restart, if you know which services to restart in what order etc, but that's very much not obvious. This also includes the case of restarting said audiovm.

The solution you'd like

Changing audiovm at runtime should be seamless, as is changing netvm.

The value to a user, and who that user might be

Easier to use non-dom0 audiovm, mostly relevant for USB audio devices. Related to #7750, #8093.

Details

Implementation-wise, this requires:

  • [x] dom0 changing relevant qubesdb (or else) entry when audiovm is changed or (re)started
  • [x] pulseaudio agent watching said qubesdb entry and re-establishing vchan connection when needed
  • [x] pipewire agent doing the same
  • [ ] stubdomain (currently also pulseaudio) agent doing the same - a caveat here, currently stubdomain doesn't have qubesdb at all (and has hardcoded domid=0 as audiovm), but it does have qrexec-agent

marmarek avatar Feb 25 '24 15:02 marmarek

Changing audiovm when recording is enabled is confusing. It's because the recording state is in fact hold by the pacat process in a specific audiovm - after switching, the new audiovm doesn't know if it was enabled. The result is recording gets disabled after switching (until you switch back, where the old pacat still knows it), but the devices widget thinks it's still enabled (and fails to detach microphone). qvm-device mic shows the correct state.

Steps to reproduce:

  1. Set audiovm of testvm to dom0
  2. Start testvm
  3. Enable recording (either via widget or via qvm-device mic at testvm dom0:mic)
  4. Set testvm's audiovm to sys-audio
  5. Observe the widget still shows mic attached, but qvm-device mic doesn't. Recording doesn't work. Can be fixed with qvm-device mic at testvm dom0:mic again
  6. Switch audiovm back to dom0.
  7. Observe recording remains enabled (as it was enabled in dom0 before).

I see two options:

  1. Re-enable microphone after switching audiovm, if recording was enabled before (and similarly, ensure it's disabled after if it was disabled before).
  2. Emit synthetic mic detach event on audiovm switch, so the widget knows it got disabled. But also, ensure it really gets disabled (see the case of switching back and forth).

marmarek avatar Apr 24 '24 15:04 marmarek

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.3 testing repository for the Debian template. To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar Apr 29 '24 15:04 qubesos-bot

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.3 testing repository for the Debian template. To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing trixie-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar Apr 29 '24 15:04 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.3 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

qubesos-bot avatar Apr 29 '24 15:04 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.3 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

qubesos-bot avatar Apr 29 '24 15:04 qubesos-bot

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.2 testing repository for the Debian template. To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar May 02 '24 10:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

qubesos-bot avatar May 02 '24 11:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

qubesos-bot avatar May 02 '24 11:05 qubesos-bot

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.2 testing repository for the Debian template. To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing trixie-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar May 07 '24 23:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

qubesos-bot avatar May 07 '24 23:05 qubesos-bot

@marmarek only remains this recording issue right? I think I've experimented it but I would need to retry.

fepitre avatar May 13 '24 09:05 fepitre

On Mon, May 13, 2024 at 02:18:51AM -0700, Frédéric Pierret wrote:

@marmarek only remains this recording issue right? I think I've experimented it but I would need to retry.

Yes, only this one. I talked with Marta about it, and she says it's better to keep recording status (option 1 above), but it may be not easy to implement...

-- Best Regards, Marek Marczykowski-Górecki Invisible Things Lab

marmarek avatar May 13 '24 10:05 marmarek

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 testing repository for the Fedora template. To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

qubesos-bot avatar May 15 '24 23:05 qubesos-bot

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.2 stable repository for the Debian template. To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.2 stable repository for the Debian template. To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 stable repository for the Fedora template. To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 stable repository for the Fedora template. To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 stable repository for the Fedora template. To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot

Automated announcement from builder-github

The component core-admin-client (including package core-admin-client) has been pushed to the r4.2 stable repository for the Fedora template. To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot