Add S/PDIF to Odroid C2

InspecteurGadget
Posts: 94
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Add S/PDIF to Odroid C2

Post by InspecteurGadget »

Hi, with this dac http://www.audiophonics.fr/fr/dac-diy/a ... 12105.html
I think it's not spdif optical but is coaxial, but I don't sure

User avatar
joerg
Posts: 2005
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 209 times
Been thanked: 456 times
Contact:

Re: Add S/PDIF to Odroid C2

Post by joerg »

There isn't any data sheet, only some pictures. I would check carefully if it really combines with the C2 before buying an expensive device. The S/PDIF input on the one picture are two solder pads. Maybe you can add an optical receiver to it, but such receivers have three pins (VCC, OUT, GND). I would not connect the pins directly to the C2 as the idea of optical or coaxial is to decouple the devices from each other. Also with coaxial you would need some parts as transformers.

InspecteurGadget
Posts: 94
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Add S/PDIF to Odroid C2

Post by InspecteurGadget »

Thanks to you :) for this explanation
I would go to an hdmi extractor

notadroid
Posts: 9
Joined: Thu May 24, 2018 12:32 pm
languages_spoken: english
ODROIDs: HC2, C2
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Add S/PDIF to Odroid C2

Post by notadroid »

This thread is a goldmine!
I followed the instructions and I have sound coming out of the A/V receiver, no problem. I'm running Kodi on Ubuntu 18.4. As noted above, there is a slight delay between the HDMI audio and the S/PDIF audio. Not sure why this is. Is it caused by PulseAudio? Anyone tried disabling it?
Also, as others mentioned, there is no way to use the S/PDIF as a passthrough on Kodi for DTS or Dolby Digital audio streams. Any ideas why this is? The passthrough option isn't even available in Kodi settings. How to make this option show up?

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Add S/PDIF to Odroid C2

Post by phaseshifter »

from what i remember which was like over 2 years ago now it ran spdif optics with just the software code installed that was with 16.04
but 18.04 i could not get it to work from mem but i did have audio at the r.c.a outputs no matter which h-k sound card i used.
.i would have to get my c-2 stuff out ...but my head is in other stuff atm...
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

best_odroidfreak
Posts: 366
Joined: Wed May 04, 2016 1:07 am
languages_spoken: english
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Add S/PDIF to Odroid C2

Post by best_odroidfreak »

Hi :D !
Would you so kind as to explain, if Odroid c2 spdif handmade output provides enough sound quality to use it with external DAC compared to I2s?

User avatar
odroid
Site Admin
Posts: 42193
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3619 times
Been thanked: 2005 times
Contact:

Re: Add S/PDIF to Odroid C2

Post by odroid »

Their output resolution and sampling rate are exactly same.
So the sound quality must be identical probably.

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Add S/PDIF to Odroid C2

Post by phaseshifter »

just hook the spdif up as the notes above..capacitor there is only an 100 ohm resistor...it`s straight forward..keep it simple dont get complex with it..
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

SimonH78
Posts: 42
Joined: Tue May 23, 2017 2:15 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Add S/PDIF to Odroid C2

Post by SimonH78 »

Hi guys ,

im using Armbian on Debian base for my odroid C2s and i also soldered the SPDIF stuff exactly like you did.

But im missing this SPDIF soundcard output, how can i achieve this ? I can see clearly the difference on LibreElec/KODI on odroid c2 and Armbian on console, armbian is lacking this SPDIF stuff.

Any help is appreciated !
regards,
Simon

User avatar
joerg
Posts: 2005
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 209 times
Been thanked: 456 times
Contact:

Re: Add S/PDIF to Odroid C2

Post by joerg »

I think there is no (on mainline kernel?). But you need to ask this in armbian forum or maybe @igorpec gives a statement here.

ds000
Posts: 5
Joined: Sun Mar 19, 2023 5:00 pm
languages_spoken: english
ODROIDs: ODROID C2 (fryed), Hifi-Shield, ODROID N2+
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Add S/PDIF to Odroid C2

Post by ds000 »

As for I was looking into that for quite a while: For getting SPDIF output to work on modern LibreELEC (e.g. 11.0.X), I had to modify the device tree file to actually enable it and make it visible in KODI (creating packages/linux/patches/default/linux-080-odroid-c2.patch):

Code: Select all

--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2-unpatched.dts	2023-11-05 01:19:49.197991036 +0100
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts	2023-11-05 01:29:18.041481346 +0100
@@ -174,6 +174,13 @@
 		};
 	};
 
+	spdif_dit: audio-codec-0 {
+		#sound-dai-cells = <0>;
+		compatible = "linux,spdif-dit";
+		status = "okay";
+		sound-name-prefix = "DIT";
+	};
+
 	sound {
 		compatible = "amlogic,gx-sound-card";
 		model = "ODROID-C2";
@@ -184,33 +191,46 @@
 		assigned-clock-rates = <294912000>,
 				       <270950400>,
 				       <393216000>;
-
 		dai-link-0 {
-			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
-		};
+                        sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+                };
 
-		dai-link-1 {
-			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
-			dai-format = "i2s";
-			mclk-fs = <256>;
-
-			codec-0 {
-				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
-			};
-		};
-
-		dai-link-2 {
-			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
-
-			codec-0 {
-				sound-dai = <&hdmi_tx>;
-			};
-		};
+                dai-link-1 {
+                        sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
+                };
+
+                dai-link-2 {
+                        sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+                        dai-format = "i2s";
+                        mclk-fs = <256>;
+
+                        codec-0 {
+                                sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+                        };
+                };
+
+                dai-link-3 {
+                        sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
+
+                        codec-0 {
+                                sound-dai = <&spdif_dit>;
+                        };
+                };
+
+                dai-link-4 {
+                        sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                        codec-0 {
+                                sound-dai = <&hdmi_tx>;
+                        };
+                };
 	};
 };
 
 &aiu {
 	status = "okay";
+	pinctrl-0 = <&spdif_out_ao_6_pins &i2s_am_clk_pins &i2s_out_ao_clk_pins &i2s_out_lr_clk_pins &i2s_out_ch01_ao_pins>;
+	pinctrl-names = "default";
 };
 
 &cec_AO {
@@ -278,8 +299,8 @@
 &gpio_ao {
 	gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
 			  "USB HUB nRESET", "USB OTG Power En",
-			  "J7 Header Pin2", "IR In", "J7 Header Pin4",
-			  "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7",
+			  "SPDIF_OUTPUT", "IR In", "I2S_MCLK",
+			  "I2S_SCLK", "I2S_LRCLK", "I2S_DATA_OUTPUT",
 			  "HDMI CEC", "SYS LED",
 			  /* GPIO_TEST_N */
 			  "";
 
That worked for me a couple of month ago (copper link to some suitable stereo amplifier), unfortunately I fried the board, thus unable to test it again.
These users thanked the author ds000 for the post:
joerg (Sun Feb 04, 2024 1:35 am)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest