There is only a single overlay device that enables I2S output as a master device. The overlay uses the PCM512a codec but if you require any other codec, you would have to make a new overlay file with the said codec, and add the additional kernel modules it requires, if its not already in the kernel image.
Once the DAC is up and working, you would have to add it list over on the Volumio2 repo so that is shows up as a selectable DAC, which would let you load the overlay file “on the fly”…
I’ve found the overlay and the codec and I’m now trying to compile the module for the OPI PC.
The apt sources list does not seem to be set up to match the actual kernel installed on the build provided (kernel 5.3 or 5.10 but apt showing headers for 3.x or 4.9).
I’ve tried to manually dpkg the headers and sources for the correct kernel but it won’t work (compilation just exit stating that sources for kernel modules are not found) : do you have any clue on how to retreive the correct needed kernel sources ?
Yep, it’s most probably showing the default Debian Jessie package (3.16.0-10). But as this platform is added using the Armbian build system, you could leverage the scripts in platform-orangepi to pull out the linux-headers package.
That being said, since we don’t know the exact version from the image, and armbian’s repo don’t have the resources to track all but the current versions, the fastest way would be to build it yourself.
Else, when I find some time I can build a new image (but it will be 5.10.y/Buster beta) with the header package as well.
I will be using a “generic copy” of the Audiophonics board based on es9038q2m DAC.
I’m now completely struggling with the dts file and structure with yours as the baseline : I actually do not understand how to merge your file (embedding both i2s definition and simple-sound-card) and the one made for RPI (which does not include i2s / i2c definitions). (the dts from rpi is also available in the repository above).
have a look at this, I’ve been using simple-soundcard
I also tried the same structure with tfa9879, it works but only in mono configuration with one device (simple-card seems to not support stereo with two devices)
Looks like you aren’t targetting the right i2c block – overlay files are bit of arcane dark magic for me as well but I believe you are missing setting the right i2c target.
Try something along these lines…
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun8i-h3";
// make life a bit easier..
fragment@0 {
target-path = "/aliases";
__overlay__ {
i2c0 = "/soc/i2c@1c2ac00";
i2c1 = "/soc/i2c@1c2b000";
i2c2 = "/soc/i2c@1c2b400";
};
};
fragment@1 {
// Enable i2c0 -- adjust this for the right i2c block
// This will be on (SCL, SDA): PA11, PA12
target = <&i2c0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
sabre: i-sabre-codec@48 {
#sound-dai-cells = <0>;
compatible = "audiophonics,i-sabre-codec";
reg = <0x48>;
status = "okay";
};
};
};
fragment@1 {
target = <&i2s0>;
__overlay__ {
status = "okay";
pinctrl-0 = <&i2s0_pins>;
sound-dai = <&sabre>;
pinctrl-names = "default";
};
};
fragment@2 {
target-path = "/";
__overlay__ {
sound_i2s {
compatible = "simple-audio-card";
simple-audio-card,name = "es9038q2m";
simple-audio-card,format = "i2s";
status = "okay";
simple-audio-card,cpu {
sound-dai = <&i2s0>;
};
simple-audio-card,codec {
sound-dai = <&sabre>;
};
};
};
};
};
How exactly are you connecting this DAC to the OpiPC?
The pinout isn’t the same, so it might need some consideration tweaking right? Are you sure your hooking up the pins correctly? Even without the kernel modules, you should be able to run i2cdetect to check if the DAC is up on the Bus?
Heads up, I added the linux-headers package into GitHub - ashthespy/platform-orangepi so from the next time it should be less of a headache to fetch them.
Yes of course, I was using PA18-PA21 on the OPI side and pins 12, 35, 38 and 40 of the 40 pins connector of the DAC (compatible with rpi GPIOs 18-21) +5V and GND.