pascalw / Airplayer

Python script to make media playing software Apple Airplay compatbible. Currently supports XBMC, Plex and Boxee.

Home Page:http://pwiddershoven.nl/blog/2011/01/05/airplayer.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with pictures/slideshows

Flargen opened this issue · comments

Hello,

First, many, many thanks for your hard work on this project. Video works fantastically well with XBMC and AirPlayer, running on Ubuntu 10.10 (streaming from an iPhone 3GS running iOS 4.3).

The issue at hand is that attempts to stream photos to XBMC seem to be totally ignored. When playing a video, there is an immediate reaction in XBMC ("Working..." in the bottom-right corner), but attempts to send photos are seemingly being ignored entirely.

I enabled debug mode in the init script, and only see the following in the AirPlayer log:

2011-03-09 20:13:35 [DEBUG] GET /server-info
2011-03-09 20:13:35 [DEBUG] GET /slideshow-features
2011-03-09 20:13:39 [DEBUG] POST /reverse
2011-03-09 20:13:39 [DEBUG] GET /server-info
2011-03-09 20:13:39 [DEBUG] PUT /photo
2011-03-09 20:13:39 [DEBUG] Sending wake event
2011-03-09 20:15:09 [DEBUG] PUT /photo
2011-03-09 20:15:09 [DEBUG] Sending wake event
2011-03-09 20:15:19 [DEBUG] PUT /photo
2011-03-09 20:15:19 [DEBUG] POST /stop
2011-03-09 20:15:19 [DEBUG] POST /reverse
2011-03-09 20:15:19 [DEBUG] GET /server-info
2011-03-09 20:15:21 [DEBUG] PUT /photo
2011-03-09 20:15:23 [DEBUG] PUT /photo
2011-03-09 20:15:25 [DEBUG] POST /stop
2011-03-09 20:15:56 [DEBUG] GET /server-info
2011-03-09 20:15:56 [DEBUG] GET /slideshow-features
2011-03-09 20:15:58 [DEBUG] POST /reverse
2011-03-09 20:15:59 [DEBUG] GET /server-info
2011-03-09 20:16:00 [DEBUG] PUT /photo
2011-03-09 20:17:59 [DEBUG] PUT /photo
2011-03-09 20:17:59 [DEBUG] Sending wake event
2011-03-09 20:18:02 [DEBUG] PUT /photo
2011-03-09 20:18:05 [DEBUG] PUT /photo
2011-03-09 20:18:08 [DEBUG] PUT /photo
2011-03-09 20:18:11 [DEBUG] PUT /photo
2011-03-09 20:18:14 [DEBUG] PUT /photo
2011-03-09 20:18:17 [DEBUG] PUT /photo
2011-03-09 20:18:20 [DEBUG] PUT /photo
2011-03-09 20:18:23 [DEBUG] PUT /photo
2011-03-09 20:18:26 [DEBUG] PUT /photo
2011-03-09 20:18:29 [DEBUG] PUT /photo
2011-03-09 20:18:32 [DEBUG] PUT /photo
2011-03-09 20:18:35 [DEBUG] PUT /photo

Not entirely sure where to go from here. Any tips would be tremendously appreciated. Thanks!

Regards,
Campbell Krueger

Do you run Airplayer on the same host as XBMC? As far as I can tell, Airplayer succesfully receives the pictures (PUT /photo).

Sure do - it is listening locally on port 6002, and is configured to communicate with XBMC's back-end on port 8080.

Are any special builds of XBMC necessary for the slideshows to work? If not, could you provide a version/build number of XBMC you have confirmed to work with slideshows/images? Again, it's quite strange - video works fine, but slideshows are totally ignored.

Thanks in advance!

I got the same problem, video works great but photos from my iPhone is no go.
My debug log file shows the same (PUT /photo).

Hello again, solved the problem, there was a permission problem with the temp directory. my user 'xbmc' was not allow in the tmp dir. because only root was allowed.
my quick and dirty solution was to add this line to XBMC_media_backend.py

os.chmod(self._TMP_DIR,0777)

after line that contains

self._TMP_DIR = tempfile.mkdtemp()

My skills in python is just a couple of hours so maybe there is a better solution for the problem.

I'm not sure if this is an Airplayer bug, or an user configuration error. Did you alter the default umask settings for your OS?

Usually, when a process creates a temporary file the file permissions will/should be 644. This allows other users to read the file, but not write or execute it.

Maybe the umask is changed, I use XCI install script for XBMC, maybe I should change the umask instead of change the backend file.

Thanks for the tip, I will check my umask settings tomorrow.

I know I have not modified Ubuntu's default umask, but I will also verify this today once I get home from work (didn't have a chance yesterday).

Thanks for the input guys.

Just an update - trippen's suggestion worked for me.

Looks like it's a necessary fix given that it creates its own subdirectories within /tmp (likely a behavior of Python's "tempfile" library?). If you have a separate /tmp partition with a default umask of 000, you probably won't encounter this behavior - is this the case on your test hosts Pascal?

If so, it may be worth implementing trippen's suggestion (or something similar) as a permanent fix, as most desktop Linux users use default partition schemes in which /tmp resides on the root partition.

Anyway, I'm stoked. Thanks again!

I've been thinking about this and I will include a fix for this. Even though umask 022 is usually the default value, Airplayer shouldn't asume this is always the case.

Fix for permission issues on some OS configurations. Closed by af89440.