Kodi Community Forum
AirPlay target support integrated into XBMC natively? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9)
+--- Thread: AirPlay target support integrated into XBMC natively? (/showthread.php?tid=80400)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41


- matmabro - 2011-09-21

trying to install airplayer and then shairport. I think I have python and pip... working at least, but when I try to install the requirements.txt from airplayer, I get error code 1. here is pip log:

pastebin.com/DEJDPCn3


- mrfatboy - 2011-09-21

I know it works because i have both setup and working. Make sure hou follow the directions exactly. The wording in some of the instructions can be tricky.


- moshtagh - 2011-09-23

j0yb0y Wrote:Actually it's not hard to port to python 2.5. The only parts that are 2.6 are in biplist. The script attached converts the binary references to int, and the it adds namedtuple class which is missing from 2.5. The source I used is apparently the original source that the 2.6 code used.

With these changes and with the python-pip-less install you can get airplayer working on an Apple TV 1 using Sam Nazarko's linux image. You still need to add libraries - less python-pip - and then install the python libs that python-pip installed. In addition you need to install avahi-daemon. There's a posting for getting airplayer working on an ios appletv1 that details everything you need for pip-less installation that I followed.

Code:
sed -r -ibak 's/0b([01]+)/int('\''\1'\'', 2)/g'  airplayer/lib/biplist/__init__.py
cat << EOF > /tmp/airplayer.patch
47c47
< from collections import namedtuple
---
> #from collections import namedtuple
78a79,193
> from operator import itemgetter as _itemgetter
> from keyword import iskeyword as _iskeyword
> import sys as _sys
>
> def namedtuple(typename, field_names, verbose=False, rename=False):
>     """Returns a new subclass of tuple with named fields.
>
>     >>> Point = namedtuple('Point', 'x y')
>     >>> Point.__doc__                   # docstring for the new class
>     'Point(x, y)'
>     >>> p = Point(11, y=22)             # instantiate with positional args or keywords
>     >>> p[0] + p[1]                     # indexable like a plain tuple
>     33
>     >>> x, y = p                        # unpack like a regular tuple
>     >>> x, y
>     (11, 22)
>     >>> p.x + p.y                       # fields also accessable by name
>     33
>     >>> d = p._asdict()                 # convert to a dictionary
>     >>> d['x']
>     11
>     >>> Point(**d)                      # convert from a dictionary
>     Point(x=11, y=22)
>     >>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
>     Point(x=100, y=22)
>
>     """
>
>     # Parse and validate the field names.  Validation serves two purposes,
>     # generating informative error messages and preventing template injection attacks.
>     if isinstance(field_names, basestring):
>         field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas
>     field_names = tuple(map(str, field_names))
>     if rename:
>         names = list(field_names)
>         seen = set()
>         for i, name in enumerate(names):
>             if (not min(c.isalnum() or c=='_' for c in name) or _iskeyword(name)
>                 or not name or name[0].isdigit() or name.startswith('_')
>                 or name in seen):
>                     names[i] = '_%d' % i
>             seen.add(name)
>         field_names = tuple(names)
>     for name in (typename,) + field_names:
>         if not min(c.isalnum() or c=='_' for c in name):
>             raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name)
>         if _iskeyword(name):
>             raise ValueError('Type names and field names cannot be a keyword: %r' % name)
>         if name[0].isdigit():
>             raise ValueError('Type names and field names cannot start with a number: %r' % name)
>     seen_names = set()
>     for name in field_names:
>         if name.startswith('_') and not rename:
>             raise ValueError('Field names cannot start with an underscore: %r' % name)
>         if name in seen_names:
>             raise ValueError('Encountered duplicate field name: %r' % name)
>         seen_names.add(name)
>
>     # Create and fill-in the class template
>     numfields = len(field_names)
>     argtxt = repr(field_names).replace("'", "")[1:-1]   # tuple repr without parens or quotes
>     reprtxt = ', '.join('%s=%%r' % name for name in field_names)
>     template = '''class %(typename)s(tuple):
>         '%(typename)s(%(argtxt)s)' \n
>         __slots__ = () \n
>         _fields = %(field_names)r \n
>         def __new__(_cls, %(argtxt)s):
>             return _tuple.__new__(_cls, (%(argtxt)s)) \n
>         @classmethod
>         def _make(cls, iterable, new=tuple.__new__, len=len):
>             'Make a new %(typename)s object from a sequence or iterable'
>             result = new(cls, iterable)
>             if len(result) != %(numfields)d:
>                 raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result))
>             return result \n
>         def __repr__(self):
>             return '%(typename)s(%(reprtxt)s)' %% self \n
>         def _asdict(self):
>             'Return a new dict which maps field names to their values'
>             return dict(zip(self._fields, self)) \n
>         def _replace(_self, **kwds):
>             'Return a new %(typename)s object replacing specified fields with new values'
>             result = _self._make(map(kwds.pop, %(field_names)r, _self))
>             if kwds:
>                 raise ValueError('Got unexpected field names: %%r' %% kwds.keys())
>             return result \n
>         def __getnewargs__(self):
>             return tuple(self) \n\n''' % locals()
>     for i, name in enumerate(field_names):
>         template += '        %s = _property(_itemgetter(%d))\n' % (name, i)
>     if verbose:
>         print template
>
>     # Execute the template string in a temporary namespace
>     namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename,
>                      _property=property, _tuple=tuple)
>     try:
>         exec template in namespace
>     except SyntaxError, e:
>         raise SyntaxError(e.message + ':\n' + template)
>     result = namespace[typename]
>
>     # For pickling to work, the __module__ variable needs to be set to the frame
>     # where the named tuple is created.  Bypass this step in enviroments where
>     # sys._getframe is not defined (Jython for example) or sys._getframe is not
>     # defined for arguments greater than 0 (IronPython).
>     try:
>         result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')
>     except (AttributeError, ValueError):
>         pass
>
>     return result
>
>
>
EOF
patch airplayer/lib/biplist/__init__.py /tmp/airplayer.patch
Sorry to bother you but can you please give a little more explicit instructions on what we must do if we want to upgrade from python 2.5 to 2.6


- moshtagh - 2011-09-23

thanks got it going finnaly how about shairport any instructions on how to install that?


- moshtagh - 2011-09-24

I am curious how to get shairport working on apple tv 1 now if anyone has instructions i would much appreciate it


- Ned Scott - 2011-10-01

Not sure if this has been mentioned in this thread yet, but the nightly versions of XBMC now has AirPlay support included (including audio!). However it currently only works on Mac OS X, iOS, and Linux. Windows support is hung up on some technical details with Bonjour, IIRC.


- newphreak - 2011-10-02

This works really really great. I have been playing around with it allot now.
I run OpenELEC, all needed to do is enable it under system. Then i can send audio/video/pictures directly to XBMC. Big Grin It's awesome!


- eQUIV - 2011-10-04

Ned Scott Wrote:Not sure if this has been mentioned in this thread yet, but the nightly versions of XBMC now has AirPlay support included (including audio!). However it currently only works on Mac OS X, iOS, and Linux. Windows support is hung up on some technical details with Bonjour, IIRC.

That's great news, is there another thread where one could follow the progress for Windows support?


- Ned Scott - 2011-10-04

eQUIV Wrote:That's great news, is there another thread where one could follow the progress for Windows support?

Devs work fast! Windows support for Airplay has been added in the latest nightlies.


- rapitts - 2011-10-04

I've downloaded the latest GIT but only got video airplay support and not music for linux (ubuntu)?


- automated - 2011-10-04

Ned Scott Wrote:Devs work fast! Windows support for Airplay has been added in the latest nightlies.

I've installed the latest windows nightly, how do I use AirPlay?


- Weavus - 2011-10-05

Wow, thanks for the effort wsoltys, can confirm that Airplay is now working natively on Windows with the latest nightly. Some videos are not working though, does xbmc support m3u8 yet?

Also, is there anyway to support IOS 5 Airplay mirroring?

Anyway, thanks!


- Weavus - 2011-10-05

automated Wrote:I've installed the latest windows nightly, how do I use AirPlay?
You need to have Apple Bonjour installed (think it will be ok with just the print services) http://developer.apple.com/opensource/ and then turn on Airplay support in settings->network of XBMC.


- mortstar - 2011-10-05

XBMC crashes every time on Windows 7 64 bit when I try to send a video from my iPhone - last log entry is always the loading of libplist.dll

Here's a debug log http://pastebin.com/3qdmqAzs

The 'APPCRASH' details on the system error are:

Faulting application name: XBMC.exe, version: 10.5.0.0, time stamp: 0x4e8ac8a2
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7ba58
Exception code: 0xc0000374
Fault offset: 0x000ce653
Faulting process id: 0x9fc
Faulting application start time: 0x01cc8341d927f4a7
Faulting application path: C:\Program Files (x86)\XBMC\XBMC.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: 2032b1e2-ef35-11e0-b927-001c428ed877

Followed by errors on Bonjour Service:

460: ERROR: read_msg errno 10054 (An existing connection was forcibly closed by the remote host.)

No dump file is created with this crash.


- WiSo - 2011-10-05

mortstar Wrote:XBMC crashes every time on Windows 7 64 bit when I try to send a video from my iPhone - last log entry is always the loading of libplist.dll

Here's a debug log http://pastebin.com/3qdmqAzs

please fill out a ticket with a way to reproduce. no matter which video i tried libplist wasn't loaded and i couldn't tet it with xbmc. the included test with plist were fine.
if needed attach a sample video file as well. take your time as i'm currently not at home anyway.