CM5 and Rock 5C Headphone jack no audio via ES8316

Running the official Debian CLI image on Rock 5B, I am unable to get the audio working on the 3.5mm headphone jack.

$ uname -a
Linux rock-5b 5.10.110-15-rockchip #a2d3d7e5d SMP Mon Sep 4 11:55:03 UTC 2023 aarch64 GNU/Linux

aplay -l shows;

**** List of PLAYBACK Hardware Devices ****
card 0: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 i2s-hifi-0 [rockchip-hdmi1 i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: rockchiphdmi2 [rockchip-hdmi2], device 0: rockchip-hdmi2 spdif-hifi-0 [rockchip-hdmi2 spdif-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: rockchipes8316 [rockchip-es8316], device 0: dailink-multicodecs es8316.7-0011-0 [dailink-multicodecs es8316.7-0011-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

However running the following command works successfully but produces no audio.

speaker-test -Dhw:3,0 -c2 -t wav -w /usr/share/sounds/alsa/Front_Center.wav

Is there something extra needed in setup to get audio working via the headphone jack?

Turns of it was the cheap pair of headphones not full pushed in the 3.5mm jack on the Rock 5B.

However when testing the same on CM5 (with IO Carrier board) and Rock 5C I get the following error.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: rockchiphdmi0 [rockchip-hdmi0], device 0: rockchip-hdmi0 i2s-hifi-0 [rockchip-hdmi0 i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchipes8316 [rockchip-es8316], device 0: dailink-multicodecs es8316.8-0011-0 [dailink-multicodecs es8316.8-0011-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 spdif-hifi-0 [rockchip-hdmi1 spdif-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ speaker-test -Dhw:1,0 -c2 -t wav -w /usr/share/sounds/alsa/Front_Center.wav

speaker-test 1.2.4

Playback device is hw:1,0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 65536
Using max buffer size 131072
Periods = 4
was set period_size = 32768
was set buffer_size = 131072
 0 - Front Left
 1 - Front Right
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
^CTransfer failed: Input/output error

Some further debugging, the -5 Input/output error is occuring when speaker-test is trying to write to the es8316 PCM device at line

The Overlay for the es8316 sound device setup looks ok

On the CM5 with IO carrier we have some progress.

Using the official Debian Bullseye image here, sound does not work and has the above -5 Input/output error.

Using Joshua’s Ubuntu 22.04 image here sound works once you activate Left/Right Headphone Mixer Right DAC in alsamixer.

Using Radxa’s Debian Bookworm image here sound works with no problems.

I suspect the issue with the Bullseye image is the Overlay for i2c8 where the clocks are initialized differently.

Versus it working in Bookworm here.

@Alvin Looks like for the Rock 5C this was fixed a few hours ago on 6.1 image.

3 Likes

Hi,
The clk config of es8316 needs to be modified to work properly,you can modify it by referring to the commit mentioned by 3djelly.