📜 ⬆️ ⬇️

Media Center from MacMini and Rapsberry PI

Or the easiest and most convenient media center, understandable to all households



to attract attention

Hi, Habr! Every day it is becoming easier to assemble a media center at home. There are many options - from HTPC from old iron to nameless devices the size of a flash drive. On Habré there were many reviews of homemade noiseless HTPC, android-boxes and no-tops for the implementation of home media servers. I experienced many different options before finding the most suitable for myself and, most importantly, for the household.

Task minimum:
1. Assemble and structure the entire media library together.
2. To make it as accessible as possible on two TVs in different rooms.
3. Have the ability to view or download (for offline viewing) movies from the library on mobile devices
4. Remote launch of torrents from mobile devices
5. Silent operation of devices.
')
Through trial and error, I came to use XBMC on an old Mac-mini + Rapsberry Pi.
Samples, errors, and convenient configuration under the cut.

Why there is a desire to do a home media server, I think no need to explain. First of all, it's just convenient. And poking the flash drive between the laptop and the TV (not SmartTv) several times a day was no more strength.

Sample 1

In an attempt to get by with little blood, a piece of iron was collected.



Miracle car was assembled from the old Asus, which served faithfully for about 5 years. But time did its job, and the screen frame fell apart at the laptop, the hinges broke out and the hard drive almost stopped working. After some simple manipulations, the screen moved to the upper part of the cover, and the machine itself started working on XUbuntu, which was loaded from the flash drive, and was controlled only by the mouse.
Leaving his work 24/7 was scary, considering his love of overheating. Yes, and he worked ugly slowly.
After tormenting a couple of days, this design returned to the shelf of the closet where it had been living for the last few years.

Summarizing the experience: This HTPC can be taught to perform almost all the necessary tasks.

But: It is inconvenient, slow, unsafe, and above all noisy.

Sample 2 and 3.

A little later, a package arrived from England with Sumvision Cyclon Nano.


The device is twinned by the fact that we have already been in reviews on Habré more than once.

A small box with Android OS on board. Operated by the remote control, which was included.
The box did not work quickly, but for a device for 40 pounds is tolerable. Driving with the air-mouse was unusual. But, quite an obvious plus, her (box) was not audible.

After playing for some time with the settings, it turned out to teach her media shell to play video from an external disk, which was not as convenient as we would like. In this regard, it was decided to install the XBMC for Android just released (at that time). And, while XBMC was being downloaded, I experienced the first serious disappointment ... batteries sat in the remote. Seriously, the new batteries, which I put the clock 25-26 back. Fortunately, several more batteries were found, and the XBMC was able to run. Here I was waiting for a second disappointment. The video was played with jams. Moreover, with those that look was not possible. All attempts to change the settings and somehow defeat the problem ended in failure.

Later I tried to raise DLNA on this box and stream the video to the Xbox, but this was accompanied by constant freezes. And viewing the DLNA stream through the Xbox is not the most convenient solution. Long, difficult and inconvenient management.
Prior to setting the torrent rocking it never came. Cyclon went to the same regiment as the old Asus.

Summary:
For me personally, permanent use seemed unreal. Watching videos on YouTube or surfing the Internet is good, if not with a native remote control. But the HD video, he does not pull. DLNA keeps bad. Some minor functions can perform. It does not heat up and works quietly.

Sample 4. Successful

I started looking for a suitable no-top. After the failure with Cyclone, I didn’t want to buy “anyhow”, and the good ones were already worth serious money. Here, I confess honestly, I was lucky - one very good person, seeing my torment, gave me his old Mac-Mini (2009 release) for experiments.

It is strange that the use of these computers as media servers is almost no mention on Habré. Perhaps the reason is its excessively high price. But it seems to me that this, if not the ideal option, is worthy of attention for sure.

It works quietly and quickly. Almost not heated. It connects to the TV via HDMI via Mini DisplayPort. It is worth noting that the sound of the computer via HDMI does not transmit and it is not treated. I had to connect an additional wire to the sound.


I will tell you about the configuration in more detail. This is exactly the option that gave me and my spouse.

Loading:
Although the computer works for me 24/7, sometimes there are interruptions in electricity and you have to turn it on with your hands. When launched, it loads MacOS and loads MySQL, uTorrent, DropBox and XBMC. IP in the local network is registered static.
A minute after the button is pressed, we see the shell of the media center on the screen.

Torrents:
Background-launched uTorrent checks a special folder in DropBox, and if a torrent file appears there, it immediately starts downloading it. Thus, the problem of remotely launching torrents with movies was solved. It should be noted that this trick did not work with either Google Drive or Yandex.Disk. The problem is that applications for poppy from Google and Yandex are not synchronized automatically. And dropbox does it all at once. Although, I admit that the problem is in my crooked hands.
Series downloads automatically from RSS feeds and are divided into folders thanks to the system of filters built into uTorrent.

Media library
Files are stored in 2 folders on an external hard drive: Movies, TV shows. They share in the network through SMB. XBMC WatchDog plugin deals with updating the library. When any change (add, delete, transfer, rename files) in folders connected to XBMC, the plugin starts content scanning and cleaning.

Streaming
XBMC can distribute media via UPnP. So, any device in the home Wi-Fi network sees the UPnP server and can play it using special software. For the iPad, I decided to use the ArcMC program. Its obvious advantage is that it can download and save movies directly from the UPnP stream to the device.



Thus, we do not have to suffer with wires and transfer films through itunes before traveling. There is truth in this program and cons. It may turn off during playback. On average, this happens 1 time in 4-5 hours of viewing. Hopefully the bug will be defeated in the next update.

Second tv
In the process of a long search for a device for a second TV, studying the “whistles on the anroid”, it was decided not to get up on the rake, but to take the Raspberry Pi mod. B.
An SDCard 8 GB class 10, a case and a small Wi-Fi receiver were immediately added to it.



RPI is powered from the USB port of the TV, picture and sound via HDMI. The box nestled behind the TV.



In the role of the OS for RPI was chosen OpenElec - a stripped-down version of XBMC. What is good about it is that it is fast and supports HDMI CEC. Those. You can control the system directly from the TV remote. From it all the device settings were made.
Whatever OpenElec does not slow down, we immediately disable the useless built-in RSS-Feed in the settings. You can still overclock the RPi a bit, from the standard 700 to 800 MHz (possible and more) in config.txt:

arm_freq=800 

To work quickly enough for me. If you load the shell with plugins, it will slow down again, then you can enable Dirty Regions . In regular XBMC distributions, this option is enabled by default, but it is disabled in OpenElec. To do this in advancedesttings.xml add

 <gui> <algorithmdirtyregions>3</algorithmdirtyregions> <nofliptimeout>0</nofliptimeout> </gui> 

Synchronization
Synchronization allows you to store in a single database all movies, covers, descriptions, views and pauses. Consequently, on the second media center, we no longer need to scan sources for new films and TV shows, all the data from the home library will cling to the network. One of the most pleasant bonuses in this case is that we can achieve that by putting the film on a pause in the kitchen, we continue watching from the moment we stop in the living room.

In MySQL:
 CREATE USER 'xbmc' IDENTIFIED BY 'xbmc'; GRANT ALL ON *.* TO 'xbmc'; 

Do not forget to enable MySQL autorun. And do not forget in /etc/my.cnf to change the IP of the machine on which the database is running (by default it costs 127.0.0.1):
 bind-address = 192.168.***.*** 

In XBMC:
We supplement advancederstings on all machines.
 <videodatabase> <type>mysql</type> <host>192.168.***.***</host> <port>3306</port> <user>xbmc</user> <pass>xbmc</pass> </videodatabase> <musicdatabase> <type>mysql</type> <host>192.168.***.***</host> <port>3306</port> <user>xbmc</user> <pass>xbmc</pass> </musicdatabase> 

Now you can start scanning the library. It is worth noting that for this, even on the server computer, it is necessary to register the network address, so that the synchronization would work. Example - smb://192.168.***.***// . After the scan is finished, so as not to clog these paths again, you can simply transfer the sources.xml file to the second machine.
Mac and RPi made friends wonderfully. Initially, when watching big movies on RPi, there were hangs. Cured by replacing the router.

Control
The version with RPi is controlled by the TV remote control, but with a poppy you need another solution. Unfortunately, Apple, as in many other cases, is very important in terms of using certain technologies. And her computers do not support HDMI CEC at all. A small apple console was originally planned, but when the xbmcRemote program was installed on all phones and tablets, the need for a physical console disappeared.



The XBMC remote control is convenient and disgraceful to use. It connects to the system via an IP machine on the local network and remembers all devices.

Recently, by the way, on Habrayuzer dmitryredkin published a good article about managing HTPC

Total

Something could be made easier, something faster and more reliable. But summing up, I can say that I have achieved the task set by myself. Wife learned to use the entire system in one evening. Everything is simple and convenient to disgrace. We have been using such a system for half a year already, and during this time there were no problems.

Thank you UFO for invite!

Source: https://habr.com/ru/post/193660/


All Articles