Cracking noise when playing audio and when starting the computer

Hello, this is the second time I’m installing manjaro and am having this issue. When I start playing any sound (youtube for example) there is a big cracking noise and then static. I can hear the sound but there is a constant noise over it. After I stop the video/music the noise stops after 2-3 seconds. From what I saw it seems to only happen on headphones, the laptop speaker doesnt produce this noise. Also, I have dual boot with windows and this issue only happens on Manjaro.

I will list some info, hopefully it will help.

uname -a
Linux alexban011 5.14.10-1-MANJARO #1 SMP PREEMPT Thu Oct 7 06:43:34 UTC 2021 x86_64 GNU/Linux
inxi -F
System:    Host: alexban011 Kernel: 5.14.10-1-MANJARO x86_64 bits: 64 Desktop: KDE Plasma 5.22.5 Distro: Manjaro Linux
Machine:   Type: Laptop System: ASUSTeK product: G551VW v: 1.0 serial: <superuser required>
           Mobo: ASUSTeK model: G551VW v: 1.0 serial: <superuser required> UEFI: American Megatrends v: G551VW.303
           date: 04/19/2019
Battery:   ID-1: BAT0 charge: 6.6 Wh (70.2%) condition: 9.4/56.2 Wh (16.7%) volts: 10.8 min: 10.8
CPU:       Info: Quad Core model: Intel Core i7-6700HQ bits: 64 type: MT MCP cache: L2: 6 MiB
           Speed: 800 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
Graphics:  Device-1: Intel HD Graphics 530 driver: i915 v: kernel
           Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: nvidia v: 470.63.01
           Device-3: Chicony HD WebCam (Asus N-series) type: USB driver: uvcvideo
           Display: x11 server: X.Org 1.20.13 driver: loaded: modesetting,nvidia resolution: 1920x1080~60Hz
           OpenGL: renderer: NVIDIA GeForce GTX 960M/PCIe/SSE2 v: 4.6.0 NVIDIA 470.63.01
Audio:     Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel
           Device-2: Trust GXT 232 Microphone type: USB driver: hid-generic,snd-usb-audio,usbhid
           Sound Server-1: ALSA v: k5.14.10-1-MANJARO running: yes
           Sound Server-2: PulseAudio v: 15.0 running: yes
Network:   Device-1: Intel Wireless 7265 driver: iwlwifi
           IF: wlp2s0 state: up mac: 18:5e:0f:91:e4:b1
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169
           IF: enp3s0f1 state: down mac: 08:62:66:b9:0c:6b
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb
           Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running rfk-block: hardware: no software: yes
           address: see --recommends
Drives:    Local Storage: total: 946.16 GiB used: 123.67 GiB (13.1%)
           ID-1: /dev/sda vendor: HGST (Hitachi) model: HTS721010A9E630 size: 931.51 GiB
           ID-2: /dev/sdb type: USB vendor: Kingston model: DataTraveler 3.0 size: 14.65 GiB
Partition: ID-1: / size: 168.62 GiB used: 110.87 GiB (65.8%) fs: ext4 dev: /dev/sda7
           ID-2: /boot/efi size: 96 MiB used: 32.4 MiB (33.7%) fs: vfat dev: /dev/sda2
Swap:      Alert: No swap data was found.
Sensors:   System Temperatures: cpu: 47.0 C mobo: N/A
           Fan Speeds (RPM): cpu: 2100
Info:      Processes: 274 Uptime: 1h 26m Memory: 15.5 GiB used: 4.01 GiB (25.9%) Shell: Zsh inxi: 3.3.08
pacmd list-sinks
1 sink(s) available.
  * index: 0
        name: <alsa_output.0.analog-stereo>
        driver: <module-alsa-sink.c>
        flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9039
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 0
        sample spec: s16le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 1
        configured latency: 0.00 ms; range is 0.50 .. 1837.50 ms
        module: 6
        properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC668 Analog"
                alsa.id = "ALC668 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xdf328000 irq 132"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1f.3"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "a170"
                device.product.name = "100 Series/C230 Series Chipset Family HD Audio Controller"
                device.form_factor = "internal"
                device.string = "front:0"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Built-in Audio Analog Stereo"
                device.icon_name = "audio-card-analog-pci"
lspci -v
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0
        Capabilities: <access denied>
        Kernel driver in use: skl_uncore

00:01.0 PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) (rev 07) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 122
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 0000e000-0000efff [size=4K]
        Memory behind bridge: de000000-df0fffff [size=17M]
        Prefetchable memory behind bridge: 00000000c0000000-00000000d1ffffff [size=288M]
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 131
        Memory at dd000000 (64-bit, non-prefetchable) [size=16M]
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915

00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 07)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at df320000 (64-bit, non-prefetchable) [size=32K]
        Capabilities: <access denied>
        Kernel driver in use: proc_thermal
        Kernel modules: processor_thermal_device_pci_legacy

00:14.0 USB controller: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller (rev 31) (prog-if 30 [XHCI])
        Subsystem: ASUSTeK Computer Inc. Device 201f
        Flags: bus master, medium devsel, latency 0, IRQ 127
        Memory at df310000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci

00:14.2 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 18
        Memory at df338000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel_pch_thermal
        Kernel modules: intel_pch_thermal

00:15.0 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #0 (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at df337000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel-lpss
        Kernel modules: intel_lpss_pci

00:15.1 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #1 (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 17
        Memory at df336000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel-lpss
        Kernel modules: intel_lpss_pci

00:16.0 Communication controller: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 128
        Memory at df335000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: mei_me
        Kernel modules: mei_me

00:17.0 SATA controller: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] (rev 31) (prog-if 01 [AHCI 1.0])
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 125
        Memory at df330000 (32-bit, non-prefetchable) [size=8K]
        Memory at df334000 (32-bit, non-prefetchable) [size=256]
        I/O ports at f090 [size=8]
        I/O ports at f080 [size=4]
        I/O ports at f060 [size=32]
        Memory at df333000 (32-bit, non-prefetchable) [size=2K]
        Capabilities: <access denied>
        Kernel driver in use: ahci

00:1c.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 123
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: df200000-df2fffff [size=1M]
        Prefetchable memory behind bridge: [disabled]
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:1c.3 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #4 (rev f1) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 124
        Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
        I/O behind bridge: 0000d000-0000dfff [size=4K]
        Memory behind bridge: df100000-df1fffff [size=1M]
        Prefetchable memory behind bridge: [disabled]
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:1f.0 ISA bridge: Intel Corporation HM170 Chipset LPC/eSPI Controller (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, medium devsel, latency 0

00:1f.2 Memory controller: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0
        Memory at df32c000 (32-bit, non-prefetchable) [size=16K]

00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset Family HD Audio Controller (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 32, IRQ 132
        Memory at df328000 (64-bit, non-prefetchable) [size=16K]
        Memory at df300000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel

00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset Family SMBus (rev 31)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: medium devsel, IRQ 16
        Memory at df332000 (64-bit, non-prefetchable) [size=256]
        I/O ports at f040 [size=32]
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801

01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
        Subsystem: ASUSTeK Computer Inc. Device 1d3d
        Flags: bus master, fast devsel, latency 0, IRQ 133
        Memory at de000000 (32-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at d0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at e000 [size=128]
        Expansion ROM at df000000 [virtual] [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
        Subsystem: Intel Corporation Dual Band Wireless-AC 7265
        Flags: bus master, fast devsel, latency 0, IRQ 129
        Memory at df200000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: <access denied>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader (rev 01)
        Subsystem: ASUSTeK Computer Inc. Device 202f
        Flags: bus master, fast devsel, latency 0, IRQ 126
        Memory at df115000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at df100000 [disabled] [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: rtsx_pci
        Kernel modules: rtsx_pci

03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
        Subsystem: ASUSTeK Computer Inc. Device 200f
        Flags: bus master, fast devsel, latency 0, IRQ 19
        I/O ports at d000 [size=256]
        Memory at df114000 (64-bit, non-prefetchable) [size=4K]
        Memory at df110000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: r8169
        Kernel modules: r8169

Folder at /etc/modprobe.d only contains mhwd-gpu.conf

What I tried so far:
https://forum.manjaro.org/t/hearing-a-lot-of-bad-noise-when-no-audio-is-playing-on-battery/37367/3
https://forum.manjaro.org/t/cracking-sound-from-audio/44452
https://forum.manjaro.org/t/constant-crackling-noise-from-microphone-couldnt-solve-despite-many-similar-topics/71926/10
https://archived.forum.manjaro.org/t/solved-crackling-sound/113943

EDIT: I have tested 2 headphones and the same thing happens with both and since windows 10 doesnt have this issue it most likely is not a hardware issue. The only thing I have seen but haven’t tested is to change my kernel to 4.19 (someone said this issue doesnt appear there but 4.19 is much older than 5.10, which I have, and I hope I can get this fixed without changing my kernel to such an old version.

The preferred (for better output) is How to provide good information

From a quick review it looks like you tried the first section here, but what about the second ?
(and the rest I suppose)

https://wiki.archlinux.org/title/PulseAudio/Troubleshooting#Glitches,_skips_or_crackling

/etc/modprobe.d/sound.conf

options snd-hda-intel vid=8086 pid=8ca0 snoop=0

And

Make sure you have alsa-utils installed, launch alsamixer, then select your audio device (pressing F6), navigate all the way left using the left arrow, and stop on Loopback, if Enabled disable it using the down arrow. This should not impact audio playback or microphone recording negatively, unless you require loopback mixing.

alsa-utils wasn’t installed, but I already tried that too. (both automute and loopback were off by default)

/etc/modprobe.d does not contain any file “sound.conf” should I create it myself ?

None of those links helped me so far, I either tried and it didn’t work and in the cases where I do not have the files they were talking about I stopped since they were saying to put something at the end of the file but there is no file to begin with

xxx.d folders are for appending configs.
Such as in the case above, create the file with the single line.

I see you have 2 audio devices. Have you try to switch on any of them? Try to disable one if you use the other. You can also try to switch form line-out to headphone channel or vice versa. All of that can be done from audio device configuration in Manjaro settings.

Oops, scratch that. I didn’t see that the second devices is a mic. Nevertheless, you can try disabling that second device in case of overlapping channel with your headphone mic.

The modprobe option suggested is not likely to work unless the Vendor ID and Product ID codes are correctly matched to the audio device.
vid=8086 is ok for any Intel device but the pid for the specific product would be different to the suggestion in Archwiki

Use this command to get a list of audio devices with ID codes

lspci -vnn | grep -A1 Audio

That will show Intel ID code [8086:xxxx] and a subdevice ID code for Asus [1043:xxxx]
(The Asus ID code should not be needed but might work as a replacement if the Intel code does not work )

I’ve dealing with clicking sound problem --i dont know how to describe it-- and its maybe the same problem with yours. Sound clicking every boot and in every the first second when playing audio (local files: music and video), but its fine for web audio: youtube,spotify etc. Sound also clicking when I pause a video/music and play it again after a while.

This thread solve my problem:
https://forums.linuxmint.com/viewtopic.php?t=308531