The officially official Devuan Forum!

You are not logged in.

#151 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-09 16:35:57

@Danielsan

Don't you know that Debian/Devuan has already a very advanced dmix "configured with sane defaults"?

If you propose an alternative config, you may try to explain why your config is better than the default dmix config of Debian.

Debian/Devuan Defaults:

defaults.pcm.dmix.rate 48000
defaults.pcm.card 0
defaults.pcm.device 0

If you need 44.1 kHz sample rate and "card 1", you can set them in  ~/.asoundrc

$ cat ~/.asoundrc
defaults.pcm.dmix.rate 44100
defaults.pcm.card 1

These two lines are enough to set "default card" and default sample rate. A self-made dmix config is not needed.

Gentoo Wiki: ALSA: Configuration

When multiple sound cards are in use, the device numbers could be reordered across boots, such that using a name is advantageous.

If the correct name is unclear, a list of valid names can be easily obtained with:

cat /sys/class/sound/card*/id

Here is output from a developer's system that has multiple sound cards:

$ cat /sys/class/sound/card*/id
Q1U
HDMI
PCH
C930e

Here we have the Q1U microphone as Q1U, the builtin HDMI as HDMI, the analog audio jacks as PCH and a webcam's builtin microphone as C930e. Any of these are valid names for the card.

! Warning
Specifying numbers instead of names when multiple sound cards are used can result in device reordering across boots, which will prevent sound from working properly until the configuration file is edited to use the new number.

_https://wiki.gentoo.org/wiki/ALSA#Configuration

#152 Freedom Hacks » How to detect hidden ALSA resampling » 2025-11-07 16:07:53

igorzwx
Replies: 3

1. Make fftrate the default ALSA resampler

$ cat ~/.asoundrc
defaults.pcm.rate_converter "fftrate"
$ file 'rudra veena and pakhawaj.flac'
rudra veena and pakhawaj.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 49123284 samples
$ file audio_test_48kHz_16bit.wav
audio_test_48kHz_16bit.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz

2. Run media players with debug 2>&1

$ audacious 2>&1 'rudra veena and pakhawaj.flac'
Input:  44100 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 940
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1024
Rates:  30080 --> 32768 (J: 0.09%, T: FFT, W: Vorbis)
Ok.
$ /usr/bin/totem 2>&1 'rudra veena and pakhawaj.flac'
Input:  44100 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 940
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1024
Rates:  30080 --> 32768 (J: 0.09%, T: FFT, W: Vorbis)
Ok.

Notice that Jitter = 0.09%

Rates:  30080 --> 32768 (J: 0.09%, T: FFT, W: Vorbis)

It means that resampling is not exact. This is because of Debian/Devuan defaults:

period_size  1024
periods      16 

See: /usr/share/alsa/pcm/dmix.conf

$ mpv 2>&1 'rudra veena and pakhawaj.flac'
 (+) Audio --aid=1 (flac 2ch 44100Hz)
AO: [alsa] 48000Hz stereo 2ch s16
$ mpv 2>&1 audio_test_48kHz_16bit.wav
 (+) Audio --aid=1 (pcm_s16le 2ch 48000Hz)
AO: [alsa] 48000Hz stereo 2ch s16

3. Check hw_params

$ cat /proc/asound/cards
 0 [system]:  USB-Audio - iMic USB audio system
              Griffin Technology, Inc iMic USB audio system at usb-0000:00:1a.0-1.3.4, full s
$ cat /proc/asound/system/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 16384

This means that the default sample rate is 48kHz. Let us change it. Presumably, there is already a sort of invisible dmix, so that we can set defaults.pcm.dmix.rate in ALSA config.

$ cat ~/.asoundrc
defaults.pcm.rate_converter "fftrate"
defaults.pcm.dmix.rate 44100
$ /usr/bin/totem 2>&1 audio_test_48kHz_16bit.wav
Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 480
Output: 44100 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 441
Rates:  48000 --> 44100 (J: 0.00%, T: FFT, W: Vorbis)
Ok.
$ mpv 2>&1 audio_test_48kHz_16bit.wav
 (+) Audio --aid=1 (pcm_s16le 2ch 48000Hz)
AO: [alsa] 44100Hz stereo 2ch s16
$ mpv 2>&1 'rudra veena and pakhawaj.flac'
 (+) Audio --aid=1 (flac 2ch 44100Hz)
AO: [alsa] 44100Hz stereo 2ch s16
$ cat /proc/asound/system/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 2734
buffer_size: 11026

It works because dmix is already enabled.

Debian Wiki:
Advanced features such as mixing should already be configured with sane defaults.
_https://wiki.debian.org/ALSA#Configuration

This means that there is already a very advanced software mixer with dmix and other plugins configured for pulseaudio. It might be obvious that this strange construction was created to imitate "bit perfect" playback of audiophile apps for macOS: media players can easily change the default sample rate of the software mixer to avoid software resampling. Try "bit perfect" mode of Audacious for macOS. It makes sense for macOS, because the built-in HW resampler of the DAC is better than the software resampler of macOS.

Why do we need this Stone Age technology? Configure a normal mixer with arateconf and forget about problems with sound quality. The so-called "bit perfect" is not needed, because the fftrate resampler is much better than the built-in HW resampler of your DAC. You can safely configure fftrate for the maximal sample rate supported by your DAC.

NOTE: When software mixer configured by arateconf, mpv does not resample anything,

$ mpv 'rudra veena and pakhawaj.flac'
 (+) Audio --aid=1 (flac 2ch 44100Hz)
Input:  44100 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  44100 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.
AO: [alsa] 44100Hz stereo 2ch s16

Explanation:

$ mpv 'rudra veena and pakhawaj.flac'
 (+) Audio --aid=1 (flac 2ch 44100Hz)       # mpv Input 
AO: [alsa] 44100Hz stereo 2ch s16           # mpv Output --> ALSA software mixer

# ALSA software mixer: fftrate
Input:  44100 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  44100 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.

#153 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-06 21:06:30

$ audacious 2>&1 '08-Faust - Funeral March Of A Marionette [Tuncated, No Dither].flac'
Input:  352800 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 14112
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  352800 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.
$ audacious --version
Audacious 4.5-devel (Devuan 5 Daedalus)
$ inxi -Sxxx
System:
  Host: devuan Kernel: 6.1.0-40-amd64 arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.0 Desktop: MATE v: 1.26.0 info: mate-panel wm: marco v: 1.26.1 vt: 7
    dm: LightDM v: 1.26.0 Distro: Devuan GNU/Linux 5 (daedalus)

Yesterday 23:15:26
I had already explained you that 24bit means 32bit in this particular case

The 32-bit representation serves as a larger, more flexible "container" to preserve the higher precision of the 24-bit data and prevent clipping during internal mixing or editing, especially in professional digital audio workstations (DAWs). The 24-bit data is stored within the 32-bit format, ensuring its precision is maintained without needing resampling.

Why 32-bit is Used as a Container
DAWs and audio servers use 32-bit internally to avoid the complexities of dithering and exporting to fixed-point formats like 24-bit...
When 24-bit integer data is stored in a 32-bit container, the 24-bit precision is preserved within the larger format, similar to storing a number like 0100 in a longer string of zeros, like 00000100.

...the data buffers which these descriptors define will contain the actual sound samples (or have samples written into them) structured like the content of .wav files (though 20 and 24-bit samples must be padded out with zeros at the LSB end to make them all 32-bits long).
_https://wiki.osdev.org/Intel_High_Definition_Audio

#154 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-06 20:23:49

If believe that the PulseAudio ALSA plugin is harmless, you may also try believe that you have a "bit perfect" playback, unless you've explicitly enabled resampling in a conf file.

#155 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-06 14:07:31

It has nothing to do with jack

Try to debug mpv and other players with 2>&1
For example

mpv 2>&1 *.mp3

Arch Linux: A list of common issues and solutions for Podman
_https://man.archlinux.org/man/extra/podman/podman-troubleshooting.7.en

Container permission denied: How to diagnose this error
_https://www.redhat.com/en/blog/container-permission-denied-errors

#156 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-11-06 03:14:17

There is already arateconf utility to generate ALSA configs. It works in interactive mode. It is self-explanatory. The problem is that semi-deaf artists cannot use it because of dementia.

#157 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-06 02:07:23

If pulseaudio is removed, the PulseAudio ALSA plugin sits at the ALSA library level, intercepting all audio calls system-wide. This means every application that tries to use ALSA will encounter the broken plugin trying to route audio through the non-existent PulseAudio server. The leftover plugin blocks exclusive mode access and causes audio failures, making it impossible to achieve the low-latency, direct hardware access that removing PulseAudio was meant to enable.

This does affect sound quality, but semi-deaf artists might be perfectly happy with such a "fine ALSA".

#158 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 23:12:17

you have a container installed in your home folder, which you are not allowed to read

chown: cannot read directory '/home/rich/.local/share/containers/storage/overlay/.../work/work': Permission denied

Install mc, navigate to that container and check who is owner, which permissions

➤ apt show mc
Package: mc
...
Homepage: https://www.midnight-commander.org
...
Description: Midnight Commander - a powerful file manager
...

Do you have a sort of Podman installed?

#159 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 21:15:26

Everything works, fftrate can resample everything

I had already explained you that 24bit means 32bit in this particular case

The 32-bit representation serves as a larger, more flexible "container" to preserve the higher precision of the 24-bit data and prevent clipping during internal mixing or editing, especially in professional digital audio workstations (DAWs). The 24-bit data is stored within the 32-bit format, ensuring its precision is maintained without needing resampling.

Why 32-bit is Used as a Container
DAWs and audio servers use 32-bit internally to avoid the complexities of dithering and exporting to fixed-point formats like 24-bit...
When 24-bit integer data is stored in a 32-bit container, the 24-bit precision is preserved within the larger format, similar to storing a number like 0100 in a longer string of zeros, like 00000100.

...the data buffers which these descriptors define will contain the actual sound samples (or have samples written into them) structured like the content of .wav files (though 20 and 24-bit samples must be padded out with zeros at the LSB end to make them all 32-bits long).
_https://wiki.osdev.org/Intel_High_Definition_Audio

Everything works, fftrate can resample everything

You still have a problem with pulseaudio:

ERROR ../audacious-plugins/src/alsa/config.cc:238 [guess_element]: No suitable mixer element found.

Read this thread
_https://www.linuxquestions.org/questions/linux-software-2/alsa-error-no-suitable-mixer-element-found-and-can%27t-connect-to-pulseaudio-4175623535/

_https://www.linuxquestions.org/questions/linux-software-2/alsa-error-no-suitable-mixer-element-found-and-can%27t-connect-to-pulseaudio-4175623535/#post5818488
The issue was permission-based. I logged into x as root briefly and pavucontrol opened with no problem, as did Audacious.

So I then went to my user account and tried, as my user name

chown -R lysander /home/lysander

It told me that there are quite a few folders not owned by me, but by root. One of them was /home/lysander/.config/pulse, whose ownership changed to root around the time I was doing the install of alsaequal.

I changed the ownership to my user whilst inside the folder with

#chown -R lysander pulse

Now pavucontrol opens fine and Audacious doesn't show any errors.

I should be careful in the future with installions and using root.

lysander - is the username of that person,

chown means change ownership

#160 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 20:11:50

Try to play .dsf with Audacious

Free samples are available
_https://dev1galaxy.org/viewtopic.php?id=6716

$ audacious 2>&1 *.dsf
Input:  1411200 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 56448
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  1411200 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.

#161 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-05 17:41:00

Because of your personal Fletcher-Munson curve you may not hear the difference between your ALSA and pure ALSA

#162 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 17:29:59

libaudcore is inside Audacious
libaudcore is searching for "registered" plugins and cannot find them.

debdir/usr/lib/libaudcore.so.5.5.0

#163 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-05 17:06:33

Your ALSA is not pure, To get pure ALSA, you have to purge pulseaudio from libasound2-plugins
_https://dev1galaxy.org/viewtopic.php?id=7523

It is not enough to remove pulseaudio, you have to remove other crap to get "pure alsa".

Mate sound applet works with ALSA without problems.

EQ is needed for semi-deaf users to enhance high frequencies.

#164 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 16:27:13

If you want to try OSS4, you may better try it on ArchLinux.

Arch Linux AUR repository
_https://aur.archlinux.org/packages/oss

Package Details: oss 4.2_2020-2
Package Actions
View PKGBUILD / View Changes
Download snapshot
Search wiki
Git Clone URL:    https://aur.archlinux.org/oss.git (read-only, click to copy)
Package Base:    oss
Description:    Open Sound System UNIX audio architecture
Upstream URL:    http://developer.opensound.com/
Keywords:    oss
Licenses:    GPL2
Conflicts:    libflashsupport-oss-git, libflashsupport-oss-nonfree, oss-git, oss-nonfree
Submitter:    keenerd
Maintainer:    alexdw
Last Packager:    alexdw

Better oss-git:

_https://aur.archlinux.org/packages/oss-git
Package Details: oss-git 5693e1e-2
Package Actions
View PKGBUILD / View Changes
Download snapshot
Search wiki
Git Clone URL:    https://aur.archlinux.org/oss-git.git (read-only, click to copy)
Package Base:    oss-git
Description:    Open Sound System UNIX audio architecture
Upstream URL:    http://developer.opensound.com/
Keywords:    oss
Licenses:    GPL2
Conflicts:    libflashsupport-oss, libflashsupport-oss-nonfree, oss, oss-nonfree
Provides:    oss
Submitter:    Nowaker
Maintainer:    seawright
Last Packager:    seawright

I used PKGBUILD of oss-git package.

maybe therefore the error?

Error was because they both should be recompiled correctly.

#165 Re: Freedom Hacks » [HowTo] audacious_4.5-devel-1_amd64.deb (meson+samu and muon+samu) » 2025-11-05 16:09:34

It cannot find audacious-plugins, because they were compiled with another "audacions"

INFO ../src/libaudcore/plugin-registry.cc:431 [operator()]: Plugin not found: oss4

OSS4 plugin will not be compiled, because you do not have OSS4 installed. It will newer find it.

The method:
1. Compile Audacious
2. Install Audacious
3, Compile Audacious-plugins.
4. Install them

Do not enable OSS4 in the config, because you do not have it installed.

#166 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-05 15:35:27

Are you trying to instsall libasound2-plugin-fftrate from Devuan repositories?

You have to compile it and install with dpkg. Then you can find it with "apt show", for example

$ apt show libasound2-plugin-fftrate
Package: libasound2-plugin-fftrate
Version: 1.6.3
Status: install ok installed
Priority: optional
Section: libs
Maintainer: Petrov Sergey <petrovse@mail.ru>
Installed-Size: 172 kB
Depends: libasound2, libasound2-plugins
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: ALSA library additional plugin
 This package contains plugin for the ALSA library that are
 not included in the main libasound2 package.
 .
 The following plugins are included:
   - fftrate: FFT based rate converter
 .
 ALSA is the Advanced Linux Sound Architecture.
 .
 (Repackaged on Tue, 04 Nov 2025 03:13:01 +0100 by dpkg-repack.)

@bai4Iej2need

1. You have not read the manual.
2. You claim that is it "a rush job".

Are you a sort of pulseaudio activist?

#167 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-11-05 15:03:58

On the contrary, that would be a regress. If the brain is not trained it regresses.
The brains of semi-deaf, semi-blind, and half-demented victims of pulseaudio do need regular training.

The brain experiences cognitive decline if not mentally stimulated, a process often described as "use it or lose it". Just as a muscle weakens from inactivity, a lack of mental training can lead to reduced thinking skills, memory problems, and a decline in creativity. This is because the brain can be thought of as a muscle that strengthens and maintains its function through regular use and challenges.

#168 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-05 14:32:11

reboot is needed after removal of pulseaudio/pipewire
reboot is not needed for arateconf

fftrate should be configured for the maximum sample rate which is supported by your soundcard.
For example, Intel DHA codec (motherboard) supports 32bit 192khz (max), and you set 32bit 192khz with arateconf.
Then run test with arateconf (all audio apps should be closed, when you run test).

The fftrate resampler is much better than the built-in HW resampler of your sound card.
That is why fftrate should be configured for the maximum sample rate which is supported by your soundcard.

Most important, remove pulseaudio/pipewire and purge pulseaudio from libasound2-plugins
_https://dev1galaxy.org/viewtopic.php?id=7523

#169 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-05 13:24:41

Have you already purged pulseaudio from libasound2-plugins?

#170 Re: Freedom Hacks » How to purge pulseaudio from libasound2-plugins » 2025-11-04 22:03:41

If, for example, you enable "bit perfect" in Audacious and trying to play a DXD wave 352.8 kHz, Audacious will configure the software mixer of macOS (Audio Midi setup) to 88.2kHz  (352.8/4 = 88.2). As a result DXD will be downsampled by macOS resampler to 88.2kHz. But stupid mpv "bit perfect" will set the system mixer to 90kHz (then DXD will be downsampled by mpv with crappy resamplers). It means that both users and developers of mpv are ignorant of Arithmetic (and, perhaps, demented).

On macOS, you better try IINA, it supports both exclusive mode and bit perfect in a rather stupid way.

#171 Re: Freedom Hacks » How to purge pulseaudio from libasound2-plugins » 2025-11-04 21:40:14

I compilted it with OSS4.
Your mpv is compiled in exactly the same way as Audacious.
You should try Audacious "bit perfect" on macOS

Do you know what is "bit perfect" on macOS?

#172 Re: Freedom Hacks » How to purge pulseaudio from libasound2-plugins » 2025-11-04 21:14:57

You do not need it.

libjack-dev was installed as a build dependency for Audacious. It can be safely removed

What is your

audacious --version

libjack is a dependency for Audacious-plugins.

You may better remove almost all false dependencies from DEBIAN/control and correct version number of your Audacious

For example

Depends: libc6 

#173 Re: Freedom Hacks » ALSA without PulseAudio and PipeWire » 2025-11-04 20:58:46

Devuan 5 only

$ inxi -Sxxx
System:
  Host: devuan Kernel: 6.1.0-40-amd64 arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.0 Desktop: MATE v: 1.26.0 info: mate-panel wm: marco v: 1.26.1 vt: 7
    dm: LightDM v: 1.26.0 Distro: Devuan GNU/Linux 5 (daedalus)

#174 Re: Freedom Hacks » How to purge pulseaudio from libasound2-plugins » 2025-11-04 20:47:03

Run simulate without sudo

apt remove libjack-dev libjack0 --simulate

#175 Freedom Hacks » How to purge pulseaudio from libasound2-plugins » 2025-11-04 12:38:46

igorzwx
Replies: 8
source: alsa-plugins
https://tracker.debian.org/pkg/alsa-plugins
https://packages.debian.org/source/stable/alsa-plugins
http://deb.debian.org/debian/pool/main/a/alsa-plugins/alsa-plugins_1.2.12-2.dsc

NOTE: If needed, use dget --extract --allow-unauthenticated

Install build dependencies

sudo apt build-dep libasound2-plugins

Simulate

$ apt source libasound2-plugins --simulate
Reading package lists... Done
Picking 'alsa-plugins' as source package instead of 'libasound2-plugins'
NOTICE: 'alsa-plugins' packaging is maintained in the 'Git' version control system at:
https://salsa.debian.org/alsa-team/alsa-plugins.git
Please use:
git clone https://salsa.debian.org/alsa-team/alsa-plugins.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 422 kB of source archives.
Fetch source alsa-plugins

Download source code:

$ dget --extract http://deb.debian.org/debian/pool/main/a/alsa-plugins/alsa-plugins_1.2.12-2.dsc
...
dpkg-source: info: extracting alsa-plugins in alsa-plugins-1.2.12
dpkg-source: info: unpacking alsa-plugins_1.2.12.orig.tar.bz2
dpkg-source: info: unpacking alsa-plugins_1.2.12-2.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying arcam-av_uses_pthreads.patch
$ ls -1
alsa-plugins-1.2.12
alsa-plugins_1.2.12-2.debian.tar.xz
alsa-plugins_1.2.12-2.dsc
alsa-plugins_1.2.12.orig.tar.bz2
alsa-plugins_1.2.12.orig.tar.bz2.asc

Disable pulseaudio in debian/rules

$ cat alsa-plugins*/debian/rules | grep disable -B3
override_dh_auto_configure:
	dh_auto_configure -- \
		--with-plugindir=/usr/lib/$(DEB_HOST_MULTIARCH)/alsa-lib \
		--disable-static --disable-pulseaudio

Set DH_VERBOSE

$ cat alsa-plugins*/debian/rules | grep export
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs
export DH_VERBOSE=1

cd sourcedir

cd alsa-plugins-*

Build Debian binary package (deb)

$ dpkg-buildpackage -us -uc -b
...
Plugin directory: /usr/lib/x86_64-linux-gnu/alsa-lib
ALSA_CFLAGS: 
ALSA_LIBS: -lasound 
JACK plugin:        yes
  JACK_CFLAGS: 
  JACK_LIBS: -ljack -lpthread 
Pulseaudio plugin:  
Samplerate plugin:  yes
  samplerate_CFLAGS: 
  samplerate_LIBS: -lsamplerate 
Maemo plugin:       no
  Using Osso resource manager: no
Libav/ffmpeg config:
  LIBAV_CFLAGS:   -I/usr/include/x86_64-linux-gnu 
  LIBAV_LIBS:     -lavcodec -lavutil -lswresample  /  / 
Libav A52 plugin:   yes
Libav rate plugin:  yes
Speex rate plugin:  lib
Speex preprocess plugin:  yes
AAF plugin:         no
...
dpkg-deb: building package 'libasound2-plugins' in '../libasound2-plugins_1.2.12-2_amd64.deb'.
$ ls -1 ../*.deb
../libasound2-plugins_1.2.12-2_amd64.deb
../libasound2-plugins-dbgsym_1.2.12-2_amd64.deb

Check debdir: debian/libasound2-plugins

Simulate

$ apt purge libasound2-plugins --simulate
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  alsa-config-utils* libasound2-plugin-fftrate* libasound2-plugins*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Purg alsa-config-utils [1.6.3]
Purg libasound2-plugin-fftrate [1.6.3]
Purg libasound2-plugins [1.2.7.1-1]

The fftrate ALSA plugin packages will be removed

alsa-config-utils* libasound2-plugin-fftrate*

Before removal, create Debian packages from the installed ones

cd ..
sudo apt install fakeroot
$ fakeroot -u dpkg-repack alsa-config-utils libasound2-plugin-fftrate
dpkg-deb: building package 'alsa-config-utils' in './alsa-config-utils_1.6.3_amd64.deb'.
dpkg-deb: building package 'libasound2-plugin-fftrate' in './libasound2-plugin-fftrate_1.6.3_amd64.deb'.
$ ls -1 *.deb
alsa-config-utils_1.6.3_amd64.deb
libasound2-plugin-fftrate_1.6.3_amd64.deb
libasound2-plugins_1.2.12-2_amd64.deb
libasound2-plugins-dbgsym_1.2.12-2_amd64.deb

Purge ALSA plugins

sudo apt purge libasound2-plugins

Install libasound2-plugins and fftrate packages:

sudo dpkg -i alsa-config-utils_1.6.3_amd64.deb libasound2-plugin-fftrate_1.6.3_amd64.deb libasound2-plugins_1.2.12-2_amd64.deb

Notice that fftrate.conf was restored together with Debian packages

$ cat /etc/fftrate.conf | grep "Transform type" -A3
# Transform type
# Available: dct, fft (default: dct)
#transform = dct
transform = fft

Restart Firefox and test sound quality

Hi-Res Music 32 Bit - Greatest Audiophile Collection - Natural Beat Records
_https://rutube.ru/video/b54c962301787eb1f2758ac8ba97f5bf/

Gregorian Chant - Crux Fidelis, 2L audiophile reference recordings
_https://www.youtube.com/watch?v=Qnp3zjB52F0
_https://youtu.be/Qnp3zjB52F0

The Mesmerising sound of the OUD
_https://youtu.be/ZLbQcs3W0Bs

$ MOZ_LOG="cubeb:3" firefox 2>&1 rutube.ru/video/b54c962301787eb1f2758ac8ba97f5bf | grep "output stream rate"
[Child 29814: MediaDecoderStateMachine #1]: I/cubeb CubebStreamInit output stream rate 44100
$ MOZ_LOG="cubeb:3" firefox 2>&1 youtu.be/Qnp3zjB52F0 | grep "output stream rate"
[Child 30746: MediaDecoderStateMachine #1]: I/cubeb CubebStreamInit output stream rate 48000

Note on Exclusive Mode Limitations: Firefox uses 32-bit floating-point audio format by default. If your sound card does not natively support this format, exclusive mode (direct hw: device access) will not work. You must use the ALSA plug plugin for format conversion. Configure your ALSA default device to use type plug with slave.pcm "hw:X,Y" for automatic format conversion.

If you do not know what "plug plugin" is, install fftrate packages and configure ALSA with arateconf (interactive mode). It will fix all problems.

Why Rebuild libasound2-plugins After Removing PulseAudio

You've already removed the PulseAudio server from your Debian system. However, the PulseAudio ALSA plugin is still installed as part of the libasound2-plugins package. This leftover plugin causes problems even though the PulseAudio server is gone.

Exclusive mode is a critical feature for professional audio applications and low-latency audio work. It allows an application to take direct control of the audio hardware, preventing other applications from playing audio simultaneously and eliminating software mixing layers that add latency and potential quality degradation.

As long as the PulseAudio ALSA plugin is installed, any sort of exclusive mode or direct hardware access is impossible with ALSA. Even though you've removed the PulseAudio server, the plugin still intercepts all ALSA audio calls and tries to route them through the non-existent PulseAudio server.

This means:

1. No exclusive hardware access: Applications cannot open audio devices with hw:X,Y for direct hardware control.
2. No true low-latency mode: The plugin layer adds overhead even when it fails.
3. Audio initialization failures: Applications like Firefox fail to open ALSA devices because the plugin tries to connect to a PulseAudio server that doesn't exist (src/cubeb_alsa.c:718-720)

Why This Matters for Audio Applications

The leftover plugin blocks exclusive mode access and causes audio failures, making it impossible to achieve the low-latency, direct hardware access that removing PulseAudio was meant to enable. Applications using the cubeb audio library (like Firefox) detect the PulseAudio ALSA plugin and apply special workarounds: (src/cubeb_alsa.c:911-916)

These workarounds assume the PulseAudio server is running. When the server is removed but the plugin remains, applications experience:

- Format compatibility issues: Certain audio formats (especially 32-bit Float) fail to initialize (src/cubeb_alsa.c:1012-1016)
- Forced latency hacks: Applications apply minimum latency workarounds for a PulseAudio server that doesn't exist (src/cubeb_alsa.c:1063-1069).
- Complete audio failure: The plugin tries to route audio through PulseAudio, fails, and doesn't fall back to direct ALSA access.

What Rebuilding libasound2-plugins Does

By rebuilding libasound2-plugins with --disable-pulseaudio option, you:

1. Enable a sort of exclusive mode: Applications can now use hw:X,Y device names for direct hardware access without the PulseAudio plugin intercepting the calls.
2. Remove the broken plugin: The PulseAudio ALSA plugin won't be built or installed.
3. Enable direct ALSA access: Applications will use ALSA directly without trying to route through the non-existent PulseAudio server.
4. Fix audio playback: Applications like Firefox will work properly with all audio formats, including 32-bit Float.
5. Achieve lower latency: Without the plugin layer, audio has a more direct path to hardware.

Cubeb is the audio library that Firefox and other Mozilla applications use to play sound (include/cubeb/cubeb.h:16-22). Think of it as Firefox's "audio engine". When cubeb detects the PulseAudio ALSA plugin, it cannot provide exclusive mode access and must work around PulseAudio's limitations (src/cubeb_alsa.c:653-657).

With the plugin removed, cubeb can finally access ALSA directly, enabling exclusive mode capabilities and eliminating the workarounds that were necessary for the broken PulseAudio plugin.

Important: This affects ALL audio applications on your system, not just web browsers. Any application that uses ALSA for audio output will be impacted by the PulseAudio ALSA plugin:

    All web browsers - Firefox, Chrome, Chromium, Opera, Brave, Edge, and any other browser
    Media players - VLC, MPV, MPlayer, and other video/audio players
    Games - Both native Linux games and games running through Wine/Proton
    Audio production software - Audacity, Ardour, and other DAWs
    Communication apps - Discord, Zoom, Skype, and other VoIP applications
    Any other software that plays or records audio

The PulseAudio ALSA plugin sits at the ALSA library level, intercepting all audio calls system-wide. This means every application that tries to use ALSA will encounter the broken plugin trying to route audio through the non-existent PulseAudio server.

Rebuilding libasound2-plugins without PulseAudio fixes audio for your entire system, not just one application.

Board footer

Forum Software