Sound crackin in multimediavm - debian12.- Qubes 4.2.2

Hello community!,

Im loving my QubesSetup, but I have some problems a while ago, that I really had the energy and time to debug atm.

The situation is this:
1- Start spotify in my multimedia template debian 12. (5000MB, 4vcpu)
2- Music starts, fine but after 2 hours (aprox) later some times it starts cracking ,
specially the music with lows in bass, I feel more crackling noise.
4- run “journalctl -f” and start seeing messages as this, just when the crackling noise starts warning me:
mod.qubes-audio: Overrun: asked to write 7528 bytes, but can only write 3764

/default.pa

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /etc/pulse/default.pa.d

system.pa

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /etc/pulse/default.pa.d

Debian 12 should now use pipewire instead of pulseaudio. The configuration files are located in /usr/share/pipewire.
Do you have a special setup or is it based on an unmodified debian-12 template (not counting the installation of spotify)?
Can you also check if you are running pulseaudio or pipewire in dom0? If you are running pulseaudio there, you should switch to pipewire with sudo qubes-dom0-update --switch-audio-server-to=pipewire and see if that improves the situation.

@DVM , multimedia template is based on qubes template, with only spotify installed atm. You are right Debian is using pipewire and dom0 is using pipewire too. Do you recommend me to comment modules i dont use? Atm the vm is not failiing, uptime of the vm is 2:49hrs. So im waiting for the crackiling noise, to start. I was wondering if disabling modules, like bluetooth or others could make the glitch go away.

Today it happend: Listening music, it started to fail. and then the screen Dim. Then move the mouse and the errors started reporting.


multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
Oct 14 18:31:39 mi-multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3432
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3760
Oct 14 18:31:39 mi-multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3432
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3916
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764
multimedia pipewire[670]: mod.qubes-audio: Overrun: asked to write 4096 bytes, but can only write 3764

You can try to take the default module configuration and change it.

In your multimedia qube:

mkdir -p ~/.config/pipewire/pipewire.conf.d/
cp /usr/share/pipewire/pipewire.conf.d/30_qubes.conf ~/.config/pipewire/pipewire.conf.d/

Then edit the file ~/.config/pipewire/pipewire.conf.d/30_qubes.conf and try to uncomment the first value, it seems similar to your issue.
Make sure you reboot the qube so it uses the correct configuration.

@DVM i tried to fix that, but it didnt worked :frowning:. Raised the max to 4096 and the min 1024. and nope. There is something else going on.

here is the pw-dump

"id": 0,
    "type": "PipeWire:Interface:Core",
    "version": 3,
    "permissions": [ "r", "w", "x", "m" ],
    "info": {
      "cookie": 00000000000,
      "user-name": "user",
      "host-name": "multimedia",
      "version": "0.3.65",
      "name": "pipewire-0",
      "change-mask": [ "props" ],
      "props": {
        "clock.power-of-two-quantum": true,
        "config.name": "pipewire.conf",
        "core.daemon": true,
        "core.name": "pipewire-0",
        "cpu.max-align": 32,
        "default.clock.allowed-rates": "[ 44100 48000 ]",
        "default.clock.max-quantum": 2048,
        "default.clock.min-quantum": 1024,
        "default.clock.quantum": 1024,
        "default.clock.quantum-limit": 8192,
        "default.clock.rate": 48000,
        "default.video.height": 480,
        "default.video.rate.denom": 1,
        "default.video.rate.num": 25,
        "default.video.width": 640,
        "link.max-buffers": 16,
        "log.level": 2,
        "mem.allow-mlock": true,
        "mem.warn-mlock": false,
        "object.id": 0,
        "object.serial": 0,
        "org.qubes-os.playback.buffer-size": 65536,
        "org.qubes-os.playback.target-buffer": 8192,
        "org.qubes-os.record.buffer-size": 1048576,
        "org.qubes-os.record.target-buffer": 8192,
        "settings.check-quantum": false,
        "settings.check-rate": false
      }
    }

You can try this: