Skip to contentSkip to conversation

arm64: dts: rockchip: add analog audio nodes on rk3399-rockpro64

PATCH In review Katsuhiro Suzuki 4 participants 14 messages Sep 7, 2019 – Nov 15, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: add analog audio nodes on rk3399-rockpro64

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -0
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
 		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
 	};
 
+	sound {
+		compatible = "audio-graph-card";
+		label = "rockchip,rk3399";
+		dais = <&i2s1_p0>;
+	};
+
 	vcc12v_dcin: vcc12v-dcin {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
 	i2c-scl-rising-time-ns = <300>;
 	i2c-scl-falling-time-ns = <15>;
 	status = "okay";
+
+	es8316: codec@11 {
+		compatible = "everest,es8316";
+		reg = <0x11>;
+		clocks = <&cru SCLK_I2S_8CH_OUT>;
+		clock-names = "mclk";
+		#sound-dai-cells = <0>;
+
+		port {
+			es8316_p0_0: endpoint {
+				remote-endpoint = <&i2s1_p0_0>;
+			};
+		};
+	};
 };
 
 &i2c3 {
@@ -505,6 +525,14 @@
 	rockchip,playback-channels = <2>;
 	rockchip,capture-channels = <2>;
 	status = "okay";
+
+	i2s1_p0: port {
+		i2s1_p0_0: endpoint {
+			dai-format = "i2s";
+			mclk-fs = <256>;
+			remote-endpoint = <&es8316_p0_0>;
+		};
+	};
 };
 
 &i2s2 {
Signature · 1 line
2.23.0.rc1
#1 lore raw

Past about 1 month, so I send a ping...

Quoted 62 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -0
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
  		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
  	};
 
+	sound {
+		compatible = "audio-graph-card";
+		label = "rockchip,rk3399";
+		dais = <&i2s1_p0>;
+	};
+
  	vcc12v_dcin: vcc12v-dcin {
  		compatible = "regulator-fixed";
  		regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
  	i2c-scl-rising-time-ns = <300>;
  	i2c-scl-falling-time-ns = <15>;
  	status = "okay";
+
+	es8316: codec@11 {
+		compatible = "everest,es8316";
+		reg = <0x11>;
+		clocks = <&cru SCLK_I2S_8CH_OUT>;
+		clock-names = "mclk";
+		#sound-dai-cells = <0>;
+
+		port {
+			es8316_p0_0: endpoint {
+				remote-endpoint = <&i2s1_p0_0>;
+			};
+		};
+	};
  };
 
  &i2c3 {
@@ -505,6 +525,14 @@
  	rockchip,playback-channels = <2>;
  	rockchip,capture-channels = <2>;
  	status = "okay";
+
+	i2s1_p0: port {
+		i2s1_p0_0: endpoint {
+			dai-format = "i2s";
+			mclk-fs = <256>;
+			remote-endpoint = <&es8316_p0_0>;
+		};
+	};
  };
 
  &i2s2 {
maintainer
#2 lore raw

Hi Katsuhiro,

Am Freitag, 4. Oktober 2019, 19:26:00 CEST schrieb Katsuhiro Suzuki:

Quoted 7 lines

Past about 1 month, so I send a ping...

Quoted 4 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

thanks for the reminder, applied for 5.5

Heiko

#3 lore raw
In reply to Katsuhiro Suzuki
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Any idea what can be wrong?

Regards,
Vasily

Quoted 66 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
        };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
        vcc12v_dcin: vcc12v-dcin {
                compatible = "regulator-fixed";
                regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
        i2c-scl-rising-time-ns = <300>;
        i2c-scl-falling-time-ns = <15>;
        status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
 };
 
 &i2c3 {
@@ -505,6 +525,14 @@
        rockchip,playback-channels = <2>;
        rockchip,capture-channels = <2>;
        status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
 };
 
 &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

Hello Vasily,

Thank you for reporting.

Quoted 8 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

Quoted 9 lines

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
         };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
         vcc12v_dcin: vcc12v-dcin {
                 compatible = "regulator-fixed";
                 regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
         i2c-scl-rising-time-ns = <300>;
         i2c-scl-falling-time-ns = <15>;
         status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
  };
 
  &i2c3 {
@@ -505,6 +525,14 @@
         rockchip,playback-channels = <2>;
         rockchip,capture-channels = <2>;
         status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
  };
 
  &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
         };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
         vcc12v_dcin: vcc12v-dcin {
                 compatible = "regulator-fixed";
                 regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
         i2c-scl-rising-time-ns = <300>;
         i2c-scl-falling-time-ns = <15>;
         status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
  };
 
  &i2c3 {
@@ -505,6 +525,14 @@
         rockchip,playback-channels = <2>;
         rockchip,capture-channels = <2>;
         status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
  };
 
  &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
         };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
         vcc12v_dcin: vcc12v-dcin {
                 compatible = "regulator-fixed";
                 regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
         i2c-scl-rising-time-ns = <300>;
         i2c-scl-falling-time-ns = <15>;
         status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
  };
 
  &i2c3 {
@@ -505,6 +525,14 @@
         rockchip,playback-channels = <2>;
         rockchip,capture-channels = <2>;
         status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
  };
 
  &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#7 lore raw

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Best Regards,
Katsuhiro Suzuki

Quoted 187 lines
Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
   .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
   1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                  reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
          };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
          vcc12v_dcin: vcc12v-dcin {
                  compatible = "regulator-fixed";
                  regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
          i2c-scl-rising-time-ns = <300>;
          i2c-scl-falling-time-ns = <15>;
          status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
   };
 
   &i2c3 {
@@ -505,6 +525,14 @@
          rockchip,playback-channels = <2>;
          rockchip,capture-channels = <2>;
          status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
   };
 
   &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#8 lore raw
Quoted 47 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Quoted 3 lines

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Quoted 192 lines

Best Regards,
Katsuhiro Suzuki

Quoted 187 lines
Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
   .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
   1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                  reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
          };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
          vcc12v_dcin: vcc12v-dcin {
                  compatible = "regulator-fixed";
                  regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
          i2c-scl-rising-time-ns = <300>;
          i2c-scl-falling-time-ns = <15>;
          status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
   };
 
   &i2c3 {
@@ -505,6 +525,14 @@
          rockchip,playback-channels = <2>;
          rockchip,capture-channels = <2>;
          status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
   };
 
   &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#9 lore raw
Quoted 50 lines · Vasily Khoruzhick
Quoted 47 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Quoted 7 lines
Quoted 3 lines

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Another datapoint is that my board is 2.0. If yours is 2.1 it can be a difference between 2.0 and 2.1.

Quoted 192 lines
Quoted 192 lines

Best Regards,
Katsuhiro Suzuki

Quoted 187 lines
Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
   .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
   1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                  reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
          };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
          vcc12v_dcin: vcc12v-dcin {
                  compatible = "regulator-fixed";
                  regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
          i2c-scl-rising-time-ns = <300>;
          i2c-scl-falling-time-ns = <15>;
          status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
   };
 
   &i2c3 {
@@ -505,6 +525,14 @@
          rockchip,playback-channels = <2>;
          rockchip,capture-channels = <2>;
          status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
   };
 
   &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#10 lore raw
Quoted 55 lines · Vasily Khoruzhick
Quoted 54 lines · Vasily Khoruzhick
Quoted 50 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Quoted 7 lines
Quoted 3 lines

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Another datapoint is that my board is 2.0. If yours is 2.1 it can be a difference between 2.0 and 2.1.

I'm using v2.1 board.

I'll share the checking result. It's a little strange.

1) Voltage of CE pin of ES8316

It is 1.8V when booting linux-next kernel.

2) My board

I can't find no crack nor broken parts on my board.

2) R225, R226

As you know, RockPro64 board has no silk print so we cannot know perfectly which resistance is R226. So this is my assumption.

PCIe, SD card slot
(top)
LAN (left)ES8316(right) USB, reset button

On the left space of ES8316 there is no resistance, only a pattern. This is maybe R225. And 10K resistance on the right side of a pattern. I assume this is R226.

If my assumption is correctly, board implementation and schematics are different.

schematics of v2.1 gets something wrong...??

Quoted 193 lines
Quoted 192 lines
Quoted 192 lines

Best Regards,
Katsuhiro Suzuki

Quoted 187 lines
Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
    .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
    1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                   reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
           };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
           vcc12v_dcin: vcc12v-dcin {
                   compatible = "regulator-fixed";
                   regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
           i2c-scl-rising-time-ns = <300>;
           i2c-scl-falling-time-ns = <15>;
           status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
    };
 
    &i2c3 {
@@ -505,6 +525,14 @@
           rockchip,playback-channels = <2>;
           rockchip,capture-channels = <2>;
           status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
    };
 
    &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#11 lore raw
Quoted 89 lines · Katsuhiro Suzuki
Quoted 55 lines · Vasily Khoruzhick
Quoted 54 lines · Vasily Khoruzhick
Quoted 50 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Quoted 7 lines
Quoted 3 lines

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Another datapoint is that my board is 2.0. If yours is 2.1 it can be a difference between 2.0 and 2.1.

I'm using v2.1 board.

I'll share the checking result. It's a little strange.

1) Voltage of CE pin of ES8316

It is 1.8V when booting linux-next kernel.

2) My board

I can't find no crack nor broken parts on my board.

2) R225, R226

As you know, RockPro64 board has no silk print so we cannot know perfectly which resistance is R226. So this is my assumption.

PCIe, SD card slot
(top)
LAN (left)ES8316(right) USB, reset button

Quoted 8 lines

On the left space of ES8316 there is no resistance, only a pattern. This is maybe R225. And 10K resistance on the right side of a pattern. I assume this is R226.

If my assumption is correctly, board implementation and schematics are different.

schematics of v2.1 gets something wrong...??

Guess we need few more RockPro64 v2.1 owners to confirm that it's indeed the case.

Quoted 195 lines
Quoted 194 lines
Quoted 193 lines
Quoted 193 lines

Best Regards,
Katsuhiro Suzuki

Quoted 187 lines
Quoted 186 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 75 lines

Best Regards,
Katsuhiro Suzuki

Quoted 70 lines

Regards,
Vasily

Quoted 66 lines
---
    .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
    1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                   reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
           };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
           vcc12v_dcin: vcc12v-dcin {
                   compatible = "regulator-fixed";
                   regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
           i2c-scl-rising-time-ns = <300>;
           i2c-scl-falling-time-ns = <15>;
           status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
    };
 
    &i2c3 {
@@ -505,6 +525,14 @@
           rockchip,playback-channels = <2>;
           rockchip,capture-channels = <2>;
           status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
    };
 
    &i2s2 {
--

2.23.0.rc1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#12 lore raw
Quoted 98 lines · Vasily Khoruzhick
Quoted 93 lines · Katsuhiro Suzuki
Quoted 55 lines · Vasily Khoruzhick
Quoted 54 lines · Vasily Khoruzhick
Quoted 50 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Quoted 7 lines
Quoted 3 lines

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Another datapoint is that my board is 2.0. If yours is 2.1 it can be a difference between 2.0 and 2.1.

I'm using v2.1 board.

I'll share the checking result. It's a little strange.

1) Voltage of CE pin of ES8316

It is 1.8V when booting linux-next kernel.

2) My board

I can't find no crack nor broken parts on my board.

2) R225, R226

As you know, RockPro64 board has no silk print so we cannot know perfectly which resistance is R226. So this is my assumption.

PCIe, SD card slot
(top)
LAN (left)ES8316(right) USB, reset button

On the left space of ES8316 there is no resistance, only a pattern. This is maybe R225. And 10K resistance on the right side of a pattern. I assume this is R226.

Quoted 7 lines
Quoted 4 lines

If my assumption is correctly, board implementation and schematics are different.

schematics of v2.1 gets something wrong...??

Guess we need few more RockPro64 v2.1 owners to confirm that it's indeed the case.

I also have a RockPro64 board v2.1, and my ES8316 codec is at address 0x11. I'm using a kernel with Katsuhiro's patch and I can use alsamixer and play sounds out of the analog jack. My i2cdetect output:

root@kodi64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- —

Regards,
Hugh

Quoted 201 lines
Quoted 186 lines
Quoted 186 lines
Quoted 186 lines
Quoted 186 lines

Best Regards,
Katsuhiro Suzuki

Quoted 180 lines
Quoted 180 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 69 lines

Best Regards,
Katsuhiro Suzuki

Quoted 65 lines

Regards,
Vasily

Quoted 62 lines
---
   .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
   1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                  reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
          };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
          vcc12v_dcin: vcc12v-dcin {
                  compatible = "regulator-fixed";
                  regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
          i2c-scl-rising-time-ns = <300>;
          i2c-scl-falling-time-ns = <15>;
          status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
   };
 
   &i2c3 {
@@ -505,6 +525,14 @@
          rockchip,playback-channels = <2>;
          rockchip,capture-channels = <2>;
          status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
   };
 
   &i2s2 {
--

2.23.0.rc1

Quoted 10 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#13 lore raw

Hello,

Quoted 110 lines · Hugh Cole-Baker
Quoted 98 lines · Vasily Khoruzhick
Quoted 93 lines · Katsuhiro Suzuki
Quoted 55 lines · Vasily Khoruzhick
Quoted 54 lines · Vasily Khoruzhick
Quoted 50 lines · Katsuhiro Suzuki

Hello Vasily,

Thank you for valuable information.

Quoted 11 lines · Vasily Khoruzhick
Quoted 9 lines · Vasily Khoruzhick
Quoted 2 lines · Katsuhiro Suzuki

Hello Vasily,

Hi Katsuhiro,

Thanks for response!

Quoted 8 lines

Looks like on my board codec sits at address 0x10, and according to schematics that's what its address is supposed to be.

See http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf

Codec address is selected by pin CE of ES8316, and on rockpro64 it goes to GND through R226. So address should be 0x10.

Yes, I agree. The schematics both v2.0 and v2.1 say that ES8316 address is 0x10. Thank you for pointing.

But I wonder that my RockPro64 behavior is strange, he is in address 0x11. (R226 on my board is broken...??)

root@rockpro64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I plan to check R226 resistance value to judge R226 is broken or not after return to home. And share the result with you. Please give me a time.

Quoted 7 lines
Quoted 3 lines

Thanks for confirming that on your board it's on address 0x11. I checked with some other rockpro64 owners and they have it on 0x10, but looks like we have boards with codec on different address in the wild.

Another datapoint is that my board is 2.0. If yours is 2.1 it can be a difference between 2.0 and 2.1.

I'm using v2.1 board.

I'll share the checking result. It's a little strange.

1) Voltage of CE pin of ES8316

It is 1.8V when booting linux-next kernel.

2) My board

I can't find no crack nor broken parts on my board.

2) R225, R226

As you know, RockPro64 board has no silk print so we cannot know perfectly which resistance is R226. So this is my assumption.

PCIe, SD card slot
(top)
LAN (left)ES8316(right) USB, reset button

On the left space of ES8316 there is no resistance, only a pattern. This is maybe R225. And 10K resistance on the right side of a pattern. I assume this is R226.

Quoted 7 lines
Quoted 4 lines

If my assumption is correctly, board implementation and schematics are different.

schematics of v2.1 gets something wrong...??

Guess we need few more RockPro64 v2.1 owners to confirm that it's indeed the case.

I also have a RockPro64 board v2.1, and my ES8316 codec is at address 0x11. I'm using a kernel with Katsuhiro's patch and I can use alsamixer and play sounds out of the analog jack. My i2cdetect output:

Quoted 14 lines
root@kodi64:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n]
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- —

Thank you for great report. Hmm, it seems v2.0 and v2.1 are different, so we need to split device-tree for es8316 support...

Best Regards,
Katsuhiro Suzuki

Quoted 208 lines

Regards,
Hugh

Quoted 201 lines
Quoted 186 lines
Quoted 186 lines
Quoted 186 lines
Quoted 186 lines

Best Regards,
Katsuhiro Suzuki

Quoted 180 lines
Quoted 180 lines
Quoted 18 lines

Thank you for reporting.

Quoted 15 lines · Vasily Khoruzhick
Quoted 3 lines · Katsuhiro Suzuki

This patch adds audio codec (Everest ES8316) and I2S audio nodes for RK3399 RockPro64.

Hi Katsuhiro,

I tested your patch with my rockpro64 on 5.4-rc6 which has your other patches to es8316 driver, but apparently it doesn't work.

'alsamixer' complains 'cannot load mixer controls: No such device or address' and if I try to play audio with mpg123 it pretends that it plays something but there's no sound.

Quoted 7 lines
Quoted 2 lines

Any idea what can be wrong?

Do you use defconfig? If so I guess we need turn on more configs:

- simple-graph-card driver (CONFIG_SND_AUDIO_GRAPH_CARD)
- ES8316 (SND_SOC_ES8316)

I have these enabled, card is present in /proc/asound/cards, but alsamixer doesn't work with it.

Quoted 4 lines

FYI) ASoC related status or logs in my environment as follows:

root@rockpro64:~# uname -a
Linux rockpro64 5.4.0-rc6-next-20191108 #169 SMP PREEMPT Mon Nov 11 12:21:44 JST 2019 aarch64 GNU/Linux

I'm running 5.4.0-rc6 (commit 00aff6836241ae5654895dcea10e6d4fc5878ca6) with your patch "arm64: dts:
rockchip: add analog audio nodes on rk3399-rockpro64" on top of it.

Quoted 5 lines
root@rockpro64:~# dmesg | grep -i asoc
[   21.509903] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
[   21.510550] asoc-simple-card hdmi-sound: ASoC: no DMI vendor name!
[   21.567906] asoc-audio-graph-card sound: ES8316 HiFi <-> ff890000.i2s mapping ok
[   21.568565] asoc-audio-graph-card sound: ASoC: no DMI vendor name!

Similar here:

[vasilykh@rockpro64 ~]$ dmesg | grep -i asoc

[   15.627685] asoc-audio-graph-card sound: ES8316 HiFi <->
ff890000.i2s mapping ok
[   16.250196] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok
Quoted 3 lines
root@rockpro64:~# cat /proc/asound/pcm
00-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback 1
01-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1

Same here:

[vasilykh@rockpro64 ~]$ cat /proc/asound/pcm
00-00: ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : ff890000.i2s-ES8316 HiFi ES8316 HiFi-0 : playback 1 : capture 1
01-00: ff8a0000.i2s-i2s-hifi i2s-hifi-0 : ff8a0000.i2s-i2s-hifi i2s-hifi-0 : playback

Quoted 11 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/components
hdmi-audio-codec.3.auto
ff8a0000.i2s
ff8a0000.i2s
ff890000.i2s
ff890000.i2s
ff880000.i2s
ff880000.i2s
es8316.1-0011
snd-soc-dummy
snd-soc-dummy

Same here.

Quoted 7 lines
root@rockpro64:~# cat /sys/kernel/debug/asoc/dais
i2s-hifi
ff8a0000.i2s
ff890000.i2s
ff880000.i2s
ES8316 HiFi
snd-soc-dummy-dai

Same here.

Yet alsamixer doesn't work for me. It terminates with 'cannot load mixer controls: No such device or address'. Strace shows that fails here:

openat(AT_FDCWD, "/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
ioctl(3, SNDRV_CTL_IOCTL_PVERSION, 0xfffffd3ad04c) = 0
fcntl(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_LIST, 0xfffffd3ad228) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_INFO, 0xfffffd3ace38) = 0 ioctl(3, SNDRV_CTL_IOCTL_ELEM_READ, 0xfffffd3ac160) = -1 ENXIO (No such device or address)

Looks like it fails to talk to the codec?

mpg123 thinks that it's playing audio, but my headphones connected to 3.5mm output are silent.

Regards,
Vasily

Quoted 69 lines

Best Regards,
Katsuhiro Suzuki

Quoted 65 lines

Regards,
Vasily

Quoted 62 lines
---
    .../boot/dts/rockchip/rk3399-rockpro64.dts    | 28 +++++++++++++++++++
    1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 0401d4ec1f45..8b1e6382b140 100644
@@ -81,6 +81,12 @@
                   reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
           };
 
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
           vcc12v_dcin: vcc12v-dcin {
                   compatible = "regulator-fixed";
                   regulator-name = "vcc12v_dcin";
@@ -470,6 +476,20 @@
           i2c-scl-rising-time-ns = <300>;
           i2c-scl-falling-time-ns = <15>;
           status = "okay";
+
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
+               };
+       };
    };
 
    &i2c3 {
@@ -505,6 +525,14 @@
           rockchip,playback-channels = <2>;
           rockchip,capture-channels = <2>;
           status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
    };
 
    &i2s2 {
--

2.23.0.rc1

Quoted 10 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip