I recently ran into a surprisingly tricky issue on an Orange Pi Zero 3 running DietPi: the board would boot fine, ALSA could see the audiocodec, and the analog output looked like it should work, but there was no sound from the 3.5mm jack.

The breakthrough came after comparing the DietPi setup against a working Raspios installation on the same hardware. The device tree was already fine, the codec was present, and the analog route existed. The real problem was a combination of two small but important details: the dietpi user was not in the audio group, and the mixer state on DietPi did not match the working values from Raspios.

First, I added the user to the audio group and reconnected over SSH so ALSA user-space tools could access the card properly:

sudo usermod -aG audio dietpi

Then I checked the mixer controls and aligned them with the working analog output state. The key values turned out to be:

  • digital volume = 0
  • LINEOUT volume = 31
  • LINEOUT Switch = on
  • all left/right output mixer DAC switches enabled
  • Left LINEOUT Mux = LOMixer
  • Right LINEOUT Mux = ROMixer

The two commands that mattered most were:

amixer -c 0 sset 'digital volume' 0
amixer -c 0 sset 'LINEOUT volume' 31

Yes, the digital volume setting is counterintuitive here: 0 was the working value, while the previous DietPi value of 63 produced silence in this setup.

After that, sound immediately started working through the 3.5mm output. I verified it first with a simple sine test:

speaker-test -D hw:0,0 -t sine -f 440 -c 2 -l 1

and then with a real MP3 file:

ffplay -nodisp -autoexit "/path/to/file.mp3"

Once the output was confirmed, I saved the ALSA state so it would survive reboot:

sudo alsactl store

On this system, alsa-restore.service was already enabled, so the saved mixer state was restored automatically at boot.

In the end, this was not a device tree problem, not an overlay problem, and not a missing codec problem. It was a classic Linux audio issue: permissions plus mixer state. Small details, but together they made the analog output finally work exactly as intended.