Have you tried another power cable and moved the output cable between the dac and the speaker setup away from any power sources? crackling and hissing is usually due to bad insulation of the 3.5mm cables and poor grounding in the setup.
If you can’t move the cable then the other option is ferrite beads/chokes like this that slot onto the end closest to the speaker to reduce EMI pickup from power cables where its located:
Did you manage to solve the problem? I have exactly the same issue. I read that the cause might be the default bitrate, but I can’t figure out how to change it from within Home Assistant.
In my case, the cause of those sounds was the default bitrate settings. After changing it to 48000Hz, everything started working without cracking noises. I’m not sure if it’s the simplest way, but I used SSH to the HA host to edit the daemon.conf file in the audio Docker. After saving the changes and restarting HA audio, everything starts working. Unfortunately, this only lasts until the host restarts (in my case, it’s a VM). Then, the file reverts to its original state, and the problem returns. I haven’t figured out how to deal with this yet.
I also use Proxmox. I use this card:link
Ultimately, I stopped using HA for AirPlay. I installed Shairport Sync in a separate Docker container on Proxmox where I have more control over the settings.
I’ll try to remember how I did it, but ultimately, I abandoned this approach because the config file is restored to default state with every HA VM restart, causing the crackling to return.
SSH access via Terminal is not enough. You need access to the HA host. More information here: Enabling SSH access to the host.
Once logged into the HA terminal, view all containers: docker ps
Find the container with PulseAudio and enter: docker exec -it <container_id> /bin/bash
Locate the configuration file: vi /etc/pulse/daemon.conf
Edit the file: default-sample-rate = 48000 alternate-sample-rate = 48000
Restart the audio container: docker restart ha-audio
In my case, I just wanted to play music from devices via AirPlay. I installed Shairport-sync in a separate Docker container on Proxmox (next to HA, but not within HA). That way I have full control over the audio settings. I wish it was simpler and integrated into HA, but I couldn’t find a way to make the settings persist after a reboot.