Additional supplement
Raspbery Pi, other than 4B and 400, needs to disable the audio module, othewise the LED will not work
properly.
1. Create a new snd-blacklist.conf and open it for editing
sudo nano /etc/modprobe.d/snd-blacklist.conf
Add following content: After adding the contents, you need to press Ctrl+O, Enter, Ctrl+Z.
blacklist snd_bcm2835
2. We also need to edit config file.
sudo nano /boot/config.txt
Find the contents of the following two lines (with Ctrl + W you can search):
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
Add # to comment out the second line. Press Ctrl+O, Enter, Ctrl+X.
# Enable audio (loads snd_bcm2835)
# dtparam=audio=on
It will take effect after restarting, and you can restart after executing the next section.
If you want to restart the audio module, just restore the content modified in the above two steps.