• 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 41
AirPlay target support integrated into XBMC natively?
Cryptos Wrote:You're missing tornado, just go here http://www.tornadoweb.org/

Download the tar and copy the contents over to the appletv and run the setup.py.

Anyone come up with a nice way of launching xbmc and airplayer together on the appletv so I don't have to run a seperate console?

On ubuntu I just chmod +x the python airplayer.py script and have a launcher with...

"sh -c 'xbmc & sleep 10; /home/ubuntu/Downloads/XBMC-Airplayer/airplayer.py'"

So that xbmc launchers and is quickly followed with the airplay script so everything seems all nice and automated but I haven't come up with anything for the ATV.

Thanks for that. At least I got it connecting and running (sort of)...

Everytime I attempt to play a video, I get the following.

POST /reverse
POST /scrub?position=7.416744
2010-12-27 21:19:21,128 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
WARNING:root:404 POST /authorize (192.168.1.109) 0.00ms
GET /scrub
2010-12-27 21:19:21,145 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
GET /scrub
2010-12-27 21:19:21,170 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
POST /play
POST /rate?value=1.000000
2010-12-27 21:19:37,586 DEBUG Setting start position succeeded
DEBUG:airplayer:Setting start position succeeded

and then a bunch more of these:

GET /scrub
______________________

I swear I'm not as dumb as I come across (or maybe I am and I'm in denial). Either way, any help will be greatly appreciated.

Thanks!
Cryptos Wrote:So that xbmc launchers and is quickly followed with the airplay script so everything seems all nice and automated but I haven't come up with anything for the ATV.

In regards to aTV i was thinking of adding it to autoexec.py something like this:
PHP Code:
import time
import os
time
.sleep(10)
print 
"starting airplayer"
os.system('python [path]/Airplayer/airplayer.py >> [path]/startup.txt &'

but yet to have it working.. not sure if its a permission error or ...?
asked for some help here.. http://forum.xbmc.org/showthread.php?tid=88789

It runs autoexec, prints "starting airplayer" in the xbmc.log but no airplayer running..
Current setup:
Amlogic M3/MX + Linux + BOXiK Skin + Pioneer vsx520 + Dali Lektor 6

Previous setup:
Revo 3700 + flirc + OpenElec nightlies + Quartz + Pioneer vsx520 + Dali Lektor 6
atv1 + Crystalbuntu + XBMC nightly + xperience1080
Cryptos Wrote:You're missing tornado, just go here http://www.tornadoweb.org/

Download the tar and copy the contents over to the appletv and run the setup.py.

Anyone come up with a nice way of launching xbmc and airplayer together on the appletv so I don't have to run a seperate console?

On ubuntu I just chmod +x the python airplayer.py script and have a launcher with...

"sh -c 'xbmc & sleep 10; /home/ubuntu/Downloads/XBMC-Airplayer/airplayer.py'"

So that xbmc launchers and is quickly followed with the airplay script so everything seems all nice and automated but I haven't come up with anything for the ATV.

could you please give some more info on how you make airplayer auto start on ubuntu?
i tried using the launcher addon to manually run an sh script that runs airplayer.py but it doesn't work for some reason (running the sh manually works fine)
logictester Wrote:could you please give some more info on how you make airplayer auto start on ubuntu?
i tried using the launcher addon to manually run an sh script that runs airplayer.py but it doesn't work for some reason (running the sh manually works fine)

Haven't tried using the launcher addon in xbmc myself, I'm just using ubuntu's Startup Applications under preferences to run the command...

sh -c "xbmc & sleep 10; /path-to-xbmc-airplayer-directory/airplayer.py"

Bear in mind in order to run airplayer.py directly you need to mark it as executable with "sudo chmod +x airplayer.py" Also you may need to adjust the sleep command to accommodate for the speed of your computer
mute Wrote:Well crap, using iTunes as a "controller" for streaming music to xbmc (and subsequently my stereo) is all I was ever after. The fact that AirPlay supports music streaming from iOS devices, but iTunes doesn't support it is really, really lame.

Audio always uses the unsupported AirTunes protocol, even from iOS devices. So music streaming from iOS devices will also not work.

What Apple calls AirPlay is actually two different implementations: the new AirPlay protocol which is only supported by the 2nd gen AppleTV. The AirPlay protocol supports only video and pictures. This protocol is easily reverse engineered and used by XBMC-Airplayer.

The second implementation is the old AirTunes protocol which is already a few years old and used by the Airport Express and 1st gen AppleTV. This protocol only supports audio and is also used for music streaming by the 2nd generation AppleTV. The AirTunes protocol and proprietary Apple Lossless Audio codec have been reverse engineered but a missing encryption key prevents unauthorized servers from playing content from the iOS and iTunes clients.
nicx76 Wrote:hi,

just tested pw's airplayer script on windows. its working with bonjour sdk instead of dns-sd.exe as expected Smile

but i do have the problems with pictures, too. there is only a blank black windows if i post a photo. and i noticed a lot of errors like this:

GET /scrub
POST /stop
GET /scrub
2010-12-27 21:27:59,319 INFO Caught protocol error (-32100, u'Failed to execute
method.')
INFO:airplayer:Caught protocol error (-32100, u'Failed to execute method.')
POST /reverse
PUT /photo
POST /stop

nicx...

The "GET /scrub" messages aren't errors it's just debug logging. You can disable it by setting Debug=False in settings.py.

Niels Leenheer Wrote:I've been playing around a bit and found that playing videos from iTunes to XBMC using Airplay might be possible with some modifications.

Currently iTunes does not list XBMC as a suitable Airplay target for videos, because it requires a couple of extra DNS txt records in the Bonjour configuration. However when I manually added the following txt records it did showed up and worked perfectly:

Code:
deviceid=00:00:00:00:00:00
features=0x7
model=AppleTV2,1
The contents of the deviceid does not seem to matter, but the original txt record broadcast by my AppleTV seems to be related to the mac address:

Code:
MAC address: xxxx:xx55:CAxx:xx06:BD9E
deviceid: xx:55:CA:06:BD:9E
Please note that you need to play a video in iTunes and choose the AirPlay target on the video controls. The general iTunes AirPlay control does not list XBMC. Playing music is also not supported, because that uses the older AirTunes protocol, which is completely separate from the AirPlay protocol.

Yes I too noticed iTunes doesn't pick up XBMC. I don't have an Apple TV myself so thanks for sharing that information! Are those 3 seperate txt records or one record?

thehankstar Wrote:Thanks for that. At least I got it connecting and running (sort of)...

Everytime I attempt to play a video, I get the following.

POST /reverse
POST /scrub?position=7.416744
2010-12-27 21:19:21,128 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
WARNING:root:404 POST /authorize (192.168.1.109) 0.00ms
GET /scrub
2010-12-27 21:19:21,145 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
GET /scrub
2010-12-27 21:19:21,170 INFO Caught protocol error (-32100, 'Failed to execute m
ethod.')
INFO:airplayer:Caught protocol error (-32100, 'Failed to execute method.')
POST /play
POST /rate?value=1.000000
2010-12-27 21:19:37,586 DEBUG Setting start position succeeded
DEBUG:airplayer:Setting start position succeeded

and then a bunch more of these:

GET /scrub
______________________

I swear I'm not as dumb as I come across (or maybe I am and I'm in denial). Either way, any help will be greatly appreciated.

Thanks!

It's interesting to see you've got a POST request for /authorize. Haven't seen that before. What did you do to get that? Could you get the latest code from Github please, I've added some debug code to discover what information is sent along with the /authroize request. Could you try to reproduce that and send me the debug info printed by Airplayer please?

For everyone who's having troubles playing video's, can you check if the video's are DRM protected?

For everyone who's having troubles playing pictures, can you report what OS, XBMC version, Python version you are running? Can you also manually check to see if the path logged by Airplayer (something like "DEBUG Showing picture: /tmp/tmpHn_qKx/picture1293495896.jpg") is an actual picture? Try opening that path with a picture viewer or something.

Thanks.
thehankstar Wrote:Sincerely appreciate you posting this. I am trying to get this to run myself, but am hitting a wall and my lack of python knowledge is obviously hindering me.

I must be missing a step somewhere. I am successful all the way to the final step and when i attempt to run airplayer.py, I get the following error:

File "airplayer.py", line 16, in <module>
from web import Webserver
File "C:\Users\Me\Airplayer\web.py", line 1, in <module>
import tornado.httpserver
ImportError: No module named tornado.httpserver


Any ideas?

If tornado is not installed: pip -r requirements.txt should take care of that. I did on my system.
PWiddershoven Wrote:Yes I too noticed iTunes doesn't pick up XBMC. I don't have an Apple TV myself so thanks for sharing that information! Are those 3 seperate txt records or one record?

Each line is a seperate txt record.
PWiddershoven Wrote:The "GET /scrub" messages aren't errors it's just debug logging. You can disable it by setting Debug=False in settings.py.



Yes I too noticed iTunes doesn't pick up XBMC. I don't have an Apple TV myself so thanks for sharing that information! Are those 3 seperate txt records or one record?



It's interesting to see you've got a POST request for /authorize. Haven't seen that before. What did you do to get that? Could you get the latest code from Github please, I've added some debug code to discover what information is sent along with the /authroize request. Could you try to reproduce that and send me the debug info printed by Airplayer please?

For everyone who's having troubles playing video's, can you check if the video's are DRM protected?

For everyone who's having troubles playing pictures, can you report what OS, XBMC version, Python version you are running? Can you also manually check to see if the path logged by Airplayer (something like "DEBUG Showing picture: /tmp/tmpHn_qKx/picture1293495896.jpg") is an actual picture? Try opening that path with a picture viewer or something.

Thanks.
(on windows)

Im too getting blank screen with pictures, but only with large ones. If the picture is smaller I get a garbled representation of that picture on my screen

Also, I had to use this line "pip install -r requirements.txt" to get pip to work
Niels Leenheer Wrote:Audio always uses the unsupported AirTunes protocol, even from iOS devices. So music streaming from iOS devices will also not work.

What Apple calls AirPlay is actually two different implementations: the new AirPlay protocol which is only supported by the 2nd gen AppleTV. The AirPlay protocol supports only video and pictures. This protocol is easily reverse engineered and used by XBMC-Airplayer.

The second implementation is the old AirTunes protocol which is already a few years old and used by the Airport Express and 1st gen AppleTV. This protocol only supports audio and is also used for music streaming by the 2nd generation AppleTV. The AirTunes protocol and proprietary Apple Lossless Audio codec have been reverse engineered but a missing encryption key prevents unauthorized servers from playing content from the iOS and iTunes clients.

Ah, I was under the impression that Airplay did everything. I knew about the AirTunes encryption, and did think it was odd that their new protocol seemed to have forgone the encryption that they were using previously.

Either way, it stinks that their "open" protocol is limited to video and pictures, it would have been nice to have something that encompassed more video formats and wasn't encumbered by patents or licensing.

I guess that I'll hold out hope that someone will manage to crack the encryption on AirTunes, although it seems doubtful considering that it's not really widely used, and it has been on the market for several years now without having been broken.
mute Wrote:Either way, it stinks that their "open" protocol is limited to video and pictures,

Airplay isn't open. It's a closed system, like airtunes. Only licensed third party hardware manufacturers may build hardware devices with airplay/airtunes support.

mute Wrote:I guess that I'll hold out hope that someone will manage to crack the encryption on AirTunes, although it seems doubtful considering that it's not really widely used, and it has been on the market for several years now without having been broken.
A clear distinction can be made between airplay and airtunes. I'm using the Airport expresses for a long time and i've been eagerly waiting for the key but nothing so far.

Now that airtunes is going to be used on a lot more devices(Seperate speakers, amplifiers etc) i'm hoping the key will become available through an hack or something. I've read that the airplay/airtunes functionality will come as an paid update for some denon amplifiers. So maybe we can hack the key of a firmware upgrade or something.

So far airplay is a good start! Wink
Niels Leenheer Wrote:I've been playing around a bit and found that playing videos from iTunes to XBMC using Airplay might be possible with some modifications.

Currently iTunes does not list XBMC as a suitable Airplay target for videos, because it requires a couple of extra DNS txt records in the Bonjour configuration. However when I manually added the following txt records it did showed up and worked perfectly:

Code:
deviceid=00:00:00:00:00:00
features=0x7
model=AppleTV2,1
The contents of the deviceid does not seem to matter, but the original txt record broadcast by my AppleTV seems to be related to the mac address:

Code:
MAC address: xxxx:xx55:CAxx:xx06:BD9E
deviceid: xx:55:CA:06:BD:9E
Please note that you need to play a video in iTunes and choose the AirPlay target on the video controls. The general iTunes AirPlay control does not list XBMC. Playing music is also not supported, because that uses the older AirTunes protocol, which is completely separate from the AirPlay protocol.


I've also got AirPlayer showing up in iTunes as an Airplay target

To get this working, I modified airplayer.py as follows to write the TXT records (thanks for the tip on this)


import settings
import utils
import signal
import pybonjour
.
.
.
.
def _register_bonjour(self):
hostname = gethostname()
hostname = utils.clean_hostname(hostname)

txtRecord=pybonjour.TXTRecord()
txtRecord['deviceid'] = '00:00:00:00:00:00'
txtRecord['features'] = '0x7'
txtRecord['model'] = 'AppleTV2,1'

thread.start_new_thread(bonjour.register_service, (hostname, "_airplay._tcp", self.port, txtRecord,))

I also modified bonjour.py as follows

def register_service(name, regtype, port, txtRecord):
def register_callback(sdRef, flags, errorCode, name, regtype, domain):
if errorCode == pybonjour.kDNSServiceErr_NoError:
logger.info('Registered bonjour service %s', name)


service = pybonjour.DNSServiceRegister(name = name,
regtype = regtype,
port = port,
callBack = register_callback,
txtRecord = txtRecord)


Now after AirPlayer is started I can see the the new airplay target in the airplay menu in iTunes


I seem to be unable to select the AirPlayer target from the iTunes airplay menu for some reason.
The option is there but not selectable

Perhaps there are other TXT records required in the bonjour broadcast...
I'm running this from Windows XP SP3


I can get airplay to play video via XBMC (Dharma build, running on Windows XP SP3) from an iPhone (with ios 4.2) without any issues
this line causes an error for me:

hostname = utils.clean_hostname(hostname)

Quote:Traceback (most recent call last):
File "airplayer.py", line 79, in <module>
main()
File "airplayer.py", line 74, in main
print 'Unable to connect to XBMC at %s' % runner.xbmc._host_string()
AttributeError: 'NoneType' object has no attribute '_host_string'

I got rid of that line and it's all good (XBMCLive now appears in iTunes when playing a video) but when selected i get nothing appear on the debug of XBMC and nothing on screen- odd.

Thanks to all those putting time into this!
PWiddershoven Wrote:For everyone who's having troubles playing pictures, can you report what OS, XBMC version, Python version you are running? Can you also manually check to see if the path logged by Airplayer (something like "DEBUG Showing picture: /tmp/tmpHn_qKx/picture1293495896.jpg") is an actual picture? Try opening that path with a picture viewer or something.
Thanks.

Not sure how to check the versions (although everything should be latest... i've run all the update/upgrades etc)

Looks like it could be a permission issue:

PHP Code:
lee@XBMCLive:~$ ls /tmp/tmpj8RJH2/
lscannot open directory /tmp/tmpj8RJH2/: Permission denied
lee
@XBMCLive:~$ sudo ls /tmp/tmpj8RJH2/
picture1293559150.jpg 
Doing this fixed it Smile

Quote:lee@XBMCLive:/tmp$ sudo chmod 777 tmpj8RJH2/

Although this is obviously only a temporary fix (i think the tmp folder changes everytime you launch XBMCAirplayer?
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 41

Logout Mark Read Team Forum Stats Members Help
AirPlay target support integrated into XBMC natively?3