<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=7431&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / How to fix Chromium's ALSA backend (+ fix for Brave Browser)]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=7431</link>
		<description><![CDATA[The most recent posts in How to fix Chromium's ALSA backend (+ fix for Brave Browser).]]></description>
		<lastBuildDate>Sun, 28 Sep 2025 21:55:10 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[How to fix Chromium's ALSA backend (+ fix for Brave Browser)]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=58277#p58277</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p><strong>ALSA - Gentoo Wiki</strong><br />_https://wiki.gentoo.org/wiki/ALSA#Firefox.2C_Chromium.2C_and_YouTube_have_no_audio_with_custom_.asoundrc_but_other_apps_do</p><p>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.</p></div></blockquote></div><p><strong>NOTE:</strong> For <span class="bbc">dmix</span> with the <strong>fftrate</strong> resampler, any sample rate is consumable. It should play sound without problems.</p><p>Experiment:</p><p>1. <span class="bbc">.asoundrc</span> was generated by <span class="bbc">arateconf</span> (with dmix, dsnoop, etc.)</p><p>2. the same YouTube video is played with Firefox and Chromium (with and without <span class="bbc">apulse</span>)</p><div class="codebox"><pre><code>$ firefox --version
Mozilla Firefox 140.3.0esr</code></pre></div><p>Firefox with ALSA (with <span class="bbc">apulse</span>):</p><div class="codebox"><pre><code>$ apulse firefox 2&gt;&amp;1
Input:  48000 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.</code></pre></div><p>Firefox with ALSA (without <span class="bbc">apulse</span>) - notice the difference:</p><div class="codebox"><pre><code>$ firefox 2&gt;&amp;1
Input:  44100 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  44100 --&gt; 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.

Input:  44100 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  44100 --&gt; 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.

Input:  48000 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.</code></pre></div><p><strong>Chromium:</strong></p><div class="codebox"><pre><code>$ chromium --version
Chromium 140.0.7339.207 built on Debian GNU/Linux 12 (bookworm)</code></pre></div><p>Chromium with ALSA (with <span class="bbc">apulse</span>):</p><div class="codebox"><pre><code>$ apulse chromium 2&gt;&amp;1
Input:  44100 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  44100 --&gt; 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.

Input:  44100 Hz, 2 ch, &#039;s32_le&#039; (0xa): dummy = 0, period = 1764
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  44100 --&gt; 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok.</code></pre></div><p>Chromium with ALSA (without <span class="bbc">apulse</span>) - <span style="color: red"><strong>sound quality is horrible</strong></span>:</p><div class="codebox"><pre><code>$ chromium 2&gt;&amp;1
Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.</code></pre></div><p><span class="bbc">dmix</span> does not employ resampling:</p><div class="codebox"><pre><code>Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)</code></pre></div><p>The most likely cause of audio distortions is, perhaps, Chromium ALSA backend.</p><p>To improve sound quality with Chrome, Chromium, Brave, Min, and the like, one may try to use them with apulse.</p><p><strong>EDIT:</strong></p><p>This seems to be a solution:</p><div class="codebox"><pre><code>chromium 2&gt;&amp;1 --audio-buffer-size=4096</code></pre></div><div class="codebox"><pre><code>$ chromium 2&gt;&amp;1 --audio-buffer-size=8192
Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.

Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.</code></pre></div><p><span style="color: green"><strong>The same solution works for Brave Browser:</strong></span></p><div class="codebox"><pre><code>$ brave-browser-stable 2&gt;&amp;1 --audio-buffer-size=8192
Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.

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

Input:  48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Output: 48000 Hz, 2 ch, &#039;s16_le&#039; (0x2): dummy = 0, period = 1920
Rates:  48000 --&gt; 48000 (J: 0.00%, T: None, W: Planar)
Ok.</code></pre></div><p>With the default <span class="bbc">audio-buffer-size</span>, Brave Browser produces the same audio distortions.</p><p>Redirection of <strong>stderr</strong> to <strong>stdout</strong>, <span class="bbc">2&gt;&amp;1</span>, is used to print debug information from the fftrate resampler.</p><p><strong>Desktop launcher for Brave Browser (with fix for ALSA):</strong></p><div class="codebox"><pre><code>$ 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</code></pre></div><div class="quotebox"><blockquote><div><p>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.</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (igorzwx)]]></author>
			<pubDate>Sun, 28 Sep 2025 21:55:10 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=58277#p58277</guid>
		</item>
	</channel>
</rss>
