I have a problem with the integration of the WM8960 DAC HAT module with balenaOs. I use balena-blocks audio to be able to make sound on the machine. The audio managed to find my audio card but I can’t manage to use the card to make sound.
According to the documentation: GitHub - balenablocks/audio: Audio building block for balenaOS, based on pulseaudio. I need to use the AUDIO_OUTPUT variable to set the sound card.
So I did this:
This doesn’t work my balenablock-audio can’t use my sound card I don’t know why. Can you enlighten me step by step how I can use my WM8960 DAC HAT module with balenaOS.
Here is my error returned by balenablocks-audio
I see from their documentation that there are drivers required for this HAT . Have you installed them by chance?
If not, you can test them using our Kernel Module Build  to ensure it’s working as expected, and then if so, you can submit a Pull Request to our Raspberry Pi repo  on GitHub so that we can include those going forward in future iterations of the hostOS.
Let us know how things go and if you have any trouble testing the drivers or getting them added!
 WM8960 Audio HAT - Waveshare Wiki
 GitHub - balena-os/kernel-module-build: Example project for building an OOT kernel module in balena
 GitHub - balena-os/balena-raspberrypi: Balena support for RaspberryPI boards
Thank you for your answer, however I can’t install the driver on balena, it complains that I’m not on raspbian
That said, in the resin boot overlay folder of my sd card, I already have the file wm8960-soundcard.dtbo
I absolutely don’t know how to use the kernel modules repository, do you have more documentation?
When I do an aplay -l in the audio container, I can see my sound card (card 1)
the AUDIO OUTPUT environment variable to the value
But I cannot use it
In my device configuration, I add this.
I forgot to say, if I try to play a wav file with the audio container, I get this:
Obviously no sound comes out of my audio card, it would have been too good haha
Hi, just reading through this thread.
The WM8960 codec is already supported on the Linux kernel that BalenaOS is using. The only missing pieces that are provided by the manufacturer are the
Could you try to copy them into the host OS and verify the playback and recording?
To copy them, log into the hostOS and type the following:
mount -o remount,rw /
And then, from your workstation clone the project and copy the files to the device:
git clone https://github.com/waveshare/WM8960-Audio-HAT.git
scp -P 22222 /tmp/WM8960-Audio-HAT/asound.conf root@<ip address>:/etc/asound.conf
scp -P 22222 /tmp/WM8960-Audio-HAT/wm8960_asound.state root@<ip address>:/var/lib/alsa/asound.state
scp is not working for you (depends on your client version), you can try using
Once that is done, reboot the device, and try to play and record with:
Thanks for your reply, but I can’t run this.
I use a microservice architecture, connected through a compose docker. Among it’s microservices, there is a textopeech which generates wav files and uses the audio container for the sound to work.
To be a little clearer, in my docker-compose , about the audio, I have:
By the way, I also changed the configuration of my device. As I can’t use the AUDIO OUTPUT variable with my sound card I did this:
Hello, I’m happy to report that I managed to get the sound card: WM8960 Audio HAT - Waveshare Wiki to work with balena. Here is the solution GitHub - MiroYld/smartaudio-docker: Play sound in your docker container. Do not hesitate to use this git repository if you have a problem with the WM8960
Glad to know that it worked and thanks for sharing the example app. We will use it as a reference.