The officially official Devuan Forum!

You are not logged in.

#1 Yesterday 12:38:46

igorzwx
Member
Registered: 2024-05-06
Posts: 357  

How to purge pulseaudio from libasound2-plugins

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.

Last edited by igorzwx (Today 01:42:18)

Offline

#2 Yesterday 19:56:30

kapqa
Member
Registered: 2019-01-02
Posts: 512  

Re: How to purge pulseaudio from libasound2-plugins

Hello , i hae tried this, and it would function?

however, for some reason, when installing your freedom-hacks, it always seem to uninstall package "wine" which i let go;

but when afterwards try to re-install "wine", there is again bit mismatch.

like here, in order to install wine-hq-stable

REMOVING

libjack-dev libjack0

is it safe to let remove those packages?

thanks!

EDIT: and Discover app would already propose update libpulse2-plugins.

https://ibb.co/60gdYKKg

EDIT2: this libasound2-plugins route probably not so much needed with your firefox-nightly-tutorial.

Last edited by kapqa (Yesterday 20:03:42)

Online

#3 Yesterday 20:47:03

igorzwx
Member
Registered: 2024-05-06
Posts: 357  

Re: How to purge pulseaudio from libasound2-plugins

Run simulate without sudo

apt remove libjack-dev libjack0 --simulate

Offline

#4 Yesterday 21:01:07

kapqa
Member
Registered: 2019-01-02
Posts: 512  

Re: How to purge pulseaudio from libasound2-plugins

have already uninstalled because like wine for 1-2 program.

is this jack needed for soundplayback?

when i try to install it

Installing:
  libjack-dev

Installing dependencies:
  libjack0

Suggested packages:
  jackd1

REMOVING:
  libasound2-plugins:i386  libjack-jackd2-0:i386  wine-stable-i386:i386
  libjack-jackd2-0         wine-stable            winehq-stable

Summary:
  Upgrading: 0, Installing: 2, Removing: 6, Not Upgrading: 0

Online

#5 Yesterday 21:14:57

igorzwx
Member
Registered: 2024-05-06
Posts: 357  

Re: How to purge pulseaudio from libasound2-plugins

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 

Last edited by igorzwx (Yesterday 21:35:35)

Offline

#6 Yesterday 21:26:19

kapqa
Member
Registered: 2019-01-02
Posts: 512  

Re: How to purge pulseaudio from libasound2-plugins

~/Downloads$ audacious --version
Audacious 4.4.2 (Debian package)

is it recommended to use Audacious from compile version?

Last edited by kapqa (Yesterday 21:28:19)

Online

#7 Yesterday 21:40:14

igorzwx
Member
Registered: 2024-05-06
Posts: 357  

Re: How to purge pulseaudio from libasound2-plugins

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?

Last edited by igorzwx (Yesterday 21:42:30)

Offline

#8 Yesterday 21:50:49

kapqa
Member
Registered: 2019-01-02
Posts: 512  

Re: How to purge pulseaudio from libasound2-plugins

nada; read before about it , maybe today, but it gone already. is it like 1bit dac on CD player=good sound?
but ia m experienced mac os x user, quite, ,ay say so.

however, i installed once "firmware-oss" or something, afterwards had no longer sound, and could not restore alsa; had to re-install operating system sad

my mpv is with vapoursynth, with greeting from Russia?
https://www.svp-team.com/get/

cat ~/.config/mpv/mpv.conf 
# Sample mpv configuration
#

# this is required for SVP to "catch" the mpv
# scripts\mpvSockets.lua can override this to allow several mpv windows at the same time
input-ipc-server=/tmp/mpvsocket

# hardware video decoder
hwdec=auto-copy
hwdec-codecs=all

vo=gpu-next

# high quality video output, require rather fast video card
#profile=gpu-hq

# this is for HDR passthrough on supported displays (mpv 0.41? wayland only?)
target-colorspace-hint=auto

#gpu-api=vulkan

# miscellaneous options

# comment this one if you want mpv to remember the playback position
save-position-on-quit=no

# fixes audio desync
hr-seek-framedrop=no

#log-file=~/mpv.log

Last edited by kapqa (Yesterday 21:56:16)

Online

#9 Yesterday 22:03:41

igorzwx
Member
Registered: 2024-05-06
Posts: 357  

Re: How to purge pulseaudio from libasound2-plugins

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.

Last edited by igorzwx (Yesterday 23:04:34)

Offline

Board footer