Skip to content

Conversation

@kajusnau
Copy link
Collaborator

@kajusnau kajusnau commented Jan 9, 2026

Supersedes #1652

Description of Changes

Changes

  • Reworked audio config:
    • Introduced server and client configs
    • audio-vm is now the server:
      • In charge of all audio HW
      • Main PipeWire instance runs here, along with 2 pipewire-pulse servers
    • All other systems are now clients
    • clients can optionally enable pw socket forwarding, which also needs to be enabled in the server
  • Removed ghaf-audio namespace
  • Removed ghaf-audio-control tool in favor of pavucontrol
  • Restructured the ghaf.services.audio namespace
  • Audio configuration is confined within the ghaf.services.audio namespace
  • Removed all audio config from cosmic and gui-vm configs

New functionality

  • pavucontrol (Volume Control in app library) app - added to gui-vm. Provides fine-grained volume and sound-related control for the entire system.
  • Cosmic Settings Sound page - fully functional settings page for Output/Input device selection, volume control, device profile selection and more.

Topology:

graph TD
    %% Audio VM
    subgraph AudioVM["Audio VM"]
        subgraph PipeWire["PipeWire"]
            PWPulse1["PW Pulse server (restricted)"]
            PWPulse2["PW Pulse server (unrestricted)"]
        end
    end

    %% GUI VM
    subgraph GUIVM["GUI VM"]
        CosmicDE["System sounds"]
        Pavucontrol["pavucontrol"]
        CosmicSettings["Settings App"]
    end

    %% Other VMs
    subgraph VM1["Comms VM"]
        Slack["Slack"]
    end

    subgraph VM2["Chrome VM"]
        Chrome["Chrome"]
    end

    %% Connections

    %% GUI VM audio (unrestricted)
    CosmicDE -->|"PULSE_SERVER"| PWPulse2
    Pavucontrol -->|"PULSE_SERVER"| PWPulse2

    %% GUI VM control (PipeWire socket)
    CosmicSettings <-.->|"PipeWire socket (via givc)"| PipeWire

    %% Other VMs audio (restricted)
    Slack -->|"PULSE_SERVER"| PWPulse1
    Chrome -->|"PULSE_SERVER"| PWPulse1

Loading

Known Issues

  • Plugging in 3.5mm device might not automatically select the 3.5mm headphone profile.
    This can still be done manually via Cosmic Settings -> Sound -> Device Profiles
  • Changing the input device via the settings page or the applet may sometimes reset to the previously selected device:
    • e.g. Changing from "Digital Microphone" to "Stereo Microphone" and then adjusting Microphone volume might result in the input device being changed back to "Digital Microphone" automatically. Cause unknown as of yet.
    • Can be avoided entirely if changing the input device via "PipeWire Volume Control (pwvucontrol)" app
  • Adjusting volume with keyboard shortcuts may cause cosmic-settings-daemon or cosmic-osd to spike to 100% CPU usage.
    Upstream bug. cosmic-osd will be re-started automatically if this happens, but cosmic-settings-daemon will not.

Type of Change

  • New Feature
  • Bug Fix
  • Improvement / Refactor

Related Issues / Tickets

Checklist

  • Clear summary in PR description
  • Detailed and meaningful commit message(s)
  • Commits are logically organized and squashed if appropriate
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • Author has run make-checks and it passes
  • All automatic GitHub Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing Instructions

Applicable Targets

  • Orin AGX aarch64
  • Orin NX aarch64
  • Lenovo X1 x86_64
  • Dell Latitude x86_64
  • System 76 x86_64

Installation Method

  • Requires full re-installation
  • Can be updated with nixos-rebuild ... switch
  • Other:

Test Steps To Verify:

  1. Verify all audio related functionality works as expected, including but not limited to:
    • Verify audio devices appear and can be freely managed in the cosmic-applet-audio applet and cosmic-settings
    • Verify volume adjustment keyboard shortcuts work as expected
  2. Investigate CPU usage problems while adjusting audio:
    1. In gui-vm run htop and observe CPU usage
    2. Adjust volume via applet, keyboard shortcuts, or otherwise; play/pause audio; change audio devices;
    3. Ensure CPU usage for any one process does not stay at 100% for an extended period of time (offending processes should be automatically killed and restarted within ~30s (except cosmic-settings-daemon, which cannot be restarted))
  3. Verify screen recording works as before via ghaf-screen-record or the keyboard shortcut (SHIFT+ALT+CTRL+R)

@milva-unikie
Copy link

I did a quick round of testing on Darter Pro

  • Integrated audio devices are working well
  • USB headset works
  • With 3.5 mm and Bluetooth headsets the audio output works but microphones don't work

@kajusnau kajusnau marked this pull request as ready for review January 12, 2026 13:07
@kajusnau kajusnau added the Needs Testing CI Team to pre-verify label Jan 12, 2026
@kajusnau kajusnau removed the Needs Testing CI Team to pre-verify label Jan 12, 2026
- introduced 'server' and 'client' configs
- audio-vm is now the 'server', in charge of all audio hw
- all other systems are now 'clients'
- 'clients' can optionally enable pw socket forwarding
- removed all audio-related configs from gui-vm/cosmic
- removed ghaf-audio namespace
- removed ghaf audio control tool, replaced by pavucontrol
- re-enabled all sound-related settings in cosmic DE

Signed-off-by: Kajus Naujokaitis <[email protected]>
@milva-unikie
Copy link

TL;DR: all good ✅

Tested on Darter Pro (new installation)

  • Integrated, USB, 3.5 mm and Bluetooth audio devices all work.
  • Audio controls in the applet, Cosmic Settings and Volume Control (pavucontrol) work.
  • Keyboard shortcuts for changing the volume work.
  • After all testing there were no processes using 100 % CPU.
  • Screen recording works.
  • From the Known issues I noticed that adjusting the volume from the audio applet sometimes does not work with USB or 3.5 mm audio devices. Keyboard shortcuts work in these situations and re-plugging the device fixes the issue.

Tested on Lenovo X1 (new installation)

  • Integrated, USB, 3.5 mm and Bluetooth audio devices all work.

There are failures in the jenkins-pre-merge pipeline because the process name of cosmic-settings changes. A fix for that in tiiuae/ci-test-automation#620, needs to be merged together with this PR (@brianmcgillion)

@milva-unikie milva-unikie added Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon Tested on System76 and removed Needs Testing CI Team to pre-verify labels Jan 14, 2026
@brianmcgillion brianmcgillion merged commit 23c038f into tiiuae:main Jan 14, 2026
31 of 32 checks passed
@kajusnau kajusnau deleted the audio-fix-alt branch January 15, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon Tested on System76

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants