How to connect I2S DAC

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>;

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.

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

I’ll try and let you know.

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.

Thanks for your feedback. We will check it.

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

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

@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) ?

Yep, ROMs after 170922 already support I2S.

1 Like

Can someone help me to connect this PCM5102 to Vim1? A pins little different from topicstarter’s one… pcm5102

SCK --> PIN29 / I2S_SCK
DIN --> PIN31 / I2S_SDO
LCK --> PIN32 / I2S_LCK

GND --> PIN28 / GND
VIN --> PIN27 / VCC3.3V

Enjoy!

3 Likes

Thanks Gouwa! At first it didn’t worked but I’ve also connected BCK to pin 30.

SCK --> PIN29 / I2S_SCK

BCK --> PIN30

DIN --> PIN31 / I2S_SDO

LCK --> PIN32 / I2S_LCK

GND --> PIN28 / GND

VIN --> PIN27 / VCC3.3V

2 Likes

I think need to connect SCK to 30pin and BCK to 29pin .

can someone help me. I have a vim 2g/8g with libreelec 8.2.3.1 in mmc, but there is no chance to get the i2s signal. The connection is BCK <> GPIOH_7 (pin 29), DATA <> GPIOAO_9 (pin 31),LRCK <> GPIOH_8 (pin 32), gnd is pin 28. With the vim2 it works, but here no chance.
What can i do ? Thanks

So if we have a i2C dac we can hook it up on the vim2 and it will work?

YES! this one proper connection for i2s DAC

SIGNAL PIN PIN SIGNAL DAC
5V 1 21 GND
5V 2 22 I2C_M3_SCL
USB_DM 3 23 I2C_M3_SDA
USB_DP 4 24 GND
GND 5 25 I2C_AO_SCK
VCC_MCU 6 26 I2C_AO_SDA
MCU_NRST 7 27 3.3V
MCU_SWIM 8 28 GND -> GND
GND 9 29 I2SB_SCLK -> BCK
ADC_CH0 10 30 I2S_MCLK0
1.8V 11 31 I2SB_SDO -> DATA
ADC_CH3 12 32 I2SB_LRCK -> LRCK
SPDIF_OUT 13 33 I2SB_SDI
GND 14 34 GND
UARTC_RX 15 35 PWM_F
UARTC_TX 16 36 RTC_CLK
GND 17 37 GPIOH_4
Linux_RX 18 38 MCU_PA1
Linux_TX 19 39 GPIODZ_15
3.3V 20 40 GND
2 Likes

To make this DAC work in ubuntu/linux, did you have to modify any config file or it just works by just connecting the board and it appears in sound output options?

@Yasir_Javed after connecting the DAC, you might need to specify the audio sink to I2S, but I think it should work automatically

1 Like

Hello,
Just to point out that in my case I had to invert bck and sck (compared to @Gouwa message) to make it work in my pcm5102
so I connected
SCK → PIN30
BCK → PIN29
DIN → PIN31 / I2S_SDO
LCK → PIN32 / I2S_LCK
GND → PIN28 / GND
VIN → PIN27 / VCC3.3V

Putting SCK on a ground pin also works (it will use internal clock)