From linux to apple tv

Потоковая передача в Apple TV (3) из Linux

Хорошо, вот настройка:

  • Один яблочный телевизор 3 в гостиной, подключенный к сети (проводной).
  • Один компьютер под управлением Linux (Arch Linux x64, AMD), содержащий всю музыку, фильмы и серию (проводной).

Теперь я знаю, что atv может транслировать музыку и файлы, используемые совместно с Windows /Mac, используя iTunes и общий доступ к дому. Ящик, содержащий файлы, работает под управлением Linux.

Я попытался настроить forked-daapd, который признан сервером всеми экземплярами iTunes в доме, но не atv. Я читал, что это связано с forked-daapd, поддерживающим DAAP, но не для совместного использования дома.

Я также пробовал несколько других DAAP-серверов для Linux:

  • mt-daapd (предшественник forked-daapd), такая же история, как и forked-daapd.
  • мандарин. Был признан iTunes, но не предлагал никаких носителей. Не уверен, видел ли это atv, но я так не думаю.
  • spydaap. Это не работало с последней версией iTunes, которая, как представляется, является известной проблемой

Я также попытался установить ужас, который называется iTunes на моем компьютере под управлением Linux, но это не удалось. Он установил, дал кучу ошибок, начал и ничего не делает. Это просто пустой экран.

Теперь я знаю, что обычно такая настройка была бы возможна путем jailbreaking atv и установки XBMC на нем. Тем не менее, atv3 еще не джейлбрейк, так что, к сожалению, это не вариант для меня.

Теперь мой вопрос: какие у меня варианты. Есть ли способы сделать atv распознанным forked-daapd, который я пропустил, или есть альтернативы forked-daapd, которые работают с atv? Есть ли способ заставить iTunes работать в моей системе? Есть ли другой способ потоковой передачи медиа на моем Linux-ПК в atv?

Источник

Archive:HOW-TO:Install Ubuntu and XBMC on Apple TV 1

THIS PAGE IS OUTDATED:

This page or section has not been updated in a long time, no longer applies, refers to features that have been replaced/removed, and/or may not be reliable.

This page is only kept for historical reasons, or in case someone wants to try updating it.

Installing Linux on the AppleTV is already quite well documented and easy thanks to atv-bootloader. If you plan on installing Linux on your AppleTV, you should definitively start there.

With Broadcom Crystal HD now out, the AppleTV can handle 1080p and this makes it a very nice media center alternative. XBMC works fine under the AppleTV OS, but there are a few pro’s for having Linux and some might just prefer it.

That said, setting up Linux can be a bit tricky. If you want sound over HDMI, you have to use at least alsa-driver-1.0.18a and NVIDIA 100.14.19 drivers that compile only on Ubuntu 8.04. Any more dissent release seems affected by a regression bug #385076 and it need to be resolved first.

This guide explains how to achieve it using Ubuntu 8.04 for now. Linux will be installed on the AppleTV internal disk without removing the AppleTV OS

I would not recommend this guide if you are not familiar with Linux and the CLI.

If you are not a fan of vi, just use nano instead.

Contents

1 Prerequisites

  • A USB Hub
  • A USB keyboard
  • A USB flash drive of 256MB or greater (64MB should even be enough)
  • A network with a DHCP server
  • A wired network connection to the AppleTV
  • A Mac or Linux computer on the same network (Windows should probably work as well)

2 Create the bootable USB flash drive

If you have a Mac, just download and run the OS X version of atvusb-creator. Choose «ATV-Bootloader» for the installation and create your bootable flash drive. When done, if you unplug/plug the USB disk, you should see an empty PATCHSTICK partition.

Download Hardy netboot image and copy the needed files to the empty PATCHSTICK partition created by ATV USB creator.

If you only have a Linux machine, just follow those instructions: LinuxUSBPenBoot. Make another partition to copy linux and initrd.gz from the netboot image.

3 Linux installation

Connect the USB keyboard and flash drive previously created to your AppleTV using a USB Hub. Reboot the AppleTV and telnet in from your computer (username/password: root). You should see the IP address on your TV screen.

3.1 Backup!

Before touching the disk partition, you should do a backup! We gonna follow the ATVBackup procedure but do a tar instead of a copy. This ensures that permissions won’t be changed, no matter the file system on your USB flash drive partition.

Run «parted» and make a copy of the original partitioning for the internal PATA disk. The disk can then be re-partitioned back to the original later using this file as a guide. Copy this to the first partition of the USB flash drive for safe keeping.

Check the file. This is how my 40GB disk looked like:

If you need to restore the disk to its original state, just follow the Restore procedure (watch the sdb partition number), but instead of doing:

3.2 Make space for Linux

I didn’t exactly follow the procedure described here (btw, it seems Apple doesn’t always follow the same naming convention). I just did a resize on my «Customer» partition and it worked fine. I didn’t have to perform a «Factory Restore» and didn’t lose anything.
But from my Linux experience, when doing a resize on a disk, you should be ready in case it doesn’t work. That means, if you have data on that partition you don’t want to lose, backup first!
Note that we did NOT backup that partition previously (only the Recovery partition was). This partition is where you might have synced, pictures, movies. If the resize doesn’t work, you’ll have to remove the partition and do a «Factory Restore». Read this page for more explanations.
You can adjust the partitions sizes to your needs.

Here is how the disk should now look like:

3.3 Start Linux installation

Bootstrap into netboot installer

You should now see the Ubuntu install screen on your TV. Proceed with the keyboard you connected earlier.

Follow the steps of the installer.
When asked for partitioning Method, choose manual
Select the ext3 partition you created previously: sdb5 (the USB stick shows up as sda, so the internal disk is sdb)
Use as : Ext3
Mount point: /
sb6 should already be selected as swap
Write the changes to disk

When asked for username, do NOT use “xbmc”, create an admin user

If you are asked to select a specific kernel, just take the default choice (generic kernel)

When you come to the “Software selection” window, choose only «OpenSSH server»

When the install is done, reboot.

3.4 Post installation fix

Telnet again to your AppleTV.

Change the USB flash drive, so that it will boot automatically to Linux next time

-> change patchstick to auto

Edit your menu.lst

Change it to something like this (check your kernel version):

Bootstrap to this new kernel (or just reboot)

3.5 Linux setup

You can now ssh to your AppleTV. Use the user you created during installation.

3.5.1 Set the MAX_CSTATE

You may experience dropped ethernet packets if you do not adjust the maximum cstate for the AppleTV’s processor. Cstates are different levels of power that the processor will operate at. The intention is to conserve energy when the system is not in use, but in Linux’s case this can cause a few issues. I have seen better and more reliable network activities after performing the following steps.

Add the following line to your /etc/modprobe.d/options file:

Then update the initrd image using the following command:

The initrd image is now updated to include the option. Then reboot. Verify if it works:

3.5.2 Install alsa-driver 1.0.19

At least 1.0.18a is needed but it failed to compile on my system. 1.0.19 worked fine.

3.5.3 Install Xserver and NVIDIA 100.14.19 drivers

Take the opportunity to edit your xorg.conf

Turn off the use of TurboCache by the nvidia binary driver by adding (see ATV blog):

Some people experienced problem with refresh rate due to NVIDIA’s DynamicTwinView feature, so disable it by adding:

Your nvidia driver section should look like:

3.5.4 Install atvclient

To get the front LED stop flashing and get the Apple Remote to work, just install atvclient See https://github.com/Evinyatar/atvclient/wiki/Installation-on-Ubuntu-8.04

3.5.5 Install crystal HD driver and library

svn trunk and git trees might be unstable. So use the last tag from http://code.google.com/p/crystalhd-for-osx/ (it contains both osx and linux source code).

3.6 Time to install XBMC

To get Official PPA and SVN PPA, update your system’s software sources:

Add the keys and update your list of software:

Create xbmc user:

Here is one way to have XBMC started automatically at boot. You could as well choose to just install xbmc-live.

Change tty1 for automatic login:

Change this line:

Update your Xwrapper.config

Replace console by anybody

Login as xbmc and create a .bash_profile

Create a .xsession:

3.7 Set up the HDMI audio output

After reboot, XBMC should start up automatically. You might have some strange colors. Just unmute the HDMI audio output by running alsamixer.

ssh to your appletv

-> unmute IEC958 1 (that’s the HDMI audio output)
Save the driver setup:

You can check the device by running:

Go to XBMC Audio output settings and choose custom for the Audio output device.
Set it to: plughw:0,3 Do the same thing for Passthrough output device.

That’s it, you should have sound over HDMI!

3.8 What next?

If you don’t want to have to plug/unplug the USB stick to boot into Linux/AppleTV OS, check: https://github.com/Evinyatar/atvclient/wiki/AppleTV-Linux-bootmenu

I don’t really like to put a password in clear text in a script. I removed the password from the script, and added the script to the sudoers file instead:

Same can be done on the AppleTV OS side

4 Faster boot

atv-bootloader boots a default Linux kernel and then finds and boots your Linux kernel using kexec. You can avoid this double boot process by creating a custom atv-bootloader. To do so you need a Mac computer with the Developer Tools installed (it should be possible under Linux with the darwin-cross tools to compile/link).

On your Mac, get the atv-bootloader source code:

Copy from your atv to that directory your ubuntu kernel (check your kernel version) and run make

You should now have a custom mach_kernel.
To use it to directly boot into your Linux installation, you just need to give the arguments that will get passed to the Linux kernel in the com.apple.Boot.plist.

  • If you use an USB flash drive to boot into Linux, replace the mach_kernel by the one you created and replace the plist by the following one:

Check the kernel arguments on the last line. They should be the same as the ones you have in your /boot/grub/menu.lst file. Note that there is no need for the «atv-boot=auto» line.

  • If you switch plist to boot into ATV OS / Linux as explained here, just replace the /mach_kernel_linux with the one you created and edit the /System/Library/CoreServices/com.apple.Boot.plist.linux file to add the kernel arguments as described above.

5 Runing Firefox

Exit XBMC and at the terminal install Firefox and Flash:

Create a script to start firefox:

Make firefox.sh executable:

Edit rc.local to restore launching xbmc at boot.

Increase font size:

Add an option DPI in the «monitor» section:

ps.: It can take up to 3min to load firefox at first time. ps2.: to return to terminal: Ctrl+Alt+backspace

6 VNC Server

Set a password (optional)

Make X to load X11vnc at startup

This guide is based on differents sources. Thanks to the original authors (sorry if I forgot some):

Источник

Потоковая передача на Apple TV (3) из Linux

Хорошо, вот установка:

  • Один яблочный телевизор 3 в гостиной, подключен к сети (проводной).
  • Один компьютер под управлением Linux (Arch Linux x64, AMD), содержащий всю музыку, фильмы и сериалы (проводные).

Теперь я знаю, что ATV может передавать потоковую музыку и другие материалы из windows / mac, используя iTunes и домашний обмен. Однако коробка с файлами работает под управлением Linux.

Я попытался настроить forked-daapd, который распознается как сервер всеми экземплярами iTunes в доме, но не atv. Я читал, что это происходит из-за разветвленного daapd, поддерживающего DAAP, но не домашнего обмена.

Я также пробовал несколько других серверов DAAP для Linux:

  • mt-daapd (предшественник forked-daapd), та же история, что и с forked-daapd.
  • мандарин. Был признан iTunes, но не предлагал никаких медиа. Не уверен, видел ли его ATV, но я так не думаю.
  • spydaap. Это не работает с последней версией iTunes, которая кажется известной проблемой

Я также попытался установить ужас, который называется iTunes, на моем компьютере под управлением Linux, но это не удалось. Он установил, выдал кучу ошибок, запускается и абсолютно ничего не делает. Это просто пустой экран.

Теперь я знаю, что обычно такая установка возможна путем джейлбрейка ATV и установки на него XBMC. Тем не менее, atv3 еще не взломан, поэтому, к сожалению, это не вариант для меня.

Теперь мой вопрос, какие варианты у меня есть. Есть ли способы заставить atv распознавать forked-daapd, который я пропустил, или есть альтернативы forked-daapd, которые работают с atv? Есть ли способ заставить iTunes работать в моей системе? Есть ли другой способ потоковой передачи мультимедиа на моем ПК с Linux на ATV?

Источник

How to Stream Favorite Movies (MP4 Files) From Linux Terminal to Your Apple TV

If you are in search of a solution to stream your downloaded movie content to an Apple TV on your home network, you may have hit a barrier that many Linux users hit, which is that Apple hasn’t made it easy to tap into their AirPlay technology.

Stream Movies to Apple TV from Linux

There is a way however, to take your .mp4 video files and stream them to your Apple TV, thanks to a few nifty Ruby programs and the libraries used by the Airplay protocol.

Assuming you are using Ubuntu (or any Ubuntu based distro) you will need to install the following dependencies required to communicate with your Apple TV device.

1. Open a terminal window and install the package “libavahi-compat-libdnssd-dev” by typing the following command.

Install Libavahi Package

2. After that installation is complete make sure you have at least Ruby 2.0 installed on your system. Inside of your terminal type the following to ensure that it is indeed installed.

You will receive an output that should look something like this:

Check Ruby Version

If 1.9.x is installed, you will want to upgrade your version of Ruby to 2.x by adding the Ruby PPA to your apt sources list. You would do so by typing the following commands in your terminal.

When prompted hit ENTER. Next run,

Add Ruby PPA Update System Install Ruby Package

3. Now that Ruby is up to date, we will need to install two “gems” that will allow us to send our video to our Apple TV. The gems we will install are airplayer and airstream.

To install we will need to run the following:

Install airplayer Package Install airstream Package

Note: This will automatically install the dependencies required to run these programs as well as the programs themselves.

4. We have the software we need to stream our video, but we need to know where on our network our Apple TV is (where to send our video). To do this we run,

This command will output something that will resemble,

Search airplay Devices

Note: Take note of that IP address (minus the ‘:7000’) portion.

5. Now go the path, where your favorite movies stored and then in a terminal window run the following command to stream the movie to your Apple TV.

Play Movies to Apple TV

6. Now check out your TV and viola! You are streaming your video to your Apple TV.

Conclusion

Now, some knowledgeable on this subject may airplayer alone is sufficient to handle playback of video on Apple TV. It has been my experience that the airstream gem does this task more reliably. I simply use the airplayer gem to discover the IP address of the Apple TV.

If you have videos that are not in mp4 format and are .mkv, .avi, .mov, they will need to be converted in order for playback to work via airstream.

Feel free to post your questions, and I hope this will be a painless process to accessing what is rightfully yours.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Читайте также:  Linux если каталог не пуст как удалить
Оцените статью