Firefox crackling audio in Youtube

The issue is plaguing me for days now, and I haven't been able to find solution. Crackling worsens as the video is switched to fullscreen.
My setup overview is: Pulseaudio (custom asoundrc and daemon settings) --> Pulseeffects --> Optical Out --> DAC --> Studio Monitors.

Seemingly, firefox defaults to 48000 hz playback rate in youtube, that could be a contribution in crackling, as I tried same videos in Brave browser, and it runs on 44100 hz (global setting in daemon.conf) and doesn't have any crackling issues in any scenario. Rest of the application do run @ 44100 hz playback rate as well, with no crackling, but somehow, firefox doesn't.
I am not sure if the issue is related to playback rate or something else, but I haven't been able to switch firefox to 44100 hz, and neither fix the crackling sound.firefox

Maybe Cracklin' Rosie ?

2 Likes

What hardware do you have? Regardless of the fact this happens only in Firefox it would help to know with regards actually trying to solve this oddity:

2 Likes

what would those custom configurations be?

in screenshot data
Firefox has format float32le and only 1 channel
was audio only tested on youtube?
was youtube tested for other video quality settings?

brave browser also showing format float32le

has anything suggested by Archwiki been tried already?
https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Audio_quality

1 Like

it's a known issue related to the energy saving mechanism. please try
'echo 0 | sudo tee /sys/module/snd_hda_intel/parameters/power_save '
and then
'echo N | sudo tee /sys/module/snd_hda_intel/parameters/power_save_controller '

if it solves the problem make it permanent by using
'echo "options snd-hda-intel power_save=0 power_save_controller=N" | sudo tee /etc/modprobe.d/hda.conf '

yes, this was on youtube, but of a video @ 480p.
Here's a screenshot of both Brave and Firefox, playing the same video @ 4k.
samplerate

I am using daemon.conf and asoundrc files from https://github.com/andres-jurado/audiophile-linux
And Pulseeffects settings from https://github.com/JackHack96/PulseEffects-Presets/blob/master/Bass%20Enhancing%20%2B%20Perfect%20EQ.json with Crystalizer and Custom Convolver.
I have already tried suggestions on the wiki, as well as trying disabling WebRTC processing, forcing ALSA by changing security.sandbox.content.syscall_whitelistto 16, disabling hardware acceleration, but nothing has worked.

Edit: Using Firefox 75, and Brave 1.7.90, both updated through Manjaro stable branch.

These settings are already there in the mentioned files, and it hasn't made any difference.

Here's the output from inxi -Fxxxza --no-host

System:    Kernel: 5.6.3-2-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 
           parameters: BOOT_IMAGE=/vmlinuz-5.6-x86_64 root=UUID=f57500ca-59fb-4267-88c5-39c7c882b8af rw quiet apparmor=1 
           security=apparmor resume=UUID=9647a8a6-13aa-4244-a6d9-007dbcf109e0 udev.log_priority=3 
           Desktop: KDE Plasma 5.18.4 tk: Qt 5.14.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: ASUSTeK model: TUF GAMING X570-PLUS (WI-FI) v: Rev X.0x serial: <filter> 
           UEFI: American Megatrends v: 1407 date: 04/01/2020 
CPU:       Topology: 12-Core model: AMD Ryzen 9 3900X bits: 64 type: MT MCP arch: Zen family: 17 (23) model-id: 71 (113) 
           stepping: N/A microcode: 8701013 L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 204059 
           Speed: 4268 MHz min/max: 2200/4250 MHz boost: enabled Core speeds (MHz): 1: 4237 2: 4258 3: 4242 4: 4248 5: 4252 
           6: 4227 7: 4222 8: 4249 9: 4268 10: 4224 11: 4228 12: 4244 13: 4286 14: 4262 15: 4250 16: 4250 17: 4262 18: 4267 
           19: 4249 20: 4270 21: 4236 22: 4257 23: 4268 24: 4252 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: conditional, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 
           vendor: Micro-Star MSI driver: amdgpu v: kernel bus ID: 0b:00.0 chip ID: 1002:731f 
           Display: x11 server: X.Org 1.20.8 driver: amdgpu FAILED: ati unloaded: modesetting,radeon alternate: fbdev,vesa 
           compositor: kwin_x11 resolution: 3840x2160~60Hz 
           OpenGL: renderer: AMD Radeon RX 5700 XT (NAVI10 DRM 3.36.0 5.6.3-2-MANJARO LLVM 9.0.1) v: 4.6 Mesa 20.0.4 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 HDMI Audio driver: snd_hda_intel v: kernel bus ID: 0b:00.1 
           chip ID: 1002:ab38 
           Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 0d:00.4 chip ID: 1022:1487 
           Device-3: Logitech OrbiCam type: USB driver: snd-usb-audio,uvcvideo bus ID: 5-2:2 chip ID: 046d:0892 
           serial: <filter> 
           Sound Server: ALSA v: k5.6.3-2-MANJARO 
Network:   Device-1: Intel Wireless-AC 9260 driver: iwlwifi v: kernel bus ID: 04:00.0 chip ID: 8086:2526 
           IF: wlp4s0 state: up mac: <filter> 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK driver: r8169 v: kernel port: f000 
           bus ID: 05:00.0 chip ID: 10ec:8168 
           IF: enp5s0 state: down mac: <filter> 
           IF-ID-1: docker0 state: down mac: <filter> 
Drives:    Local Storage: total: 4.55 TiB used: 994.36 GiB (21.3%) 
           ID-1: /dev/nvme0n1 vendor: Corsair model: Force MP600 size: 931.51 GiB block size: physical: 512 B logical: 512 B 
           speed: 63.2 Gb/s lanes: 4 serial: <filter> rev: EGFM11.3 scheme: GPT 
           ID-2: /dev/sda vendor: Western Digital model: WD40EZRZ-19GXCB0 size: 3.64 TiB block size: physical: 4096 B 
           logical: 512 B speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> rev: 0A80 scheme: GPT 
Partition: ID-1: / raw size: 100.00 GiB size: 97.93 GiB (97.93%) used: 29.12 GiB (29.7%) fs: ext4 dev: /dev/nvme0n1p3 
           ID-2: /boot raw size: 1.00 GiB size: 975.9 MiB (95.21%) used: 97.9 MiB (10.0%) fs: ext4 dev: /dev/nvme0n1p1 
           ID-3: /home raw size: 300.00 GiB size: 294.29 GiB (98.10%) used: 142.42 GiB (48.4%) fs: ext4 dev: /dev/nvme0n1p4 
           ID-4: swap-1 size: 4.00 GiB used: 0 KiB (0.0%) fs: swap swappiness: 60 (default) cache pressure: 100 (default) 
           dev: /dev/nvme0n1p5 
Sensors:   System Temperatures: cpu: 52.2 C mobo: N/A gpu: amdgpu temp: 44 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 831 
Info:      Processes: 434 Uptime: 8h 38m Memory: 31.34 GiB used: 4.86 GiB (15.5%) Init: systemd v: 244 Compilers: gcc: 9.3.0

suspect 'Cracklin' Rosie' is likely be Pulseaudio, but may be in pulseffects
suggest turn off Pulseffects to troubleshoot Pulseaudio

author of audiophile-linux github page seems a bit confused

ALSA configuration file ~/.asoundrc should not be needed instead of system configuration /etc/asound.conf for Pulseaudio playback

hw is ALSA device not a plugin
device names and numbers are listed in aplay -land 'arecord -l'
and ALSA configuration is not using type hw anyway

type plug is an ALSA plugin

https://alsa.opensrc.org/Plugin_Documentation
To create an automatic rate-conversion virtual device (using the "plug" plugin that is designed for that purpose)

i do not see the point of adding another way for audio to be changed

audio stream from youtube is usually using opus codec which is good for up to 48kHz, but not lossless
and no way to know if audio was up-sampled when encoded to video format

Ok, tried without PulseEffects, and the crackling is still there. So it seems like the issue is related to PulseAudio. I am still not able to understand the issue, and why crackling worsens as I put the video to full screen.
And noticed one thing after I disabled PulseEffects, the crackling isn't very noticeable just after a cold boot. Suddenly you'd be watching videos, and one moment it'll crackle, and then it won't stop until the PC is rebooted again. Only happening in firefox though.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by