Help debugging ES8316 I2C access errors (ASoC -6) during playback on RK3588S2

shin5vs

New Member
Joined
Jun 7, 2026
Messages
7
Reaction score
4
Credits
80
Hi everyone,

I've been doing a deep dive into an audio issue on my Khadas Edge2 (RK3588S2) board and could really use some fresh eyes from the community. I'm stuck on an ES8316 codec problem, and after extensive testing, I've ruled out simple user-space routing or configuration mistakes.

Despite consulting AI tools, searching multiple forums, and reaching out to Khadas support, the issue remains entirely unresolved.

Here is a breakdown of my environment and what I've found so far.

The Environment:

  • Board: Khadas Edge2 / RK3588S2.
  • Codec: ES8316 on I2C bus 3, address 0x10.
  • Kernel: 6.1.118 (vendor BSP 1.7.5). (OS: Ubuntu 24.04 Server)
  • Active DTB: /boot/dtb-6.1.118/rockchip/rk3588s-khadas-edge2.dtb.
The Problem:The sound card registers perfectly, and the rockchip,es8316-codec device can be selected and opened from user space without any issues. However, as soon as actual playback starts, the codec register access fails. The kernel log gets flooded with ASoC ... -6 errors during the playback bring-up sequence.

The failure always follows a very specific register pattern:

  • It fails early at 0x0b, 0x0a, 0x09.
  • Then it fails at 0x04 through 0x07, followed by 0x01 and 0x0d.
  • Finally, it fails on the analog/output-side registers like 0x18, 0x19, 0x1a, 0x2f, 0x15, 0x17, 0x30.
  • This sequence strongly matches an initialization and power-up phase, not a late teardown issue.
What I've Checked & Tested:

  • Direct ALSA vs. PipeWire: The issue reproduces with both direct ALSA (aplay) and PipeWire (tested safely with a 50% volume cap). Curiously, aplay returns a success code (RC=0), meaning the user-space stream starts fine, but the control path fails underneath during runtime programming.
  • Hardware Isolation: I completely replaced the I/O board with a new one and ran safe-volume playback tests, but the exact same failure remained. This points to an issue on the main board side or the control path.
  • Clocks are Alive: Checking the clocks during the playback window shows that the I2S clocks and the MCLK (12.288 MHz) are actively running. The Live DT already uses this explicit 12.288 MHz MCLK assignment, which was the fix for a known upstream Rock5B issue, so it doesn't seem to be a dead I2S clock tree.
  • The Regmap Clue: The device shows up as UU on i2cdetect -y 3, so it's on the bus. However, looking at /sys/kernel/debug/regmap/3-0010/registers reveals that many registers show up as XX (unreadable) even when the system is completely idle.
My Current Theories:

  1. Vendor Driver Divergence: I noticed es8316_enable_spk.isra.0 in /proc/kallsyms. This function is not in the plain upstream Linux 6.1 driver, which means Khadas is likely using a vendor-diverged driver to handle speaker-enable/jack-detect logic. If this custom GPIO sequence is wrong, it could easily make the codec inaccessible during runtime transitions.
  2. Hardware Control Line Issue: Because the regmap shows unreadable registers even while idle, the reset line or codec-side state machine might be physically unstable on the main board.
Questions for the Community:

  1. Has anyone encountered this specific runtime -6 failure pattern on the ES8316 (especially on RK3588 boards) when the MCLK is confirmed to be running fine?
  2. Regarding the regmap showing XX while idle: could an aggressive, misconfigured DAPM profile be cutting internal codec power to cause this, or does this almost certainly point to a physical reset/voltage line issue?
  3. What would be the cleanest way to temporarily isolate or stub out that vendor spk-con-gpio logic from the driver or DTB? I'd like to test if bypassing the speaker-enable transition stops the I2C failures.
Any insights, debugging tips, or patch suggestions would be hugely appreciated!

Thanks in advance for your time.


Note: This post was written and summarized with AI assistance (Gemini 3.1 Pro model). I was in a hurry, sorry for that.
 
Last edited:


Here is a breakdown of my environment and what I've found so far.
Hello if you used AI to write your post can you please also state that in your OP, as it's mentioned by one of the rules you agreed to when signing up here.
AI-generated posts and replies MUST be clearly disclosed. If AI tools (ChatGPT, Claude, etc.) were used to write any portion of your post, include a note such as 'AI-assisted' or 'Generated with AI' in your message.
 
Perhaps if AI is worth using to write the post, it is also worth using to solve the problem ?
 
Perhaps if AI is worth using to write the post, it is also worth using to solve the problem ?
Thank you for your kindness. Obviously, I tried using AI to solve it, and I also browsed numerous forums and even contacted Khadas support, none of which have solved the issue yet. If mocking my use of an AI summary to save time makes you feel better, by all means, keep going haha. It says far more about you than about my workflow.
 
Btw is the board you are talking about a Single Board Computer, as I've never heard of it?
 
Btw is the board you are talking about a Single Board Computer, as I've never heard of it?
Yes, it is a Single Board Computer (arm64), specifically a Khadas Edge2 as I mentioned earlier. It's similar to a Raspberry Pi but it has more advanced SoC and also an onboard NPU.
 
Hi everyone,
The Environment:
  • Board: Khadas Edge2 / RK3588S2.
  • Codec: ES8316 on I2C bus 3, address 0x10.
  • Kernel: 6.1.118 (vendor BSP 1.7.5). (OS: Ubuntu 24.04 Server)
  • Active DTB: /boot/dtb-6.1.118/rockchip/rk3588s-khadas-edge2.dtb.
Note: This post was written and summarized with AI assistance (Gemini 3.1 Pro model). I was in a hurry, sorry for that.
Without any experience or useful knowledge about the SBC, I did notice that the kernel is relatively old. For example, on a machine here running the 7.0.10 kernel, there exists a considerable number of ES8316 drivers and configs. One expects that they would be more up to date than those in the 6.1.118 kernel mentioned which may be of some help. Can't say though. Here's some output on that later kernel:
Code:
[~]$ locate -i 8316
/usr/lib/firmware/intel/sof-tplg/sof-byt-es8316-ssp0.tplg
/usr/lib/firmware/intel/sof-tplg/sof-byt-es8316.tplg
/usr/lib/firmware/intel/sof-tplg/sof-cht-es8316.tplg
/usr/lib/modules/7.0.10+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.10+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.4+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.4+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.7+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.7+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.9+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.9+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/share/alsa/ucm2/Intel/bytcht-es8316
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi-Components.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi-LongName.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/bytcht-es8316.conf
/usr/share/alsa/ucm2/Rockchip/es8316
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316
/usr/share/alsa/ucm2/Rockchip/es8316/HiFi.conf
/usr/share/alsa/ucm2/Rockchip/es8316/es8316.conf
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316/HiFi.conf
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316/rk3588-es8316.conf
/usr/share/alsa/ucm2/codecs/es8316
/usr/share/alsa/ucm2/codecs/es8316/EnableSeq.conf
/usr/share/alsa/ucm2/codecs/es8316/HeadPhones.conf
/usr/share/alsa/ucm2/codecs/es8316/IN1-HeadsetMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN1-InternalMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN2-HeadsetMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN2-InternalMic.conf
/usr/share/alsa/ucm2/codecs/es8316/MonoSpeaker.conf
/usr/share/alsa/ucm2/codecs/es8316/Speaker.conf
/usr/share/alsa/ucm2/conf.d/bytcht-es8316
/usr/share/alsa/ucm2/conf.d/rk3588-es8316
/usr/share/alsa/ucm2/conf.d/rockchip_es8316
/usr/share/alsa/ucm2/conf.d/bytcht-es8316/bytcht-es8316.conf
/usr/share/alsa/ucm2/conf.d/rk3588-es8316/rk3588-es8316.conf
/usr/share/alsa/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf
/usr/share/alsa/ucm2/conf.d/simple-card/rockchip,es8316-codec.conf
/usr/src/linux-headers-7.0.10+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.10+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.4+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.4+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.7+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.7+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.9+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.9+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
 
Yes, it is a Single Board Computer (arm64), specifically a Khadas Edge2 as I mentioned earlier. It's similar to a Raspberry Pi but it has more advanced SoC and also an onboard NPU.
I've moved your topic to the Single board computers section.
 
Without any experience or useful knowledge about the SBC, I did notice that the kernel is relatively old. For example, on a machine here running the 7.0.10 kernel, there exists a considerable number of ES8316 drivers and configs. One expects that they would be more up to date than those in the 6.1.118 kernel mentioned which may be of some help. Can't say though. Here's some output on that later kernel:
Code:
[~]$ locate -i 8316
/usr/lib/firmware/intel/sof-tplg/sof-byt-es8316-ssp0.tplg
/usr/lib/firmware/intel/sof-tplg/sof-byt-es8316.tplg
/usr/lib/firmware/intel/sof-tplg/sof-cht-es8316.tplg
/usr/lib/modules/7.0.10+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.10+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.4+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.4+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.7+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.7+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/lib/modules/7.0.9+deb14-amd64/kernel/sound/soc/codecs/snd-soc-es8316.ko.xz
/usr/lib/modules/7.0.9+deb14-amd64/kernel/sound/soc/intel/boards/snd-soc-sst-byt-cht-es8316.ko.xz
/usr/share/alsa/ucm2/Intel/bytcht-es8316
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi-Components.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi-LongName.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/HiFi.conf
/usr/share/alsa/ucm2/Intel/bytcht-es8316/bytcht-es8316.conf
/usr/share/alsa/ucm2/Rockchip/es8316
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316
/usr/share/alsa/ucm2/Rockchip/es8316/HiFi.conf
/usr/share/alsa/ucm2/Rockchip/es8316/es8316.conf
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316/HiFi.conf
/usr/share/alsa/ucm2/Rockchip/rk3588-es8316/rk3588-es8316.conf
/usr/share/alsa/ucm2/codecs/es8316
/usr/share/alsa/ucm2/codecs/es8316/EnableSeq.conf
/usr/share/alsa/ucm2/codecs/es8316/HeadPhones.conf
/usr/share/alsa/ucm2/codecs/es8316/IN1-HeadsetMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN1-InternalMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN2-HeadsetMic.conf
/usr/share/alsa/ucm2/codecs/es8316/IN2-InternalMic.conf
/usr/share/alsa/ucm2/codecs/es8316/MonoSpeaker.conf
/usr/share/alsa/ucm2/codecs/es8316/Speaker.conf
/usr/share/alsa/ucm2/conf.d/bytcht-es8316
/usr/share/alsa/ucm2/conf.d/rk3588-es8316
/usr/share/alsa/ucm2/conf.d/rockchip_es8316
/usr/share/alsa/ucm2/conf.d/bytcht-es8316/bytcht-es8316.conf
/usr/share/alsa/ucm2/conf.d/rk3588-es8316/rk3588-es8316.conf
/usr/share/alsa/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf
/usr/share/alsa/ucm2/conf.d/simple-card/rockchip,es8316-codec.conf
/usr/src/linux-headers-7.0.10+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.10+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.4+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.4+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.7+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.7+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
/usr/src/linux-headers-7.0.9+deb14-amd64/include/config/SND_SOC_ES8316
/usr/src/linux-headers-7.0.9+deb14-amd64/include/config/SND_SOC_INTEL_BYT_CHT_ES8316_MACH
Thank you for your answer! I will look into a newer kernel version but on Rockchip the BSP-vendor version should be more relevant in theory.
 
Thank you for your kindness. Obviously, I tried using AI to solve it, and I also browsed numerous forums and even contacted Khadas support, none of which have solved the issue yet. If mocking my use of an AI summary to save time makes you feel better, by all means, keep going haha. It says far more about you than about my workflow.
Does it work in Windows?
 


Follow Linux.org

Members online


Top