Waveshare WM8960 Audio Hat working!

Had a bit of trouble getting this card up and running, as I’m new to all of this but in the end I got it working, well at least audio out, haven’t tested the built in mic’s yet.
Anyway I installed the drives as per Waveshares instructions (not sure if it was necessary)and used the following settings in the audio setup:
Driver Config:
dtoverlay=wm8960-soundcard
Jackd Options:
-P 70 -t 2000 -s -d alsa -d hw:0 -r 48000 -p 256 -n 2 -X raw

I think this card is a good fun cheap option if you want to build a little portable Zynthian with built in speakers.

3 Likes

Hi @Gadjet! May I extend to you a warm welcome to our little community. Well done on getting this card working. I haven’t checked to see if something similar already exists in the list of supported cards nor whether the CODEC is supported or needs the drivers installed. It would be good to add support for this card. Can you say whether it has stereo input? It looks like it had dual microphone but to be more useful it would benefit from line level inputs.

1 Like

Hi @Gadjet !

Wellcome to our little community of crazy noize makers and congrats by your victory with this card!! As @riban as explained, it would be nice to include support for this card. I see the driver is already included in the zynthian image, probably because it’s already distributed with the mainstream kernel, so there is no need to install any driver from waveshare. Simply adding the lines to the config would be enough.

A little but important detail: It’s not a good idea to use the card number in the jackd options because when you boot your zynthian with more devices connected (i.e. your favorite MIDI controller) is very probable that the numbering changes what would break your config. You can improve your config and make it more reliable by using the sound device name. Please, run this command:

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 3: sndrpihifiberry [snd_rpi_hifiberry_dacplusadcpro], device 0: HiFiBerry DAC+ADC Pro HiFi multicodec-0 [HiFiBerry DAC+ADC Pro HiFi multicodec-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

for getting the device names. In this case, my device name is just after “card 3:” => sndrpihifiberry

And please, tell us the name so we can add it to the config system.

Also, when you have configured your alsa levels from the webconf, tell us your config so we can include some decent defaults for your card.

Thanks a lot!

2 Likes

Hi Jofemodo thanks for the welcome and all the great work.
When I switch jackd from

-P 70 -t 2000 -s -d alsa -d hw:0 -r 48000 -p 256 -n 2 -X raw

to

-P 70 -t 2000 -s -d alsa -d hw:wm8960soundcard -r 48000 -p 256 -n 2 -X raw

I get a boot error, here are the aplay - l details incase i’m using the wrong device name:

card 0: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]

Are the alsa levels the ones I configure in Alsamixer? If so i cant find the command to get the parameter displayed as text so I can send it to you? Sorry first day with Zynthian :slight_smile:

2 Likes

Hi riban thanks so much for the welcome and hard work. I don’t think a line in is possible. Unless you were to desolder the surface mounted mics…

2 Likes

Really strange. It should work exactly the same than hw:0, but avoiding the problems you could have when device order changes because you plug extra hardware to your zynthian.

wm8960soundcard

This seems the right name to use. I couldn’t say. Perhaps somebody have some idea,

You can configure the audio level controls you want in the UI from the webconf:

Hardware > Audio > Mixer Controls [...]

From there you can enabled/disabled controls you want in the UI and also adjust the levels themself:

When you have the perfect config, you can dump your ALSA mixer status with this:

aplay -c 0

Also, please, send me the list of “relevant” controls you enabled from the webconf by copying the textarea under the […].

Thanks!

1 Like