The officially official Devuan Forum!

You are not logged in.

#101 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-10-10 15:03:44

Do you have compiled packages of fftrate plugin?

On RaspberryPi,  run command

file /usr/bin/aplay

and post the output here.

#102 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-10-10 13:41:53

kapqa wrote:

EDIT: but maybe this apulse is needed for kernel so that alsa can play several streams at the same time=?

apulse is not needed for kernel.

apulse is needed for you, if you want to use media applications which do not have ALSA backend.

ALSA is mixing streams in the user space, not in the kernel.

ALSA needs the fftrate plugin configured correctly to be able to play several streams at the same time with normal sound quality.

$ arateconf
...
A - Show all plugins [ ]
M - Plug-ins:
 [X] Convert,  [ ] Expand, [X] Asym
 [ ] Play Vol, [X] Dmix
 [ ] Rec. Vol, [X] Dsnoop
 [ ] Phonon,   [ ] Normalizator

See: _https://dev1galaxy.org/viewtopic.php?id=6644

A talent for creating credible myths involves blending familiar elements with fantastical ones to explain real-world phenomena...
A credible myth connects a familiar, real-world fact with a magical or fantastical reason for its existence.

If you have a talent, use it to develop your potential and take action. Start by understanding your own strengths and then consistently practice and apply your talent in every way possible, even by using the underlying qualities of your talent in other areas of your life. Remember that action is what matters, so begin before you feel completely ready to achieve results.

#103 Re: Freedom Hacks » How to disable resamplig in Firefox » 2025-10-10 13:32:06

_https://searchfox.org/firefox-main/source/dom/media/AudioConverter.cpp

#include "AudioConverter.h"

#include <speex/speex_resampler.h>

Open the Firefox browser.
Type about:support into the address bar and press Enter.
The page will load, showing a detailed report of your Firefox setup.

To change the "Preferred Sample Rate" in about:support, you have to edit the source code with a text editor and recompile Firefox. For example:

_https://searchfox.org/firefox-main/source/dom/media/CubebUtils.cpp

$ cat firefox/dom/media/CubebUtils.cpp | grep PreferredSampleRate\(bool -A15
uint32_t PreferredSampleRate(bool aShouldResistFingerprinting) {
  StaticMutexAutoLock lock(sMutex);
//  if (sCubebForcedSampleRate) {
//    return sCubebForcedSampleRate;
//  }
//  if (aShouldResistFingerprinting) {
//    return 44100;
//  }
//  if (!InitPreferredSampleRate()) {
//    return 44100;
//  }
//  MOZ_ASSERT(sPreferredSampleRate);
//  return sPreferredSampleRate;
    return 48000;
}

#104 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-10-10 12:32:29

If you are not a masochist, you may better stay with MATE desktop.

Do not remove apulse! It is needed to run applications which do not have ALSA backend. For example:

apulse discord

_https://github.com/i-rinat/apulse
apulse: PulseAudio emulation for ALSA.

The program provides an alternative partial implementation of the PulseAudio API. It consists of a loader script and a number of shared libraries with the same names as from original PulseAudio, so applications could dynamically load them and think they are talking to PulseAudio. Internally, no separate sound mixing daemon is used. Instead, apulse relies on ALSA's dmix, dsnoop, and plug plugins to handle multiple sound sources and capture streams running at the same time. dmix plugin muxes multiple playback streams; dsnoop plugin allow multiple applications to capture from a single microphone; and plug plugin transparently converts audio between various sample formats, sample rates and channel numbers. For more than a decade now, ALSA comes with these plugins enabled and configured by default.

apulse wasn't designed to be a drop-in replacement of PulseAudio. It's pointless, since that will be just reimplementation of original PulseAudio, with the same client-daemon architecture, required by the complete feature set. Instead, only parts of the API that are crucial to specific applications are implemented. That's why there is a loader script, named apulse. It updates value of LD_LIBRARY_PATH environment variable to point also to the directory where apulse's libraries are installed, making them available to the application.

Name comes from names of both ALSA and PulseAudio. As aoss was a compatibility layer between OSS programs and ALSA, apulse was designed to be compatibility layer between PulseAudio applications and ALSA.

apulse relies on ALSA's dmix, dsnoop, and plug plugins to handle multiple sound sources and capture streams running at the same time.

It means that you should also install the fftrate ALSA plugin and configure it correctly
_https://dev1galaxy.org/viewtopic.php?id=6644

$ arateconf
...
A - Show all plugins [ ]
M - Plug-ins:
 [X] Convert,  [ ] Expand, [X] Asym
 [ ] Play Vol, [X] Dmix
 [ ] Rec. Vol, [X] Dsnoop
 [ ] Phonon,   [ ] Normalizator

I do not use Bluetooth headphones, because of low sound quality. But they can be used with ALSA.

You may post your theory about "Bluetooth and health hazard" to "Off-topic" forum. It might be interesting to discuss.

kapqa wrote:

think it is based on MATE but could be wrong

Post here the output of these commands:

inxi -Axxx
inxi -Sxxx
echo $XDG_CURRENT_DESKTOP

For example:

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)
$ inxi -S
System:
  Host: devuan Kernel: 6.1.0-40-amd64 arch: x86_64 bits: 64 Desktop: MATE
    v: 1.26.0 Distro: Devuan GNU/Linux 5 (daedalus)
$ echo $XDG_CURRENT_DESKTOP
MATE

#105 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-10-09 13:46:14

It does work on the latest Linux Mint MATE.
Pipewire was removed without problems.
The fftrate ALSA plugin was installed and configured without any problems.
BlueALSA also works on Linux Mint MATE
_https://dev1galaxy.org/viewtopic.php?pid=56780#p56780
and the script to toggle ALSA configs also works without problems.
_https://dev1galaxy.org/viewtopic.php?pid=57177#p57177
Bluetooth headphones: Bowers & Wilkins PX7 S2e

Install Devuan MATE on your RaspberryPi and start a new topic.

#106 Re: Desktop and Multimedia » [SOLVED] (alsa) arateconf not saving properly » 2025-10-08 21:42:51

It is not difficult to remove pipewire from Linux Mint.

Run

dpkg -l | grep pipewire

Remove pipewire-alsa, pipewire-audio, wireplumber and other pipewire packages TOGETHER with other crap

sudo apt-get purge pulseaudio pulseaudio-utils pavucontrol pulseaudio-module-bluetooth pipewire pipewire-bin pipewire-pulse pipewire-alsa pipewire-audio wireplumber

It does work on Linux Mint MATE.
It was tested by Linux Mint users.

It should also work on RaspiOS.

kapqa wrote:

tried with RaspiOS latest /(based on Trixie) and it would lead to broken Desktop/Black Screen and just cursor moving

If KDE depends on PipeWire, remove KDE and install MATE.

...modern versions of KDE, especially the underlying components, have a strong dependency on PipeWire for its audio server... While it may still be possible to run KDE with PulseAudio, newer versions of core components like KWin have made PipeWire (specifically the pipewire-session-manager, which is provided by wireplumber) a direct dependency

The problem is that you create myths about problems instead of thinking how to solve them.

Nobody else had problems with arateconf since 2010.

#107 Re: Installation » [SOLVED] Can't even install yt-dlp in Devuan 6, many things are broken » 2025-10-07 12:00:07

Try Firefox Nightly
_https://firefox-source-docs.mozilla.org/setup/linux_build.html

sudo apt update && sudo apt install curl python3 python3-pip git watchman
# reduce chance of builds failung during linking due to running out of memory
  export LDFLAGS+=" -Wl,--no-keep-memory"
# .mozconfig

# For very old computers -j2
mk_add_options MOZ_MAKE_FLAGS=-j2

ac_add_options --enable-project=browser
ac_add_options --with-app-name=antifox
ac_add_options --prefix=/usr
ac_add_options --enable-audio-backends=alsa
$ antifox --version
Mozilla Firefox 145.0a1

#108 Re: Installation » [SOLVED] Can't even install yt-dlp in Devuan 6, many things are broken » 2025-10-06 19:51:37

This one works without problems:

youtube-dl nightly builds
_https://github.com/ytdl-org/ytdl-nightly

#109 Re: Installation » [SOLVED] Can't even install yt-dlp in Devuan 6, many things are broken » 2025-10-06 18:42:45

What is wrong with youtube-dl?

$ youtube --version
2025.09.29
$ apt-cache search python-is-
python-is-python3 - symlinks /usr/bin/python to python3

#110 Freedom Hacks » How to disable resamplig in Firefox » 2025-10-06 17:20:59

igorzwx
Replies: 1

Resampling in Firefox is easy to disable:

$ cat firefox/dom/media/VideoUtils.cpp | grep DecideAudioPlaybackSampleRate -A27
uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo,
                                       bool aShouldResistFingerprinting) {
//  bool resampling = StaticPrefs::media_resampling_enabled();

//  uint32_t rate = 0;

//  if (resampling) {
//    rate = 48000;
//  } else if (aInfo.mRate >= 44100) {
//    // The original rate is of good quality and we want to minimize unecessary
//    // resampling, so we let cubeb decide how to resample (if needed). Cap to
//    // 384kHz for good measure.
//    rate = std::min<unsigned>(aInfo.mRate, 384000u);
//  } else {
//    // We will resample all data to match cubeb's preferred sampling rate.
//    rate = CubebUtils::PreferredSampleRate(aShouldResistFingerprinting);
//    if (rate > 768000) {
//      // bogus rate, fall back to something else;
//      rate = 48000;
//    }
//  }
//  MOZ_DIAGNOSTIC_ASSERT(rate, "output rate can't be 0.");
    
//  return rate;

  return aInfo.mRate;
}

Firefox is easy to compile.

What is special about Chromium is that it has many resamplers inside:

[BUG] WebAudio always resampling to the output device sample rate, even if a different one is specified.
_https://issues.chromium.org/issues/40944208

#111 Re: Desktop and Multimedia » PA Volume Control defaults » 2025-10-04 16:34:26

Is it so difficult to configure ALSA?

ALSA - GenToo Wiki
_https://wiki.gentoo.org/wiki/ALSA#Configuration

! 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.

#112 Freedom Hacks » Firefox is playing crap to protect user privacy » 2025-10-04 16:32:31

igorzwx
Replies: 0

Resist Fingerprinting
How to tell if you have Resist Fingerprinting enabled, and if so, disable it
_https://support.mozilla.org/en-US/kb/resist-fingerprinting

To disable Resist Fingerprinting:

    Type about:config in the address bar and press Enter.
    A warning page may appear. Click Accept the Risk and Continue to go to the about:config page.
    In the search bar at the top, search for privacy.resistFingerprinting.
    A number of preferences will appear but see if either privacy.resistFingerprinting or privacy.resistFingerprinting.pbMode have a value of true.
    To tell if an extension is controlling this preference, you can click toggle the value back to false and restart your browser. After restarting, visit about:config again, and see if the value has been returned to true.

If it has been, you will need to determine which of your extensions is controlling the preference and disable or remove them. One way to do this is to disable the installed extensions one by one, and restart the browser, seeing if the preference is changed upon restarting Firefox. Please be aware that, in rare cases, multiple extensions might be setting the preference.

Resisting Fingerprinting: By returning a standard sample rate of 44100 Hz when aShouldResistFingerprinting is true, the function PreferredSampleRate helps maintain user privacy.

Fingerprinting: In the context of web technologies, fingerprinting refers to the technique of tracking users based on their device and browser characteristics. The aShouldResistFingerprinting parameter suggests a consideration for privacy in audio playback decisions.

$ cat firefox/dom/media/CubebUtils.cpp | grep PreferredSampleRate\(bool -A14
uint32_t PreferredSampleRate(bool aShouldResistFingerprinting) {
  StaticMutexAutoLock lock(sMutex);
  if (sCubebForcedSampleRate) {
    return sCubebForcedSampleRate;
  }
  if (aShouldResistFingerprinting) {
    return 44100;
  }
  if (!InitPreferredSampleRate()) {
    return 44100;
  }
  MOZ_ASSERT(sPreferredSampleRate);
  return sPreferredSampleRate;
}

Absolute High Resolution Audio Test 32bit Floating Point
_https://youtu.be/v5swkCSvryE

[info] Available formats for v5swkCSvryE:
format code  extension  resolution note
249          webm       audio only audio_quality_low   56k , webm_dash container, opus  (48000Hz), 24.97MiB
250          webm       audio only audio_quality_low   74k , webm_dash container, opus  (48000Hz), 32.59MiB
140          m4a        audio only audio_quality_medium  129k , m4a_dash container, mp4a.40.2 (44100Hz), 56.74MiB
251          webm       audio only audio_quality_medium  142k , webm_dash container, opus  (48000Hz), 62.52MiB
...
140          m4a        audio (44100Hz), 56.74MiB
251          webm       audio (48000Hz), 62.52MiB

The PreferredSampleRate means exactly what it says - it's the sample rate that is preferred.

$ cat firefox/dom/media/VideoUtils.cpp | grep kSampleRate -A27
uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo,
                                       bool aShouldResistFingerprinting) {
  bool resampling = StaticPrefs::media_resampling_enabled();

  uint32_t rate = 0;

  if (resampling) {
    rate = 48000;
  } else if (aInfo.mRate >= 44100) {
    // The original rate is of good quality and we want to minimize unecessary
    // resampling, so we let cubeb decide how to resample (if needed). Cap to
    // 384kHz for good measure.
    rate = std::min<unsigned>(aInfo.mRate, 384000u);
  } else {
    // We will resample all data to match cubeb's preferred sampling rate.
    rate = CubebUtils::PreferredSampleRate(aShouldResistFingerprinting);
    if (rate > 768000) {
      // bogus rate, fall back to something else;
      rate = 48000;
    }
  }
  MOZ_DIAGNOSTIC_ASSERT(rate, "output rate can't be 0.");
    
  return rate;
}

Best Audiophile Vocal 24 bit - Hi-Res Music 2025 - Audiophile Voices
_https://youtu.be/uO6jfQ5tQHM
Absolute High Resolution Audio Test 32bit Floating Point
_https://youtu.be/v5swkCSvryE
Hi-Res audio 32 bit floating point. Drums, acoustic guitar, bass guitar, trumpet, sax, violin
_https://youtu.be/YIHN0XUK2i8

One bug report to rule them all
_https://dev1galaxy.org/viewtopic.php?pid=58194#p58194

_https://bugzilla.mozilla.org/show_bug.cgi?id=1400731
Open Bug 1400731 Opened 8 years ago Updated 2 years ago
sample rate in Firefox limited to 48KHz

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170917100334

Steps to reproduce:

When listen HiRes audio which have sample rate more than 48KHz browser uses 44.1KHz my DAC displayed it.
For reproduce you must use Hi-Fi Sublime+ subscription on service qobuz.
For example Grace album by Lizz Wright must played in 96KHz.
http://play.qobuz.com/album/0088807202871

P.S. Also you needed pulseaudio 11.0 with enabled 'avoid-resampling' option.
More detail here: https://bugs.freedesktop.org/show_bug.cgi?id=57503

Actual results:

Instead 96KHz browser used 44.1KHz.

Expected results:

Expected when played flac with sample rate 96KHz browser not limit sample rate

1. It is not difficult to disable resampling in Firefox.
2. Firefox is easy to compile.

#113 Re: Desktop and Multimedia » sayonara: undefined symbol in libsqlite.so » 2025-10-03 20:38:11

the only source?

Have you already tried to compile anything on Devuan?

#114 Re: Desktop and Multimedia » sayonara: undefined symbol in libsqlite.so » 2025-10-03 20:26:42

The best place to discuss appimages is, perhaps, Ubuntu newbie forum.

Audacious is easy to compile
_https://dev1galaxy.org/viewtopic.php?id=7214

#115 Freedom Hacks » [ALSA] Firefox vs Chromium: Which crap sounds better? » 2025-09-29 14:43:53

igorzwx
Replies: 0

Firefox downsamples Hi-Res Audio to 44.1 kHz, or it prefers to play 44.1 kHz audio format, because of PreferredSampleRate

about:support 

Media
-----

Audio Backend: alsa
Max Channels: 10000
Preferred Sample Rate: 44100

Chromium downsamples Hi-Res Audio to 48 kHz (or it prefers 48 kHz).

To find out which crap sounds better, you may try to conduct a blind test, a scientific method where listeners evaluate options without knowing their identity or brand.

Hi-Res Audio 24 Bit/192Khz Bass Test - Audiophile Art
_https://www.youtube.com/watch?v=dMTKSSqDwyU
_https://youtu.be/dMTKSSqDwyU

$ firefox 2>&1 youtu.be/dMTKSSqDwyU
Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.

Input:  48000 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.
$ chromium 2>&1 --audio-buffer-size=8192 youtu.be/dMTKSSqDwyU
Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

To disable resampling, or change PreferredSampleRate, one may try to recompile Firefox.
There is a manual for Ubuntu newbies.

#116 Freedom Hacks » How to fix Chromium's ALSA backend (+ fix for Brave Browser) » 2025-09-28 21:55:10

igorzwx
Replies: 0

ALSA - Gentoo Wiki
_https://wiki.gentoo.org/wiki/ALSA#Firefox.2C_Chromium.2C_and_YouTube_have_no_audio_with_custom_.asoundrc_but_other_apps_do

Both browsers [Firefox and Chromium] either depend on pulseaudio to set up correct sample rate or in absence of pulseaudio set sample rate to 48000 as defacto standard in sound card world.

NOTE: For dmix with the fftrate resampler, any sample rate is consumable. It should play sound without problems.

Experiment:

1. .asoundrc was generated by arateconf (with dmix, dsnoop, etc.)

2. the same YouTube video is played with Firefox and Chromium (with and without apulse)

$ firefox --version
Mozilla Firefox 140.3.0esr

Firefox with ALSA (with apulse):

$ apulse firefox 2>&1
Input:  48000 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Firefox with ALSA (without apulse) - notice the difference:

$ firefox 2>&1
Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.

Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.

Input:  48000 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Chromium:

$ chromium --version
Chromium 140.0.7339.207 built on Debian GNU/Linux 12 (bookworm)

Chromium with ALSA (with apulse):

$ apulse chromium 2>&1
Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.

Input:  44100 Hz, 2 ch, 's32_le' (0xa): 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.

Chromium with ALSA (without apulse) - sound quality is horrible:

$ chromium 2>&1
Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

dmix does not employ resampling:

Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)

The most likely cause of audio distortions is, perhaps, Chromium ALSA backend.

To improve sound quality with Chrome, Chromium, Brave, Min, and the like, one may try to use them with apulse.

EDIT:

This seems to be a solution:

chromium 2>&1 --audio-buffer-size=4096
$ chromium 2>&1 --audio-buffer-size=8192
Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

The same solution works for Brave Browser:

$ brave-browser-stable 2>&1 --audio-buffer-size=8192
Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  48000 --> 48000 (J: 0.00%, T: None, W: Planar)
Ok.

With the default audio-buffer-size, Brave Browser produces the same audio distortions.

Redirection of stderr to stdout, 2>&1, is used to print debug information from the fftrate resampler.

Desktop launcher for Brave Browser (with fix for ALSA):

$ cat ~/.local/share/applications/brave-browser.desktop
[Desktop Entry]
Version=1.0
Name=Brave Web Browser
GenericName=Web Browser
Comment=Access the Internet
Exec=/usr/bin/brave-browser-stable --audio-buffer-size=8192 %U
StartupNotify=true
Terminal=false
Icon=brave-browser
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/brave-browser-stable --audio-buffer-size=8192

[Desktop Action new-private-window]
Name=New Incognito Window
Exec=/usr/bin/brave-browser-stable --incognito --audio-buffer-size=8192

The Brave browser includes a built-in ad-blocking feature called Brave Shields that automatically blocks unwanted advertisements and trackers on most websites and video platforms by default, offering a cleaner, faster, and more private browsing experience without needing third-party extensions.

#117 Re: Freedom Hacks » ALSA: Dogmatism and Empiriokritizismus » 2025-09-26 00:30:24

It was about a technical problem how to toggle ALSA configs with a script.

The main principle of ALSA design is a sort of "hot-plug".
Today, you do not need to reload ALSA, if you change .asoundrc
Though a media player may (or may not) need to be re-started.

It is self-evident. If you don't believe, read Gentoo Wiki and try proposed tests.

Gentoo Wiki:
Use of ~/.asoundrc is immediate and as long as you are not forcing the use of specific devices in any applications, they either will require a restart or will begin working immediately. One of the best tests is to run Chrome, go to YouTube, open a terminal, run mplayer with an audio or video file and see that you do not get an error about audio (such an error might be 'Device or resource busy').
_https://wiki.gentoo.org/wiki/ALSA#Sound_card_only_available_for_one_application

The problem is that ALSA is poorly documented, and, therefore, one has to use the method of trial and error to find the correct solution. However, what is correct today might be wrong tomorrow.

To foresee changes in the "advanced sound system", one may need "a deeper level of understanding of ALSA", or a sort of esoteric knowledge for navigating uncertainty.

ALSA in user space is a sort of software mixer with plugins, such as dmix, dsnoop, and the like. Many years ago, ALSA was so buggy that it was necessary to reload ALSA to enable changes in .asoundrc. Today, to enable dmix or other plugin in .asoundrc, you do not need to reload ALSA.

In 2008, it was necessary to reload ALSA to enable dmix. This problem was fixed in 2009 (or 2010) in a new version of ALSA. In 2010, Ubuntu users were advised to recompile ALSA to fix sound problems, although it was enough to remove pulseaudio. In 2010, Ubuntu users asked questions like this: "Could I remove ALSA, and use PulseAudio instead?"

Linux Mint Forums
_https://forums.linuxmint.com/viewtopic.php?t=179838

Remove ALSA, install Pulseaudio

Post by H.Remedy » Tue Oct 07, 2014 9:13 am

Can someone please give terminal commands for fully removing ALSA and installing Pulseaudio? :?

It is very logical:
1. If pulseaudio is much better than ALSA, it is reasonable to remove ALSA and install pulseaudio.
2. If pulseaudio needs ALSA to work, it cannot be better than ALSA, and, perhaps, is not needed.
3. If ALSA can work without pulseaudio, it might be reasonable to remove pulseaudio as an unnecessary fifth wheel.

If ALSA is buggy and ill-designed, and the resamplers are crappy, any sort of pulseaudio is doomed to fail, for it is a castle built on sand. It is obvious, but not evident.

Today, many "computer scientists" firmly believe that Fedora Linux has PipeWire instead of ALSA. It is impossible to convince them that they have ALSA installed and working in their Linux system, because they do not want to know what ALSA is, and how it looks like. They have the gift of faith in the sense that they do not trust their senses and their ability to think. They have a special, extraordinary trust in PipeWire's promises and a sort of "supernatural ability to believe in the unseen and to act on spiritual truths despite physical evidence to the contrary".

...some audio applications keep the ALSA PCM device open, even when they are not actively streaming any audio, and so it is necessary to close each application before any other can use the device...
ALSA provides a solution to this for hardware cards with the "dmix" plugin. That plugin allows multiple open connections, mixes the streams together, then sends the result as a single stream to the hardware device.
_https://github-wiki-see.page/m/Arkq/bluez-alsa/wiki/Using-bluealsa-with-dmix

dmix is needed to make ALSA usable.

When #Software mixing [dmix] is enabled, ALSA is forced to resample everything to the same frequency (48 kHz by default when supported). By default, it will try to use the speexrate converter to do so, and fallback to low-quality linear interpolation if it is not available. Thus, if you are getting poor sound quality due to bad resampling, the problem can be solved by simply installing the alsa-plugins package.
_https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture#High_quality_resampling

The speexrate converter is also crappy.

In 2008, Ubuntu was infected with PulseAudio which was a replacement for dmix and ESD. PulseAudio was very advanced, but buggy and unusable. ESD was not so buggy. It was usable, and, therefore, it was deprecated. However, it was still  available, and the standard solution for sound problems was to remove PulseAudio and install ESD. The best solution for sound problems was to remove both ALSA and PulseAudio, compile OSS4 and install it.

NOTE: ESD was created, because dmix was buggy and unusable. ESD was buggy, but usable. When most bugs were fixed, it was deprecated (in 2008).

[In 2007] the Enlightened Sound Daemon (ESD or EsounD) was the sound server for Enlightenment and GNOME. Esound is a small sound daemon for both Linux and UNIX. ESD was created to provide a consistent and simple interface to the audio device, so applications do not need to have different driver support written per architecture. It was also designed to enhance capabilities of audio devices such as allowing more than one application to share an open device. ESD accomplishes these things while remaining transparent to the application, meaning that the application developer can simply provide ESD support and let it do the rest. On top of this, the API is designed to be very similar to the current audio device API, making it easy to port to ESD.
ESD will mix the simultaneous audio output of multiple running programs, and output the resulting stream to the sound card.
_https://en.wikipedia.org/wiki/Enlightened_Sound_Daemon

ESD was mostly using ALSA's built-in OSS emulation (alsa-oss: snd-pcm-oss and snd-seq-oss) which performed much better than native ALSA in 2008. The emulation provided a more stable solution for applications still using the Open Sound System (OSSv.3) API.

Horrible sound quality with dmix is caused by its poor resampling algorithm which produces noticeable audio distortions.

In 2008, dmix was extremely buggy (and ALSA resamplers have always been crappy). The sound quality was really horrible with dmix. This problem was fixed in 2010 with the fftrate ALSA plugin (and with ALSA update).

ALSA was designed as a universal solution to all problems, but it was so buggy that it was decided to create pulseaudio as a truly advanced solution to all problems. Pipewire was created for a similar reason.

Today ALSA is not so buggy and even usable, if it is correctly configured.

#118 Freedom Hacks » ALSA: Dogmatism and Empiriokritizismus » 2025-09-25 23:01:56

igorzwx
Replies: 4

The official ALSA documentation is here: _https://www.alsa-project.org/wiki/Asoundrc

ALSA: Outdated documentation
_https://alsa.opensrc.org/Asoundrc#Changing_things

Asoundrc: Changing things

Most programs require a restart to reread .asoundrc or asound.conf! This includes desktop environment audio daemons, such as PulseAudio. For most changes to .asoundrc you will need to restart the sound server (ie. sudo /etc/init.d/alsa-utils restart) for the changes to take effect.

This chapter was deprecated and removed from the official ALSA documentation about 15 years ago (or more). However, the true believers still believe that it is necessary to reload ALSA "for the changes [in .asoundrc] to take effect".

If you see a "buffalo" sign on an elephant's cage, do not trust your eyes.
Kozma Prutkov, Fruits of Reflection (1853-1854)

To believe in a dogma, one should not trust his senses and his ability to think.

EDIT:

greenjeans wrote:

2025-09-22 15:51:04
I think I would start by making a super simple .asoundrc and going from there...

If that works, a simple script that offers a dialog where you choose either 0, 1, or 2, and it seds the change and re-starts alsa, would allow you to change during session.
_https://dev1galaxy.org/viewtopic.php?pid=58157#p58157

ralph.ronnquist wrote:

Yes, and one thing that is confusing with ALSA is that programs typically loads the sound configuration only once, early during startup. Therefore such a change to the configuration only takes effect for programs that are started after the change.

There is a way to make a configuration have a dynamic part, to be automatically reloaded upon every sink (or source) creation instead, but then we are entering a deeper level of understanding of ALSA configuration structure and elements which most people rather wish to avoid.

It is so "technical", that it is almost incomprehensible.

#119 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 19:11:12

1. First, make a dir

mkdir ~/myscripts

The folder "myscripts" should be in your home directory.
You can open it with your file manager (file browser).

2. Then write the script and make it executable, as described here:
_https://dev1galaxy.org/viewtopic.php?pid=58214#p58214

And test it.

#!/bin/bash

xfce4-terminal -e 'alsamixer -c Headphones' &

xfce4-terminal -e 'alsamixer -c vc4hdmi1' &

It should open two terminals with alsamixer

3. Then create two different text files in the folder ~/myscripts
with content like this:

defaults.pcm.!card Headphones
defaults.ctl.!card Headphones
defaults.pcm.!device 0
defaults.ctl.!device 0

For example, the second text file might be like this:

defaults.pcm.!card vc4hdmi1
defaults.ctl.!card vc4hdmi1
defaults.pcm.!device 0
defaults.ctl.!device 0

4. Then post here the output of these commands:

echo "$HOME/myscripts"
ls -a -1 $HOME/myscripts

Then we will add other commands to the script.

For bash terminal and bash script, commands are the same.
First, test commands on terminal.
If they work, you can add them to the script.

Try this website:
Explain Shell
_https://explainshell.com/#
_https://explainshell.com/explain?cmd=ls+-a+-1+%24HOME%2Fmyscripts#
_https://explainshell.com/explain?cmd=xfce4-terminal+-e+%27alsamixer+-c+vc4hdmi1%27+%26#

Bash scripting tutorial for Ubuntu newbies
_https://help.ubuntu.com/community/Beginners/BashScripting

Bash scripting is one of the easiest types of scripting to learn...
if you are a 'non-computer-savvy' person that won't mean a thing to you. Bash is the language that you will learn to love as much of everyday Ubuntu life is done/can be done using the Terminal.

Scripting

NOTE: The commands given in the scripting section are to be put into the text editor and not in the terminal unless instructed otherwise.

Bash is primarily a scripting language, so it would be a crime not to talk about scripting. Let's dive straight in with a bash script... You can create a bash script by opening your favorite text editor to edit your script and then saving it (typically the .sh file extension is used for your reference, but is not necessary.
_https://help.ubuntu.com/community/Beginners/BashScripting#Scripting

#120 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 16:49:08

OK. Let us make the script. It is very simple. And scripts are very useful.

In Ubuntu, hidden files are any file or folder whose name begins with a period (.). These files are not displayed by default in file managers or the ls command but are still present on the system. They typically serve as configuration files for user applications and system services, helping to keep the directory clutter-free and preventing accidental modification by normal users. You can view hidden files by pressing Ctrl + H or using the "Show Hidden Files" option in the file manager's menu, and you can hide a file or folder by renaming it to start with a dot

The command ls -a displays all files.

ls --help | grep '\-\-a'
  -a, --all                  do not ignore entries starting with .
  -A, --almost-all           do not list implied . and ..
      --author               with -l, print the author of each file
ls -al --author -1
ls -al -1

#121 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 16:20:32

apulse is very useful, but he has another problem.

Something like this:

_https://raspberrypi.stackexchange.com/questions/39187/alsa-base-conf-file-missing

kapqa wrote:

it seems devuanpi is missing alsa-base or similar, because after removing pulseaudio there is no more sound.

"devuanpi" or "raspberry pi"? He is testing them both.

This topic is now very confusing.

You may better close it and let him start new topics for each problems separately, and clearly define each problem.

Systemd can start services in parallel, significantly reducing boot times.

In a similar way, he is trying to solve all problems "in parallel" to minimize time and efforts.

EDIT:

_https://tracker.debian.org/pkg/alsa-base

alsa-base

package is gone
This package is not part of any Debian distribution. Thus you won't find much information here. The package is either very new and hasn't appeared on mirrors yet, or it's an old package that eventually got removed. The old news are kept for historic purpose only.

alsa-base was gone some years ago, but the myth of alsa-base is still alive.

#122 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 15:35:01

Reload ALSA:

sudo /etc/init.d/alsa-utils force-reload

or

sudo service alsa-utils force-reload

If you have systemd, you may need enother command to reload ALSA

sudo systemctl restart alsa

Post the output of these commands:

fuser -av $(find /dev/snd -type c 2>/dev/null)
inxi -A
cat /proc/asound/cards
lsmod | grep snd
aplay -l
kapqa wrote:

i think it is because alsa-base is missing?

Do you mean:

alsa-base conf file missing

Perhaps, you have to create ALSA config

Post the ouput of these commands:

cat $HOME/.asoundrc
ls -1 /usr/share/alsa
cat /usr/share/alsa/alsa.conf

#123 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 14:54:26

Does the script work?

If it works, we can try to modify it step by step until it does what you want.

#124 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 14:25:06

It will change, if you want. It is 100% functioning ALSAMIXER

Let us try to make a simple script which can do the same.

mkdir ~/myscripts
cd ~/myscripts
mousepad script1.sh

Copy and past these 3 lines:

#!/bin/bash

xfce4-terminal -e 'alsamixer -c Headphones'

Save it.

Check

ls | grep script1.sh
cat script1.sh

Make it executable

chmod a+x -v script1.sh

Run

stat -c %a script1.sh

It shoud output "755"

$ stat -c %a script1.sh
755

See: _https://chmodcommand.com/chmod-755/

Run it:

./script1.sh

Run it with full path:

$HOME/myscripts/script1.sh

#125 Re: Desktop and Multimedia » (alsa) changin soundcard easily via terminal » 2025-09-24 13:47:51

kapqa wrote:

on raspios the c\hange is made, a little bit silly situation resulted however, to change the playback from one device now to copy .asoundrc , practically heeded your advice and made several copy for different devices i~d like to activate.

Do you want to know how to write a simple bash script to switch between two "devices" with a mouse click?

If you have XFCE, try this command

xfce4-terminal -e 'alsamixer -c Headphones'

It should open a new terminal with "alsamixer" for "Headphones'

Board footer

Forum Software