How to connect I2S DAC


#1

I’m trying to connect DAC via I2S next way:
DAC <> VIM
BCK <> GPIOH_7 (pin 29)
DATA <> GPIOAO_6 (pin 33)
LRCK <> GPIOH_8 (pin 32)
GND <> GND (pin 21)
GND <> GND (pin 24)
VCC <> +5 (pin 1)

But it not works :frowning: Is wiring right?
Is i2s enabled in 6.0.1 firmware or I need extra drivers for it?


LibreELEC for Khadas VIM (SD & USB & eMMC)
Where are I2S On VIM GPIO
#2

Can you try LibreELEC on sdcard/usb? I don’t think android will support i2s dac.
Instruction of installing LibreELEC can be found in this thread:


I have a plan to use an i2s dac board too but not try it yet.


#3

Hi, delletenebre:
I have purchased a DAC board for the testing, and will update when we got the board.


#4

Hi, thank you. It doesn’t work in Libreelec. I added a line “dtparam=i2s=on” to the сonfig.txt - no changes. In System>Audio output:


both do not work.


#5

Why is there no hdmi option? Did you try delete dtb.img in sdcard/usb?
If not then delete it and try again to see if i2s dac audio output is available.
If still not working, could you please try download overlay folder in this:


Copy into /flash/
And add “dtoverlay” of the device which has the same dac chip of your board to the config.txt. Then check again.
That’s what I will do if I have an i2s board. All is just guessing.


#6

Have you got the board?


#7

Yes, just got today.

@kenny please follow this.


#8

Hi,delletenebre

The connection is incorret. You can refer to below connection

DAC <> VIM
BCK <> GPIOH_7 (pin 29)
DATA <> GPIOAO_9 (pin 31)
LRCK <> GPIOH_8 (pin 32)
GND <> GND (pin 21)
GND <> GND (pin 24)
VCC <> +5 (pin 1)

The DAC is worked after I modified the uboot source code

####Notice:This is only for Mmallow(6.0.1)

diff --git a/board/khadas/configs/kvim.h b/board/khadas/configs/kvim.h
index 2725511..4e985ab 100644
--- a/board/khadas/configs/kvim.h
+++ b/board/khadas/configs/kvim.h
@@ -72,7 +72,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
         "firstboot=0\0"\
         "upgrade_step=0\0"\
-        "jtag=apao\0"\
+        "jtag=disable\0"\
         "loadaddr=1080000\0"\


#9

Nice.
Thanks. I try it.


#10

does not work on old mmallow source, but it work on your new firmware.
Please update mmalow source.
How to activate i2s on Nougat source?
It has

    "upgrade_step=0\0"\
    "jtag=apao\0"\
    "loadaddr=1080000\0"\

#11

I have already update the mmallow source.

You need to modify two files.
###1. Modify the file ‘board/khadas/configs/kvim.h’

diff --git a/board/khadas/configs/kvim.h b/board/khadas/configs/kvim.h
index a1b00f5..3e404f1 100644
--- a/board/khadas/configs/kvim.h
+++ b/board/khadas/configs/kvim.h
@@ -85,7 +85,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
         "firstboot=0\0"\
         "upgrade_step=0\0"\
-        "jtag=apao\0"\
+        "jtag=disable\0"\
         "loadaddr=1080000\0"\
         "outputmode=1080p60hz\0" \
         "hdmimode=1080p60hz\0" \

###2. Modify the file ‘arch/arm64/boot/dts/kvim.dts’

diff --git a/arch/arm64/boot/dts/kvim.dts b/arch/arm64/boot/dts/kvim.dts
index 7b25b8d..2894869 100644
--- a/arch/arm64/boot/dts/kvim.dts
+++ b/arch/arm64/boot/dts/kvim.dts
@@ -1089,6 +1089,7 @@
                hp_disable;
                hp_paraments = <800 300 0 5 1>;
                pinctrl-names = "aml_snd_m8";
+               pinctrl-0 = <&audio_pins>;
                cpu_list = <&cpudai0 &cpudai1 &cpudai2>;
                codec_list = <&codec0 &codec1 &codec2>;
                plat_list = <&i2s_plat &i2s_plat &pcm_plat>;


#12

I have the same i2s DAC (PCM5102) as the delletenebre, and Android Nougat V170612. During download, a digital noise of full volume appears on the output, which disappears only after the first sound of the system. After that everything is working fine, until the next off/on, or restart.


#13

I think it is a bug. Did you try to flash the rom Android Marshmallow V170603.
Thanks


#14

I’ll try and let you know.


#15

I tried Android Marshmallow V170603, but the situation has not changed. During download, a digital noise of full volume appears on the output, which disappears only after the first sound of the system.


#16

Thanks for your feedback. We will check it.


#17

Hello terry! Is there any progress in solving this problem?


#18

Hi, destin:
I’m sorry to reply for you so long.
You can flash the new ROM, it fixup the bug.
Thanks


#19

@Gouwa @numbqq @terry
You can test this Board with i2s in Linux (Ubuntu) ? With the current kernel in Ubuntu (DualOS v171028) already has support for i2s or need to perform additional operations (which are described in this topic) ?


#20

Yep, ROMs after 170922 already support I2S.