Volumio 2 on Orange Pi Boards

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”…

Thanks for the explanation !

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.

Ok, I basically did that (manually playing with apt source list from armbian to install the correct headers for 5.10.13 kernel).

I’m now in the process of updating the audio codec to 5.x asoc compatible calls (was made for 4.19).

Great job! :slight_smile: What codec is it might I ask?

It should be rather straightforward if you follow the compiler, also look at History for sound/soc/codecs/rk3308_codec.c - ashthespy/linux-rockchip · GitHub for some hacky inspiration :wink:

Ok, finally done with the porting (not so much in the end) : it compiles, sources are here : GitHub - arpel/I-Sabre_9038Q2M: New Audiophonics I-sabre 9038Q2M driver

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)

I tried something : I-Sabre_9038Q2M/i-sabre-q2m-overlay-opi.dts at master · arpel/I-Sabre_9038Q2M · GitHub

I got stuck at boot … sorry that’s my first dts :wink:

Looks like you aren’t targetting the right i2c block – overlay files are bit of arcane dark magic for me as well :smiley: 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>;
				};
			};
		};
	};
};

Thanks a lot for you help !

I tried updating according to your directions : Trying things (still not working) · arpel/I-Sabre_9038Q2M@a477896 · GitHub
It boots but generates a lot of i2c errors.

Actually i’m pretty sure that the DAC is i2s only, I changed only the 1st line of fragment1 and … boot stuck.

Still digging … !

Hi, the codec uses it, so you need both i2s and i2c.
Have a look at this, perhaps it helps: debian_kernel/es90x8q2m-dac-overlay.dts at 8bb796b3eff3bc0fcc89406f9f83fd9a224b7526 · TinkerBoard/debian_kernel · GitHub
This is how I implemented it for the tinkerboard kernel, it is not using sound_simple_card but that should not make a difference.

Well, I tried several things and even if no boot issue, I did not succeed in getting the DAC detected (ie kernel modules loaded).

I finally plugged it to a rpi4 with “baseline” volumio and it worked straight away (either as a RPI-DAC or a Hifiberry).

I’ll maybe try again in a few days (for the sake of not letting it go).

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.

Ok I’m just replying to myself : I might have only connected the i2s interface and no i2c (for detection and configuration … ) … will try again :wink:

Look at this pinout:

That’s what I did for the i2s part (ie PA18-PA20 + PA21 even if not used)

Nice work!

Could you give more detailed info for GPIO pins for SSD1306 (128x64 pixel) display? I wold like to know about pins for SCK and SDA diaplays contacts.

If I uderstud right, we need get installation from GitHub - dhrone/pydPiper: A general purpose program to display song metadata on LCD and OLED devices?
After that I need change install.sh from OrangePI-Volumio-pydPiper/install.sh at main · radiomanoff/OrangePI-Volumio-pydPiper · GitHub and which file I need make display configuration for SSD1306 (128x64 pixel) display?
Thank you very much!

gpio readall shows
 +------+-----+----------+------+---+OrangePiH3+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | GPIO |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 |      |     |     3.3V |      |   |  1 || 2  |   |      | 5V       |     |      |
 |   12 |   0 |    SDA.0 | ALT2 | 0 |  3 || 4  |   |      | 5V       |     |      |
 |   11 |   1 |    SCL.0 | ALT2 | 0 |  5 || 6  |   |      | GND      |     |      |
 |    6 |   2 |      PA6 |  OFF | 0 |  7 || 8  | 0 | OFF  | TXD.3    | 3   | 13   |
 |      |     |      GND |      |   |  9 || 10 | 0 | OFF  | RXD.3    | 4   | 14   |
 |    1 |   5 |    RXD.2 |  OFF | 0 | 11 || 12 | 0 | OFF  | PD14     | 6   | 110  |
 |    0 |   7 |    TXD.2 |  OFF | 0 | 13 || 14 |   |      | GND      |     |      |
 |    3 |   8 |    CTS.2 |  OFF | 0 | 15 || 16 | 0 | OFF  | PC04     | 9   | 68   |
 |      |     |     3.3V |      |   | 17 || 18 | 0 | OFF  | PC07     | 10  | 71   |
 |   64 |  11 |   MOSI.0 |  OFF | 0 | 19 || 20 |   |      | GND      |     |      |
 |   65 |  12 |   MISO.0 |  OFF | 0 | 21 || 22 | 0 | OFF  | RTS.2    | 13  | 2    |
 |   66 |  14 |   SCLK.0 |  OFF | 0 | 23 || 24 | 0 | OFF  | CE.0     | 15  | 67   |
 |      |     |      GND |      |   | 25 || 26 | 0 | ALT2 | PA21     | 16  | 21   |
 |   19 |  17 |    SDA.1 | ALT2 | 0 | 27 || 28 | 0 | ALT2 | SCL.1    | 18  | 18   |
 |    7 |  19 |     PA07 |  OFF | 0 | 29 || 30 |   |      | GND      |     |      |
 |    8 |  20 |     PA08 |  OFF | 0 | 31 || 32 | 0 | OFF  | RTS.1    | 21  | 200  |
 |    9 |  22 |     PA09 |  OFF | 0 | 33 || 34 |   |      | GND      |     |      |
 |   10 |  23 |     PA10 |  OFF | 0 | 35 || 36 | 0 | OFF  | CTS.1    | 24  | 201  |
 |   20 |  25 |     PA20 | ALT2 | 0 | 37 || 38 | 0 | OFF  | TXD.1    | 26  | 198  |
 |      |     |      GND |      |   | 39 || 40 | 0 | OFF  | RXD.1    | 27  | 199  |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | GPIO |
 +------+-----+----------+------+---+OrangePiH3+---+------+----------+-----+------+

GND —>6 (Physical)
VDD —>1
SCK —>5
SDA —>3

@kovus Later, I can write the full instructions for installing pydpiper on the Orange PI, if there are specific questions.

2 Likes