![]() |
I2S Codec on Euler bus of Pine A64+ - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: General Discussion on PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=3) +--- Thread: I2S Codec on Euler bus of Pine A64+ (/showthread.php?tid=6906) |
I2S Codec on Euler bus of Pine A64+ - RANJITT76 - 11-29-2018 I have recently purchased Pina64+ board and tested with Armbain server image based on kernel 3.10. I need to connect audio codec in the I2S pin of Euler bus. I would like to know what all changes in the dtb file or even in the kernel need to be made in order to work with my audio codec which works in master mode. Basically A64+ should work in slave mode. Any help will be highly appreciated. Regards Ranjit RE: I2S Codec on Euler bus of Pine A64+ - gkkpch - 12-01-2018 AFAIK, Armbian is using Ayufan's kernel 3.10.105, which should have the patched dts for pine64, pine64+ and sopine64. In case not, compare them with the ones in the attachment, these are the ones I used for my kernel (3.10.105-bsp-1.2+) to build Volumio pine64.dts is for pine64+ pinenoplus.dts is for pine64 pine64so.dts is for sopine64 RE: I2S Codec on Euler bus of Pine A64+ - RANJITT76 - 12-03-2018 Hi, Thanks for the reply. the dtb file used in arbmian image is sun50iw1pi-pine64-plus.dtb. and the noticeable difference is as below sound@1 { compatible = "allwinner,sunxi-daudio0-machine"; sunxi,daudio0-controller = <0x4e>; status = "disabled"; device_type = "snddaudio0"; }; I have changed the staus to "okay" and also changed the "CONFIG_SND_SOC_DAUDIO0_MACHINE=m" in the config file. With the change I could see the kernel module sunxi-snddaudio0.ko in the /lib/modules/3.10.107-pine64/kernel/sound/soc/sunxi However the module is not loaded. Then I manually tried to load by calling "insmod" which returns the following errors. De 3 11:18:00 localhost kernel: [ 982.711898] snddaudio0 sound.8: ASoC: CPU DAI (null) not registered Dec 3 11:18:00 localhost kernel: [ 982.711953] snddaudio0 sound.8: snd_soc_register_card() failed: -517 Dec 3 11:18:00 localhost kernel: [ 982.711898] snddaudio0 sound.8: ASoC: CPU DAI (null) not registered Dec 3 11:18:00 localhost kernel: [ 982.711953] snddaudio0 sound.8: snd_soc_register_card() failed: -517 Dec 3 11:18:00 localhost kernel: [ 982.711991] platform sound.8: Driver snddaudio0 requests probe deferral As I understand certain dependency driver need to be install as well. Could you please help what else need to be enabled in configure file during kernel build? the kernel version in the armbian build environment is 3.10.107 Any help will be highly apricated. Regards Ranjit RE: I2S Codec on Euler bus of Pine A64+ - gkkpch - 12-03-2018 Well, you could have a look at my config in the attachment. I enabled "ASoC Simple sound card support "and with "ASoC support for SUNXI" the following: <*> ASoC support for audiocodec <*> ASoC support for internal-i2s <*> ASoC support for audiocodec machine <*> ASoC support for daudio platform. <*> ASoC support for vircodec <*> ASoC support for daudio0 machine < > ASoC support for daudio1 machine <*> ASoC support for hdmiaudio <*> ASoC support for spdif soundcard As you see, I only selected daudio0, you don't need daudio1 RE: I2S Codec on Euler bus of Pine A64+ - RANJITT76 - 12-03-2018 I have changed the configure file as suggested to make it built-in the. Below is the snippet of config file CONFIG_SND_SOC_SUNXI_RW=y CONFIG_SND_SOC_SUNXI_AUDIO_DMA=y CONFIG_SND_SOC_SUNXI_TDM=y CONFIG_SND_SUNXI_SOC=y CONFIG_SND_SOC_INTERNAL_AUDIOCODEC=y CONFIG_SND_SOC_INTERNAL_I2S=y CONFIG_SND_SOC_AUDIO_CODEC_MACHINE=y CONFIG_SND_SOC_DAUDIO_PLATFORM=y CONFIG_SND_SOC_VIRCODEC=y CONFIG_SND_SOC_DAUDIO0_MACHINE=y # CONFIG_SND_SOC_DAUDIO1_MACHINE is not set CONFIG_SND_SUNXI_SOC_HDMIAUDIO=y However I still see the failure log Dec 4 02:22:10 localhost kernel: [ 10.453351] snddaudio0 sound.8: ASoC: CPU DAI (null) not registered Dec 4 02:22:10 localhost kernel: [ 10.453386] snddaudio0 sound.8: snd_soc_register_card() failed: -517 Dec 4 02:22:10 localhost kernel: [ 10.453390] [RANJ] sunxi_snddaudio0_dev_probe done with -517 Kindly could you please let me know kernel source code that you are using to build for PINE A64 and the build instruction. It would be great help if you let me know the procedure of your kernel build to test the I2S on Euler bus. Regards Ranjit RE: I2S Codec on Euler bus of Pine A64+ - gkkpch - 12-04-2018 (11-29-2018, 08:37 PM)RANJITT76 Wrote: I have recently purchased Pina64+ board and tested with Armbain server image based on kernel 3.10. I need to connect audio codec You have a PM RE: I2S Codec on Euler bus of Pine A64+ - dodancs - 12-30-2018 (12-04-2018, 02:21 AM)gkkpch Wrote:(11-29-2018, 08:37 PM)RANJITT76 Wrote: I have recently purchased Pina64+ board and tested with Armbain server image based on kernel 3.10. I need to connect audio codec Could you please write an explanation here on how to get the external I2S bus working for audio DAC? It would definitely help me and some other users! Thank you! RE: I2S Codec on Euler bus of Pine A64+ - ramstadt - 01-14-2019 Ok, I figured this out on my own and share what I know. I'm including my diff for the DTS file. The key issues are that you need enable daudio and daudio0. You need to disable uart2 because it conflicts with the I2S MCK pin. You need to change your kernel configuration to enable the DAUDIO and DAUDIO0 sound driver. I enabled them as modules. You also need to enable the rudimentary sound drivers for sunxi. If you build as modules, you will need to insert the daudio module before the daudio0 module. Doing these things, I was able to see the I2S signals toggling correctly on my logic analyzer when I play a wav file using aplay. The aplay device name can be found using aplay -L Hope this helps everybody. This enables the I2S on the Pine64 with the Pine64 as a master. It also doesn't do anything to communicate with your CODEC through its control port. That is my next step as I'm using a CS4270 where the CS4270 is the clock master. So, I need the I2C functioning and I need to change the DTS to make the Pine a clock slave. diff --git a/arch/arm64/boot/dts/sun50iw1p1-pine64-plus.dts b/arch/arm64/boot/dts/sun50iw1p1-pine64-plus.dts index 0675b205..f1db8bc4 100644 --- a/arch/arm64/boot/dts/sun50iw1p1-pine64-plus.dts +++ b/arch/arm64/boot/dts/sun50iw1p1-pine64-plus.dts @@ -1737,7 +1737,7 @@ pinctrl-1 = <0x20>; uart2_port = <0x2>; uart2_type = <0x4>; - status = "okay"; + status = "disabled"; pinctrl-0 = <0xa4>; }; @@ -1956,7 +1956,7 @@ frametype = <0x0>; tdm_config = <0x1>; tdm_num = <0x0>; - status = "disabled"; + status = "okay"; linux,phandle = <0x4e>; phandle = <0x4e>; device_type = "daudio0"; @@ -1981,7 +1981,7 @@ frametype = <0x0>; tdm_config = <0x1>; tdm_num = <0x1>; - status = "disabled"; + status = "okay"; linux,phandle = <0x4f>; phandle = <0x4f>; device_type = "daudio1"; @@ -2026,14 +2026,14 @@ sound@1 { compatible = "allwinner,sunxi-daudio0-machine"; sunxi,daudio0-controller = <0x4e>; - status = "disabled"; + status = "okay"; device_type = "snddaudio0"; }; sound@2 { compatible = "allwinner,sunxi-daudio1-machine"; sunxi,daudio1-controller = <0x4f>; - status = "disabled"; + status = "okay"; device_type = "snddaudio1"; }; RE: I2S Codec on Euler bus of Pine A64+ - ramstadt - 01-17-2019 I've made a few changes to make it possible to specify the CODEC from the device tree assuming that the CODEC doesn't need anything more than what the sunxi provides, you can use different codecs without having to change the driver. I'll bundle up my patches this weekend and make them available. I'm doing kernel development outside of Armbian, but I'm modifying the Armbian kernel. The only thing that I haven't figured out yet is the gpio-reset in the cs4270 node. I'm using a different method in the device tree to set that gpio high. BTW, after doing these changes, I can't say that I'm a big fan of the device tree implementation. The concept is good, but the consistency of format and documentation are very poor. |