ES8316 Audio Speaker output

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu image from OOWOW

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official Images

Please describe your issue below:

I have the IO Module installed and I can get audio via the ES8316 chip on the headphone port, but I can’t get any audio out on the speakers. Looking at the schematic, there is an active-high enable pin on the amplifier chips, and when I pull up that line, the audio starts playing on the speakers. It seems that is tied to I2S_SDO1 pin. How do I enable the speaker output?

Ok, I’m still having this issue. It seems to default the HDMI output, but no matter how many times I switch to the output codec, there is no audio on the speakers. It seems like the GPIO pin to enable the output amplifiers is not turned on.

Ok, one more data point. The external speakers are active only when there is something plugged into the headphone jack on the IO board, and only when the board has booted. There is no change when the system has already booted.

Hello @mechmyday

Which image you used?

For latest Ubuntu 22.04 image, if you want to use the speaker then you need to unplug the headphone.

Please check here:

https://docs.khadas.com/products/sbc/edge2/applications/es8316

Ubuntu 22.04.2, Kernel 5.10.66

For the speakers to work, a headphone has to be plugged in at boot. It will playback on both the speakers and the headphone output.

If there is no headphone plugged in at boot, the speakers do not work. The headphones will work, but there is no output from the speakers.

Was digging through some of the code here

Do the speakers get enabled on boot at all? Seems like on line #614 it’s maybe only happening during jack detection? Forgive me, I’m not a great C programmer.

Hello @mechmyday

@ivan.li will check on and get back to you.

1 Like

@mechmyday

  • HDMI has a higher priority, so when you connect an external speaker and HDMI at the same time. The default is HDMI output.

  • When you want to use an external horn, you don’t have to worry about it. You can fix it with the flick of a finger.

instructions

Settings–>Sound–>Output–>Output Device–>Audio Codec

@ivan.li While that works with the headphone output, there is still no output from the speakers when the headphone jack is unplugged.

Please double check with you speaker, we checked on our side and it works when headphone unpluged.

I’ve checked everything I can think of. The amplifier chips simply aren’t in an enabled state. When I enable them by pulling the EN (pin1) on the chip, I hear sound output to the speaker.

Is there a GPIO pin assigned to that output? Appears to be I2S0_SDO1

@mechmyday

Because my side is normal,If the external horn is all right,Now you need to rule out a software problem. Try the following firmware !

http://dl.khadas.com/products/edge2/firmware/ubuntu/emmc/edge2-ubuntu-22.04-server-linux-5.10-fenix-1.4-221229-emmc.img.xz

Good luck!!!

Is that any different from what I’m running currently?

`Welcome to Fenix 1.4 Ubuntu 22.04.2 LTS Linux 5.10.66  
 _  ___               _             _____    _            ____  
| |/ / |__   __ _  __| | __ _ ___  | ____|__| | __ _  ___|___ \ 
| ' /| '_ \ / _` |/ _` |/ _` / __| |  _| / _` |/ _` |/ _ \ __) |
| . \| | | | (_| | (_| | (_| \__ \ | |__| (_| | (_| |  __// __/ 
|_|\_\_| |_|\__,_|\__,_|\__,_|___/ |_____\__,_|\__, |\___|_____|
                                               |___/            

 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

khadas@Khadas:~$ cat /etc/fenix-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=Edge2
VENDOR=Rockchip
VERSION=1.4
ARCH=arm64
INITRD_ARCH=arm64
IMAGE_VERSION=1.4-221229
################ GIT VERSION ################
UBOOT_GIT_VERSION=khadas-edges-u-boot-2017.09-v1.4-release
LINUX_GIT_VERSION=khadas-edges-linux-5.10-v1.4-release
FENIX_GIT_VERSION=v1.4
#############################################
khadas@Khadas:~$ 
`

Yes, it is, if you haven’t attache the headphone the speaker will be enabled by default.

You want to play from both headphone and speaker? Current image you can choose headphone or speaker only, can’t play from both.

Please double check with the steps below to play audio from the speaker:

  • Remove the headphone
  • Attach your speaker
  • Power on the board
  • Use the commands below to play a wav file
$ aplay -Dhw:3,0 test002.wav 

No, I think you’re misunderstanding me. I have followed those steps and here is the behavior I see.

  • Removed headphones
  • Attached speakers
  • Powered on the board
  • Played a wav file via the commands.
  • There is NO output on the speakers
  • Plugin headphones
  • Can hear sound on headphones
  • Unplug Headphones
  • Still no sound on speakers

Here is another situation where I can get speaker output.

  • Plugin Speakers
  • Plugin Headphones
  • Power up board
  • Play WAV file
  • Sound plays on BOTH the Headphones and the Speakers
  • Remove headphones
  • Sound continues to play on speakers.
  • Plug headphones in
  • Sounds stops on speakers and plays on headphones. This is the normal behavior.

Could there be something wrong with the IO board?

Hello @mechmyday

Can you try to follow the steps below to upgrade the kernel?

cd /tmp
wget https://dl.khadas.com/.test/edge2/20230320/linux-dtb-rockchip-5.10_1.4.2_arm64.deb
wget https://dl.khadas.com/.test/edge2/20230320/linux-image-rockchip-5.10_1.4.2_arm64.deb
sudo dpkg -i linux-dtb-rockchip-5.10_1.4.2_arm64.deb linux-image-rockchip-5.10_1.4.2_arm64.deb
sync
sudo reboot

After reboot, please check again.

1 Like

Nice! The speaker output is now working as expected. Thanks @numbqq!

1 Like

@numbqq THANK YOU!!! This solved my HDMI output problem!! I now have audio out of my monitor again!!! Woo Hoo!!!