choss38 Posted October 11, 2017 Posted October 11, 2017 Hi, I'm not able to make my DAC to work on my Banana Pro. It's PCM 5102 DAC and it worked on my previous Armbian Wheezy My config: uname -a Linux bananapipro 4.11.6-sunxi #6 SMP Fri Jun 23 19:56:18 CEST 2017 armv7l GNU/Linux The DAC doesn't appear: aplay -l **** List of PLAYBACK Hardware Devices **** card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 I looked in armbian-config tool but there is nothing to activate overlays I looked in folder /boot/dtb/overlays but saw nothing about I2S I would like to do as I did before, I edited the fex file but I can't find it. I can't mount the first partition to access /boot because I can see only one partition on my SD card ! fdisk -l Disk /dev/mmcblk0: 7,4 GiB, 7969177600 bytes, 15564800 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x01841151 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 15253503 15251456 7,3G 83 Linux Maybe there are some new tricks last years I didn't read but I don't find anything about in the forum or on the web. Someone can help me ?
zador.blood.stained Posted October 11, 2017 Posted October 11, 2017 Mainline kernel (4.x) requires overlays to activate I2S and connected codec, FEX file is irrelevant there. No I2S overlays are currently provided in /boot/dtb/overlays because every codec will require a unique overlay, so a proper overlay has to be made and activated manually.
choss38 Posted October 14, 2017 Author Posted October 14, 2017 Thank you for answer ! But how to made and activate manually an overlay ? I found this on A10/A20 here: https://docs.armbian.com/Hardware_Allwinner-A20/ Quote Legacy System images with legacy kernel Kernel 3.4.x with large hardware support, headers and some firmware included Enabled audio devices: analog, 8 channel HDMI, spdif and I2S (if wired and enabled in HW configuration) What does it mean ? Is it an other way ? How to enabled I2S in HW configuration ?
zador.blood.stained Posted October 14, 2017 Posted October 14, 2017 Again, kernel 3.4.x is configured with the fex file. Kernel 4.x is configured with the Device Tree. For the 4.x kernel a DT overlay can be created using this as a template: https://github.com/codekipper/linux-sunxi/commit/a2142b12269970daa1e3895a413a7e19230f9530
choss38 Posted October 14, 2017 Author Posted October 14, 2017 Ok, thank you. I maybe too a newbie for this work ! I'm going to try with this: /dts-v1/; #include "sun7i-a20.dtsi" #include "sunxi-common-regulators.dtsi" #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/irq.h> / { compatible = "allwinner,sun7i-a20"; pcm5102: pcm510x { compatible = "ti,pcm5102a"; pcm510x,format = "i2s"; #sound-dai-cells = <0>; }; sound_i2s { compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,mclk-fs = <256>; simple-audio-card,cpu { sound-dai = <&i2s0>; }; simple-audio-card,codec { sound-dai = <&pcm5102>; }; }; }; &i2s0 { pinctrl-names = "default"; pinctrl-0 = <&i2s0_bclk>, <&i2s0_lrclk>, <&i2s0_sdo0>; status = "okay"; }; Do I need all the fifth first lines ? And I don't see how I can configure the good GPIO's pin ? for example, pin 35 = LRCK, pin 36 = BCLK, pin 40 = DATA (sdo0 ?) It's a big problem for me: I don't really understand all the code I wrote, I'm afraid to burn my GPIO or other component on my board.
choss38 Posted October 19, 2017 Author Posted October 19, 2017 Fisrt, I tried this: /dts-v1/; /plugin/; / { compatible = "allwinner,sun7i-a20"; fragment@0 { target = <&i2s0>; __overlay__ { pcm5102a: pcm510x { compatible = "ti,pcm5102a"; pcm510x,format = "i2s"; #sound-dai-cells = <0>; }; }; }; fragment@1 { target-path= "/"; __overlay__ { sound_i2s { compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; simple-audio-card,mclk-fs = <256>; simple-audio-card,cpu { sound-dai = <&i2s0>; }; simple-audio-card,codec { sound-dai = <&pcm5102a>; }; }; }; }; }; but no trace in the system after reboot: sudo aplay -L null Discard all samples (playback) or generate zero samples (capture) default:CARD=sun4icodec sun4i-codec, Default Audio Device sysdefault:CARD=sun4icodec sun4i-codec, Default Audio Device dmix:CARD=sun4icodec,DEV=0 sun4i-codec, Direct sample mixing device dsnoop:CARD=sun4icodec,DEV=0 sun4i-codec, Direct sample snooping device hw:CARD=sun4icodec,DEV=0 sun4i-codec, Direct hardware device without any conversions plughw:CARD=sun4icodec,DEV=0 sun4i-codec, Hardware device with all software conversions cat /proc/asound/cards 0 [sun4icodec ]: sun4i-codec - sun4i-codec sun4i-codec and of course no sound sudo speaker-test -c 2 -f 440 -t sine speaker-test 1.0.28 Playback device is default Stream parameters are 48000Hz, S16_LE, 2 channels Sine wave rate is 440,0000Hz Rate set to 48000Hz (requested 48000Hz) Buffer size range from 128 to 131072 Period size range from 64 to 16384 Using max buffer size 131072 Periods = 4 was set period_size = 16384 was set buffer_size = 131072 0 - Front Left 1 - Front Right Time per period = 2,837370 0 - Front Left I Tried to adapt also an HifiBerry DAC for Raspberry pi dts: // Definitions for HiFiBerry DAC /dts-v1/; /plugin/; / { compatible = "allwinner,sun7i-a20"; fragment@0 { target = <&sound>; __overlay__ { compatible = "hifiberry,hifiberry-dac"; i2s-controller = <&i2s>; status = "okay"; }; }; fragment@1 { target = <&i2s>; __overlay__ { status = "okay"; }; }; fragment@2 { target-path = "/"; __overlay__ { pcm5102a-codec { #sound-dai-cells = <0>; compatible = "ti,pcm5102a"; status = "okay"; }; }; }; }; sudo armbian-add-overlay hifiberry-dac.dts Compiling the overlay Copying the compiled overlay file to /boot/overlay-user/ Nothing more. Nada. sudo aplay -L [sudo] password for pi: null Discard all samples (playback) or generate zero samples (capture) default:CARD=sun4icodec sun4i-codec, Default Audio Device sysdefault:CARD=sun4icodec sun4i-codec, Default Audio Device dmix:CARD=sun4icodec,DEV=0 sun4i-codec, Direct sample mixing device dsnoop:CARD=sun4icodec,DEV=0 sun4i-codec, Direct sample snooping device hw:CARD=sun4icodec,DEV=0 sun4i-codec, Direct hardware device without any conversions plughw:CARD=sun4icodec,DEV=0 sun4i-codec, Hardware device with all software conversions cat /proc/asound/cards 0 [sun4icodec ]: sun4i-codec - sun4i-codec sun4i-codec It's too complicated for me ! Am I in a wrong way ? Please ! I need help !!
Recommended Posts