waveshare / WM8960-Audio-HAT

The drivers of [WM8960 Audio HAT] for Raspberry Pi
GNU General Public License v3.0
100 stars 65 forks source link

Build error on kernel: 5.15.30-v7+ (armv7l) #44

Open theNorNi opened 2 years ago

theNorNi commented 2 years ago

New kernel version for Raspberry OS Bullseye raspberrypi-kernel (1:1.20220328-1). raspberrypi-kernel-headers (1:1.20220328-1).

Build fails with error message: "Error! Bad return status for module build on kernel: 5.15.30-v7+ (armv7l)" make.log

bnwlf commented 2 years ago

Same here at waveshares 13.1 Magic Mirror with Raspberry OS Bullseye.

dr-ni commented 2 years ago

I've started to fix the problem: (see also https://github.com/torvalds/linux/blob/master/sound/soc/generic/simple-card.c)

Compilation is now working in my fork: diff: https://github.com/dr-ni/WM8960-Audio-HAT/commit/ae4522f44125754783ce12043bc0f3ffab075441

However, still some remainining problems:

pi@pizero2:~/WM8960-Audio-HAT $ sudo  ./install.sh 
OK:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
OK:2 http://archive.raspberrypi.org/debian bullseye InRelease
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Alle Pakete sind aktuell.
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
raspberrypi-kernel ist schon die neueste Version (1:1.20220331-1).
raspberrypi-kernel-headers ist schon die neueste Version (1:1.20220331-1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
dkms ist schon die neueste Version (2.8.4-3).
git ist schon die neueste Version (1:2.30.2-1).
i2c-tools ist schon die neueste Version (4.2-1+b1).
libasound2-plugins ist schon die neueste Version (1.2.2-2).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Error! The module/version combo: wm8960-soundcard-1.0
is not located in the DKMS tree.

Creating symlink /var/lib/dkms/wm8960-soundcard/1.0/source ->
                 /usr/src/wm8960-soundcard-1.0

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=5.15.32-v7+ -C /lib/modules/5.15.32-v7+/build M=/var/lib/dkms/wm8960-soundcard/1.0/build......
cleaning build area...

DKMS: build completed.

snd-soc-wm8960.ko:
Running module version sanity check.
 - Original module
   - Found /lib/modules/5.15.32-v7+/kernel/sound/soc/codecs/snd-soc-wm8960.ko
   - Storing in /var/lib/dkms/wm8960-soundcard/original_module/5.15.32-v7+/armv7l/
   - Archiving for uninstallation purposes
 - Installation
   - Installing to /lib/modules/5.15.32-v7+/kernel/sound/soc/codecs/

snd-soc-wm8960-soundcard.ko:
Running module version sanity check.
 - Original module
   - Found /lib/modules/5.15.32-v7+/kernel/sound/soc/bcm/snd-soc-wm8960-soundcard.ko
   - Storing in /var/lib/dkms/wm8960-soundcard/original_module/5.15.32-v7+/armv7l/
   - Archiving for uninstallation purposes
 - Installation
   - Installing to /lib/modules/5.15.32-v7+/kernel/sound/soc/bcm/

depmod......

DKMS: install completed.
mkdir: das Verzeichnis „/etc/wm8960-soundcard“ kann nicht angelegt werden: Die Datei existiert bereits
Job for wm8960-soundcard.service failed because the control process exited with error code.
See "systemctl status wm8960-soundcard.service" and "journalctl -xe" for details.
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
------------------------------------------------------

pi@pizero2:~/WM8960-Audio-HAT $ systemctl status wm8960-soundcard.service
 wm8960-soundcard.service - WM8960 soundcard service
     Loaded: loaded (/lib/systemd/system/wm8960-soundcard.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-04-06 16:30:29 BST; 7min ago
    Process: 4430 ExecStart=/usr/bin/wm8960-soundcard (code=exited, status=1/FAILURE)
   Main PID: 4430 (code=exited, status=1/FAILURE)
        CPU: 370ms

Apr 06 16:30:27 pilot systemd[1]: Starting WM8960 soundcard service...
Apr 06 16:30:27 pilot wm8960-soundcard[4430]: + exec
Apr 06 16:30:27 pilot wm8960-soundcard[4431]: ++ basename /usr/bin/wm8960-soundcard
Apr 06 16:30:29 pilot systemd[1]: wm8960-soundcard.service: Main process exited, code=exited, status=1/FAILURE
Apr 06 16:30:29 pilot systemd[1]: wm8960-soundcard.service: Failed with result 'exit-code'.
Apr 06 16:30:29 pilot systemd[1]: Failed to start WM8960 soundcard service.

pi@pizero2:~/WM8960-Audio-HAT $ sudo dmesg
[   14.806454] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2c@7e804000/status
[   15.580666] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2s@7e203000/status
[   15.581812] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2c@7e804000/status
[   15.581973] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/compatible
[   15.581994] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/simple-audio-card,format
[   15.582014] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/simple-audio-card,name
[   15.582047] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/status
[   15.582066] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/simple-audio-card,widgets
[   15.582086] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/sound/simple-audio-card,routing
[   15.631265] Error: Driver 'asoc-simple-card' is already registered, aborting...
[   15.987844] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2s@7e203000/status
[   16.064596] wm8960 1-001a: failed to configure clock
[   16.064622] wm8960 1-001a: ASoC: error at snd_soc_component_set_bias_level on wm8960.1-001a: -22
[   16.064637] wm8960 1-001a: ASoC: Failed to prepare bias: -22
[   16.065631] wm8960 1-001a: failed to configure clock
[   16.065642] wm8960 1-001a: ASoC: error at snd_soc_dai_hw_params on wm8960-hifi: -22
[   16.065656] asoc-simple-card soc:sound: ASoC: PRE_PMU: wm8960-hifi-wm8960-hifi-playback event failed: -22
[   16.065996] wm8960 1-001a: failed to configure clock
[   16.066006] wm8960 1-001a: ASoC: error at snd_soc_dai_hw_params on wm8960-hifi: -22
[   16.066018] asoc-simple-card soc:sound: ASoC: PRE_PMU: wm8960-hifi-wm8960-hifi-capture event failed: -22
[   16.068719] wm8960 1-001a: failed to configure clock
[   16.068730] wm8960 1-001a: ASoC: error at snd_soc_component_set_bias_level on wm8960.1-001a: -22
dr-ni commented 2 years ago

update:

forgot to update wm8960.c and wm8960.h diff: https://github.com/dr-ni/WM8960-Audio-HAT/commit/5f3edc13a3ab591ed2af40a6c0b3b286e312cb8e so now dmesg is looking better but still some problems:

pi@pizero2:~/WM8960-Audio-HAT $ arecord test.wav 
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:830: Fehler beim Öffnen des Gerätes: Datei oder Verzeichnis nicht gefunden
pi@pizero2:~/WM8960-Audio-HAT $ speaker-test -t wav 

speaker-test 1.2.4

Wiedergabe-Gerät ist default
Stream-Parameter sind 48000 Hz, S16_LE, 1 Kanäle
WAV-Datei(en)
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
Fehler beim Öffnen des Gerätes: -2, Datei oder Verzeichnis nicht gefunden
dr-ni commented 2 years ago

update: https://github.com/dr-ni/WM8960-Audio-HAT/commit/4ec150d5a0042727143e3b910b99dd56a3a8011b

I have now some noisy sound on raspberrypi zero 2. Can anybody test this also on other models and report?

https://github.com/dr-ni/WM8960-Audio-HAT

TobiasVanDyk commented 2 years ago

Yes thank you - tested on Pi4B waveshare Pi WM8960 Hat- git pull from your own fork - scratchy sound with VLC - but it is getting there!

dr-ni commented 2 years ago

and recording? is it working?

TobiasVanDyk commented 2 years ago

yes tested with arecord -v test.wav is working

TobiasVanDyk commented 2 years ago

speaker-test -t wav

gives me a clear "Front-Left" with no scratchy noises

dr-ni commented 2 years ago

and speaker-test -t wav -c 2

is the recording stereo and scratching?

TobiasVanDyk commented 2 years ago

speaker-test -t wav -c 2 Front-Right no scrathes very clear hifi

recording mike is inside a box on the hat but is sounds clear no scratches

TobiasVanDyk commented 2 years ago

speaker-test -t wav -c 2 Front-Right no scratches very clear hifi

recording mike is inside a box on the hat but is sounds clear no scratches

dr-ni commented 2 years ago

is it stereo?

TobiasVanDyk commented 2 years ago

speaker test -t wav -c 2 reports it as 2 channels arecord is mono

dr-ni commented 2 years ago

and arecord -f S32_LE -r 48000 -c 2 test.wav

TobiasVanDyk commented 2 years ago

Stereo

dr-ni commented 2 years ago

can you please test again:

git pull git checkout master sudo ./install.sh sudo reboot

TobiasVanDyk commented 2 years ago

Hi still crackling playback with vlc mp3 Goimg to do clean uninstall - install

TobiasVanDyk commented 2 years ago

Plays nicely with the wav files in /usr/share/sounds - no scratches

But 16bit 44.1kHz wav file still scratchy sounds

dr-ni commented 2 years ago

what does aplay -l and aplay -L show?

TobiasVanDyk commented 2 years ago

pi@raspberrypi:~ $ aplay -l List of PLAYBACK Hardware Devices card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 pi@raspberrypi:~ $ aplay -L null Discard all samples (playback) or generate zero samples (capture) lavrate Rate Converter Plugin Using Libav/FFmpeg Library samplerate Rate Converter Plugin Using Samplerate Library speexrate Rate Converter Plugin Using Speex Resampler jack JACK Audio Connection Kit oss Open Sound System pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) vdownmix Plugin for channel downmix (stereo) with a simple spacialization default Playback/recording through the PulseAudio sound server playback capture dmixed array hw:CARD=Headphones,DEV=0 bcm2835 Headphones, bcm2835 Headphones Direct hardware device without any conversions plughw:CARD=Headphones,DEV=0 bcm2835 Headphones, bcm2835 Headphones Hardware device with all software conversions sysdefault:CARD=Headphones bcm2835 Headphones, bcm2835 Headphones Default Audio Device dmix:CARD=Headphones,DEV=0 bcm2835 Headphones, bcm2835 Headphones Direct sample mixing device usbstream:CARD=Headphones bcm2835 Headphones USB Stream Output hw:CARD=wm8960soundcard,DEV=0 wm8960-soundcard, bcm2835-i2s-wm8960-hifi wm8960-hifi-0 Direct hardware device without any conversions plughw:CARD=wm8960soundcard,DEV=0 wm8960-soundcard, bcm2835-i2s-wm8960-hifi wm8960-hifi-0 Hardware device with all software conversions sysdefault:CARD=wm8960soundcard wm8960-soundcard, bcm2835-i2s-wm8960-hifi wm8960-hifi-0 Default Audio Device dmix:CARD=wm8960soundcard,DEV=0 wm8960-soundcard, bcm2835-i2s-wm8960-hifi wm8960-hifi-0 Direct sample mixing device usbstream:CARD=wm8960soundcard wm8960-soundcard USB Stream Output hw:CARD=vc4hdmi0,DEV=0 vc4-hdmi-0, MAI PCM i2s-hifi-0 Direct hardware device without any conversions plughw:CARD=vc4hdmi0,DEV=0 vc4-hdmi-0, MAI PCM i2s-hifi-0 Hardware device with all software conversions sysdefault:CARD=vc4hdmi0 vc4-hdmi-0, MAI PCM i2s-hifi-0 Default Audio Device hdmi:CARD=vc4hdmi0,DEV=0 vc4-hdmi-0, MAI PCM i2s-hifi-0 HDMI Audio Output dmix:CARD=vc4hdmi0,DEV=0 vc4-hdmi-0, MAI PCM i2s-hifi-0 Direct sample mixing device usbstream:CARD=vc4hdmi0 vc4-hdmi-0 USB Stream Output hw:CARD=vc4hdmi1,DEV=0 vc4-hdmi-1, MAI PCM i2s-hifi-0 Direct hardware device without any conversions plughw:CARD=vc4hdmi1,DEV=0 vc4-hdmi-1, MAI PCM i2s-hifi-0 Hardware device with all software conversions sysdefault:CARD=vc4hdmi1 vc4-hdmi-1, MAI PCM i2s-hifi-0 Default Audio Device hdmi:CARD=vc4hdmi1,DEV=0 vc4-hdmi-1, MAI PCM i2s-hifi-0 HDMI Audio Output dmix:CARD=vc4hdmi1,DEV=0 vc4-hdmi-1, MAI PCM i2s-hifi-0 Direct sample mixing device usbstream:CARD=vc4hdmi1 vc4-hdmi-1 USB Stream Output pi@raspberrypi:~ $

TobiasVanDyk commented 2 years ago

when using audacious getting much better quality sound - have to adjust the two volume (audacious and main) controls - still some background crackle but much less

Getting no crackle sound in Audacious when using Alsa with direct HW WM8960 setting - solved?

Yes using the same setting with VLC (ALSA and Direct HW WM8960) gives good sound - SOLVED by your code!!

bnwlf commented 2 years ago

Hi folks, I hadn't the time to check the new fixes. Since my post i found this repo: https://github.com/HinTak/seeed-voicecard. It works at least somehow. (But I will try it in the next days. Thanks for that!)

The wm8960-soundcard.service is there also failing (status 99). Do you know the sense of this service since the driver?

dr-ni commented 2 years ago

@TobiasVanDyk is aplay -D dmixed pcm16LE44100.wav playing clean?

dr-ni commented 2 years ago

@bnwlf sorry I'm not familar with this

TobiasVanDyk commented 2 years ago

@dr-ni

Yes it plays clean no noise - I used another 16bit/44.1kHz file: (no dmix plugin so it plays little bit too fast 48/44.1 x normal rate)

pi@raspberrypi:~ $ aplay -D dmixed pcm16LE44100.wav pcm16LE44100.wav: No such file or directory pi@raspberrypi:~ $ aplay -D dmixed 1.wav Playing WAVE '1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz) please, try the plug plugin (-Dplug:dmixed)

VLC now plays cleanly using ALSA + wm8960-soundcard-direct-mixer setting in VLC preferences->Audio-settings Using pulseaudio still has the noisy distortion

To install first uninstall the old waveshare driver and reboot then delete the old WM8960-Audio-HAT folder Then: git clone https://github.com/dr-ni/WM8960-Audio-HAT cd WM8960-Audio-HAT sudo ./install.sh sudo reboot

Ignore the message "failed to load i2s-mmap" - it does load from config.txt and it is required Change VLC audio preferences to use ALSA and the mixer to wm8960 direct mixer

dr-ni commented 2 years ago

I have actually no clue about that noise is it only with pulseaudio?

you have to play like this: aplay -D plug:dmixed audio.wav

TobiasVanDyk commented 2 years ago

I assumed it is the same noise you experienced here?

dr-ni commented 23 hours ago update: https://github.com/dr-ni/WM8960-Audio-HAT/commit/4ec150d5a0042727143e3b910b99dd56a3a8011b I have now some noisy sound on raspberrypi zero 2. Can anybody test this also on other models and report? https://github.com/dr-ni/WM8960-Audio-HAT

dr-ni commented 2 years ago

I have now no noise with dmixed so maybe only a resampling problem. I don't have pulseaudio and no X

TobiasVanDyk commented 2 years ago

Yes I am happy - it now plays nicely I am hoping for others to comment on their experience?

The noise seems to be a distorted audio sub-level with clear audio super-imposed on the noise

dr-ni commented 2 years ago

yes, would be interesting how it is working on other systems

https://github.com/dr-ni/WM8960-Audio-HAT

dr-ni commented 2 years ago

I've now also tested https://github.com/HinTak/seeed-voicecard It is working very well

@TobiasVanDyk do you have the noise with this driver?

TobiasVanDyk commented 2 years ago

I tried to but it does not like my WM8960 waveshare hat: https://www.waveshare.com/wm8960-audio-hat.htm

dmesg | grep wm8960 [ 17.295029] wm8960 1-001a: ASoC: error at snd_soc_dai_hw_params on wm8960-hifi: -22 [ 17.295045] bcm2835-i2s-wm8960-hifi: ASoC: soc_pcm_hw_params() failed (-22) [ 17.295750] wm8960 1-001a: failed to configure clock

I think it either needs a custom kernel and/or a Seeed HAT and/or changed install.sh I attach the install.log install3.txt

dr-ni commented 2 years ago

can you uninstall your WM8960-Audio-HAT (sudo ./uninstall.sh) then cd seeed-voicecard make clean make and send me the output?

TobiasVanDyk commented 2 years ago

Hi dr-ni

make1.txt

TobiasVanDyk commented 2 years ago

Ok I made a mistake - when I did the git clone from HinTak then the drivers works first time - no need to put it into ALSA make2.txt

pi@raspberrypi:~ $ aplay -l List of PLAYBACK Hardware Devices card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0

pi@raspberrypi:~ $ cd seeed-voicecard pi@raspberrypi:~/seeed-voicecard $ make clean make -C /lib/modules/5.15.32-v7l+/build M=/home/pi/seeed-voicecard clean make[1]: Entering directory '/usr/src/linux-headers-5.15.32-v7l+' make[1]: Leaving directory '/usr/src/linux-headers-5.15.32-v7l+' pi@raspberrypi:~/seeed-voicecard $ make make -C /lib/modules/5.15.32-v7l+/build M=/home/pi/seeed-voicecard modules make[1]: Entering directory '/usr/src/linux-headers-5.15.32-v7l+' CC [M] /home/pi/seeed-voicecard/wm8960.o LD [M] /home/pi/seeed-voicecard/snd-soc-wm8960.o CC [M] /home/pi/seeed-voicecard/ac108.o CC [M] /home/pi/seeed-voicecard/ac101.o LD [M] /home/pi/seeed-voicecard/snd-soc-ac108.o CC [M] /home/pi/seeed-voicecard/seeed-voicecard.o LD [M] /home/pi/seeed-voicecard/snd-soc-seeed-voicecard.o MODPOST /home/pi/seeed-voicecard/Module.symvers CC [M] /home/pi/seeed-voicecard/snd-soc-ac108.mod.o LD [M] /home/pi/seeed-voicecard/snd-soc-ac108.ko CC [M] /home/pi/seeed-voicecard/snd-soc-seeed-voicecard.mod.o LD [M] /home/pi/seeed-voicecard/snd-soc-seeed-voicecard.ko CC [M] /home/pi/seeed-voicecard/snd-soc-wm8960.mod.o LD [M] /home/pi/seeed-voicecard/snd-soc-wm8960.ko make[1]: Leaving directory '/usr/src/linux-headers-5.15.32-v7l+'

dr-ni commented 2 years ago

ok so my fork is still with errors...

TobiasVanDyk commented 2 years ago

Yes sorry about the mistake I made....

bnwlf commented 2 years ago

Hi @dr-ni i had some time to test your driver,..

If I think a bit longer I tested the seeed driver first,.. maybe there are some issues with the old installation,.. I will check that.

so I would say its close,.. Thanks for your work.

bnwlf commented 2 years ago

Success,.. new install helped!

bringItUpX commented 2 years ago

Big Thanks @dr-ni for your work. Now i can use the module in the Raspi Desktop although i use the newer dtoverlay=vc4-kms-v3d in the config.txt. And this without noise. I wish to sum up all steps: I uninstalled the unworking WM8960-Audio-HAT from WAVESHARE and deleted the files that i downloaded from the WAVESHARE repo. I made git clone https://github.com/dr-ni/WM8960-Audio-HAT in my user directory of my Raspi 4 (32bit Desktop), (attatched with the WM8960 audio module and two speakers and a 7 inch touch display). cd WM8960-Audio-HAT sudo ./install.sh sudo reboot

Ignore the message "failed to load i2s-mmap" as @TobiasVanDyk mentined. Then, in the grafical desktop of the raspi you make a rigth click on the speaker symbol and select the wm8960-soundcard. After this you can open Chromium and play a youtube video. You will hear the music, but with some noise.

The next steps will install other drivers for the wm8960-soundcard. Only a new driver, the rest should come from the repo of @dr-ni and stay.

First i run cd WM8960-Audio-HAT and sudo ./uninstall.sh to uninstall the driver from @dr-ni . Then cd .. and git clone https://github.com/HinTak/seeed-voicecard cd seeed-voicecard make clean make sudo ./install.sh

The install.sh script above shows some errors in the midle of working. You need to reboot and run it again.

Then the necessary drivers are installed. Now you can run the install.sh from @dr-ni again, but before i changed this script a little bit. I opened WM8960-Audio-HAT/install.sh and changed this line: install_module "./" "wm8960-soundcard" to #install_module "./" "wm8960-soundcard"

Then run again the install script: cd WM8960-Audio-HAT sudo ./install.sh

I think a cold boot is necessary. Finish! Now you can open Chromium in Raspi Desktop and hear a youtube video without additional noise. Thanks to above two repos. Thanks @dr-ni .

TobiasVanDyk commented 2 years ago

Using the new 1 May 2022 Waveshare Drivers works perfectly:

git clone https://github.com/waveshare/WM8960-Audio-HAT cd WM8960-Audio-HAT sudo ./install.sh sudo reboot

After the reboot aplay -l should show the wm8960 soundcard and plays pulseaudio and alsa with no distortion