Skip to content

sonocotta/orange-pi-media-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orange Pi Media Center

Open Source Hardware Open Source Software I sell on Tindie
Dev Chat DSC_0029

Orange Pi Media Center is a series of Orange Pi One-based media center devices. They share a similar look, and compared to my earlier designs, they have a great-looking aluminum case.

Table of Contents

Motivation

I did a few audio projects in the past, some using ESP32, some using popular Raspberry Pi devices. Each has its pros and cons, and with each iteration, I'm trying to focus on the details that were working best for me, while using them myself on a daily basis.

What is special about the Orange Pi is the amount of hardware power that you get for your buck. Surely, the ecosystem is not as rich as Raspberry Pi, and the community is not so vast. But Armbian is still a Debian-based system and most of the things you'd want to run, just work!

Early prototypes

The Media center didn't appear from the thin air. A series of Hat prototypes were created before.

Orange Pi Hi-Fi Hat adds Hi-Fi audio capability to your Pi. It uses the native I2S output of Orange Pi together with Texas Instruments' fantastic PCM5100 Hi-Fi DAC.

image

Loud Orange Pi Hat uses dual MAX98357 DAC to spit out two channels of 3W music power each

DSC_0433

Finally, the early design of the Orange Pi Media Center was based on the Loud Orange Pi Hat design, but turn out too expensive to build.

DSC_0509

HiFi Orange Pi Media Center

Orange Pi HiFi is a first-in-line product that uses the legendary PCM5100 series DAC with supreme audio quality. It exposes line-level output that you can plug into a stereo amplifier. Spend as much as you need on the external amp to deliver the sound you like (personally I prefer late 80's audio gear).

DSC_0005

It is a simple yet powerful solution that adds audio capabilities to your Orange Pi-based project. Audio quality complies with Hi-Fi standards, which means it is suitable for high-quality audio streaming, just like Big Pi

Loud Orange Pi Media Center

Loud Orange Pi uses a dual MAX98357 HiFi DAC with a built-in highly efficient D-class amp to deliver 3 to 5W of music power directly to your speakers.

DSC_0008

It's capable reasonably priced, and great value for money. In terms of audio quality, there is no compromise, and that is what matters most

Power considerations

According to the manufacturer Orange Pi One requires at least 2 Amps of 5V line, and each DAC needs at least 1 Amp extra. With the total budget requirement of 5 Amps, it is not reasonable to count on a USB-C 5V power line alone. I've decided to use a USB-PD over a type-C cable. Pretty much any 9V/12V/20V PD-enabled power adapter will work, most typically phone chargers with a quick charge option. The smallest of the family is 25W models, which is plenty enough for both Orange Pi and DACs.

Tested and perfectly working models are (others may be available)

Model Image
65W USB-C Lenovo ThinkPad Laptop Charger Replacement Power Adapter image
65W 45W 20V 3.25A Type-C PD Laptop Charger image
120W Gan Type-C PD Charger image
45W Type-C PD Mobile Phone Wall Adapter image

Louder Orange Pi Media Center

(Work-In-Progress, spoiler alert)

Louder Orange Pi is a top-of-the-range model that uses a modern highly capable TAS5805M DAC and is aimed to be paired with medium-to-large speaker systems. With 25W per channel stereo output, it packs a punch and can easily enliven living quarters or dorm rooms. It is highly efficient, but much more demanding for power when cranked, therefore it uses USB-C Power Delivery to pull up to 65W from the wall power adapter.

(no picture yet)

Features

HiFi Orange Pi Media Center Loud Orange Pi Media Center Louder Orange Pi Media Center
Image DSC_0005 DSC_0008 WIP
DAC PCM5100A 32bit Stereo DAC Dual I2S DAC MAX98357 with built in D-Class amp Stereo I2S DAC TAS5805M with built in D-Class amp
Output 2.1 VRMS Line level output
-100 dB typical noise level
2x 3W (8Ω); 2x 5W (4Ω) 2x 22W (8Ω, 1% THD+N); 2x 32W (4Ω, 1% THD+N)
IR reader yes yes yes
RGB LED yes yes yes
External relay driver yes no yes
Ethernet built-in built-in built-in
Powers from 5V USB-C power adapter
Triple LP5907 3.3 V Ultra-Low-Noise LDO
25W+ USB-C PD power adapter 65W USB-C PD power adapter (25W/45W with limited power)
Mechanical dimensions (WxHxD) 88mm x 38mm x 100mm 88mm x 38mm x 100mm 88mm x 38mm x 100mm

Board Pinout

Audio

I2S CLK I2S DATA I2S WS CE (MAX98357 only)
Orange Pi One PA19 PA20 PA18 PA8

Peripheral (built-in)

WS2812 RGB LED RELAY EN IR INPUT
Orange Pi One PA7 PA2 PA9

Peripheral (optional TFT screen)

SPI CLK SPI MOSI SPI MISO TFT CS TFT DC TFT RES TFT LED
Orange Pi One PC2 PC0 PC1 PC3 PA0 PA1 PA3

Peripheral (optional rotary encoder)

A B BTN
Orange Pi One PC7 PC4 PA6

Software

Being a Debian-based Orange Pi Media Center is a vast space for experimentation. First things first, for any OS you need to configure DAC. Below instruction is based on Armbian experience, that supports the current kernel (thus already having DAC kernel modules).

DAC Configuration - HiFi Orange Pi Media Center

Create a i2s-sound.dts file somewhere in the filesystem with the following contents

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun8i-h2-plus";

 	fragment@0 { 
 		target-path = "/"; 
 		__overlay__ { 
			pcm5102a: pcm5102a {
			#sound-dai-cells = <0>;
			compatible = "ti,pcm5102a";
			pcm510x,format = "i2s";
			};
 		}; 
 	}; 

	fragment@1 {
		target = <&i2s0>;
		__overlay__ {
			status = "okay";
			pinctrl-0 = <&i2s0_pins>;
			sound-dai = <&pcm5102a>;
			pinctrl-names = "default";
		};
	};

	fragment@2 {
		target-path = "/";
		__overlay__ {
			sound_i2s {
				compatible = "simple-audio-card";
				simple-audio-card,name = "hifi-orange-pi";
				simple-audio-card,mclk-fs = <256>;
				simple-audio-card,format = "i2s";
		                status = "okay";

				simple-audio-card,cpu {
					sound-dai = <&i2s0>;
				};

				simple-audio-card,codec {
					sound-dai = <&pcm5102a>;
				};
			};
		};
	};
};

DAC Configuration - Loud Orange Pi Media Center

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun8i-h2-plus";

 	fragment@0 { 
 		target-path = "/"; 
 		__overlay__ { 
			max98357a: max98357a {
			#sound-dai-cells = <0>;
			compatible = "maxim,max98357a";
			sdmode-gpios = <&pio 0 8 0>; /* PA8, active high */
			status = "okay";
			};
 		}; 
 	};

	fragment@1 {
		target = <&i2s0>;
		__overlay__ {
			status = "okay";
			pinctrl-0 = <&i2s0_pins>;
			sound-dai = <&max98357a>;
			pinctrl-names = "default";
		};
	};

	fragment@2 {
		target-path = "/";
		__overlay__ {
			sound_i2s {
				compatible = "simple-audio-card";
				simple-audio-card,name = "loud-orange-pi";
				simple-audio-card,mclk-fs = <256>;
				simple-audio-card,format = "i2s";
		                status = "okay";

				simple-audio-card,cpu {
					sound-dai = <&i2s0>;
				};

				simple-audio-card,codec {
					sound-dai = <&max98357a>;
				};
			};
		};
	};
};

Next, run the following command

sudo armbian-add-overlay i2s-sound.dts

This will compile the device tree overlay, copy it to the /boot/user-overlays folder and add a line to the /boot/armbianEnv.txt with user_overlays=i2s-sound. After reboot you will see a new audio card available

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: hifiorangepi [hifi-orange-pi], device 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 [1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sun9ihdmi [sun9i-hdmi], device 0: SUN9I-HDMI PCM i2s-hifi-0 [SUN9I-HDMI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

You can test the audio with the following command

$ speaker-test -t wav -c 2

Automated deployment using Ansible

Ansible is an automation suite that allows you to configure systems remotely using redistributable configurations called playbooks.

This is a work in progress and the idea is to have a bare minimum OS and install the most used client services via the Ansible playbook. I will add more details, as soon as I have working samples, but planned things to add are

  • Configure DAC (pick one of HiFi, Loud, or Louder)
  • Pulseaudio server with network sink
  • Spotify Connect
  • Snapcast client (with autodiscovery)
  • Slimproto client (with autodiscovery)
  • Apple Airplay
  • UPNP sink (gmediarender)

This will allow to integrate into existing media sources with Home Assistant, LMS, or Mopidy instance, including multi-room sync.

How to use them

  • Write the downloaded Armbian image onto an SD card of your choice. Start your Orange Pi and find its IP address. The next steps will assume that the IP address of each node stays the same after reboot. You might need to configure your router to lease static IP to Orange Pi to make it stable.
  • Open media-center-via-ansible folder in vscode. In case you don't want to install vscode, you can run commands in plain terminal as well. Please use tasks.json file for reference
  • Prepare hosts file. Add your node's IP address and name. If you prefer password auth, you need to add a password here, but ssh-key auth is recommended
  • Run 0. install prerequisites task. It will install necessary tools on your laptop/PC, like Ansible client and such
  • Run 1-hifi-orange-pi.yml or 1-loud-orange-pi.yml playbook using 1. apply current playbook task depending on your hardware.
  • Run remaining playbooks the same way, pick those that you're planning to use

Manual installation steps

All of the above can be done manually, basically following instructions created before for another Orange Pi board with the same DAC.

Hardware

Please visit the hardware section for board schematics and PCB designs. Note that PCBs are shared as multi-layer PDFs as well as Gerber archives.

HiFi Orange Pi Media Center

Front Back PCB
DSC_0002_small JPG-mh DSC_0005_small JPG-mh DSC_0023_small JPG-mh

Loud Orange Pi Media Center

Front Back PCB
DSC_0002_small JPG-mh DSC_0008_small JPG-mh DSC_0020_small JPG-mh

Earlier designs

Legend Photo 1 Photo 2
Orange Pi One image image
Orange Pi PC image image
Loud Orange Pi with optional TFT screen DSC_0433 DSC_0437
Orange Pi Media Center DSC_0509 DSC_0506 DSC_0504

Demo

Loud Orange Pi Media Center audio test

Where to buy

Current designs

Legacy designs

About

Orange Pi One based media center (Hardware project)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published