PlexConnect on ATV 7.0 GM (iOS 8.0 GM)

Little OffTopic: Threads vs Processes

Run the attached.

On my machine (iMac 2009?, Core 2 Duo -> 2 Cores), the script needs like 12sec.

Switching to processes (change comment from line 22 to 23), it's down to about 5sec.

Not sure about the OS overhead, but comparing the execution times, with processes BOTH my cores need to be running, right?

On Quadcore machines, this difference should show a factor of 4... maybe someone can try (you might need to change the loops in line 11 to get somewhat reasonable times)?

Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.

Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.


Works under Windows on my Quad Core.

Your ThreadVsProcess.py as is, gets spread over 2 of my cores:-
![post-51394-0-16599000-1411203973.jpg|650x492](upload://dJnxi9mEZt8wa2YU1xuW4stJxj6.jpg)

And modifying it to run 8 threads, spreads the load out over all 4 of my cores, although not quite evenly, core 1 is doing slightly less work:-
![post-51394-0-40733200-1411203981.jpg|655x490](upload://jRfZ6BsvRzaBd1HA0xtDO2iFSMo.jpg)

But you won't see every core at 100%. So, yes, python itself is switching between cores, but never running on two or more at the same time.

With the processes you should technically see every core maxed out...

Run it using processes - and check processor load and runtime.

Little OffTopic: Threads vs Processes

Run the attached.

On my machine (iMac 2009?, Core 2 Duo -> 2 Cores), the script needs like 12sec.

Switching to processes (change comment from line 22 to 23), it's down to about 5sec.

Not sure about the OS overhead, but comparing the execution times, with processes BOTH my cores need to be running, right?

On Quadcore machines, this difference should show a factor of 4... maybe someone can try (you might need to change the loops in line 11 to get somewhat reasonable times)?

Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.

If someone wanted another reason to consider python totally broken: http://www.quantstart.com/articles/Parallelising-Python-with-Threading-and-Multiprocessing

In the general case, for for i/o bound activity, like with plexconnect, the threads will actually run somewhat in parallel.

Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.

Note that, as it stands, the two webservers and the dns server basically NEVER run at the same time anyway.

If someone wanted another reason to consider python totally broken: http://www.quantstart.com/articles/Parallelising-Python-with-Threading-and-Multiprocessing

In the general case, for for i/o bound activity, like with plexconnect, the threads will actually run somewhat in parallel.

Nice read. Example very similar to the code shown above. I guess, my understanding was not that wrong... :-)

Note that, as it stands, the two webservers and the dns server basically NEVER run at the same time anyway.

Yes and no.

As I stated somewhere, PlexConnect is not really a processor hurting application.

The two WebServers will - most likely - not run in parallel, you are right. The SSL one is of extremely low usage anyway (ok, skip the iMovie issue...). However, depending on your setup (multiple aTVs anyone?), DNS and WebServer might want to run in parallel.

But then again our "worker" WebServer calling XMLConverter might get multiple requests at the same time as well, all of which are currently not really answered in parallel... tststs.

But you won't see every core at 100%. So, yes, python itself is switching between cores, but never running on two or more at the same time.
With the processes you should technically see every core maxed out...
 
Run it using processes - and check processor load and runtime.


Umm.. your right.. which means threading in python is totally broken. I'm a .net programmer and threading works fine under that language. Take for example the following .net program:-
![post-51394-0-36487400-1411206078.jpg|668x458](upload://YiH1qeUfbQMKOn6AF2Ev8zwVx5.jpg)

![post-51394-0-74299900-1411206109.jpg|655x490](upload://skJQF6n8RpElfJ2nfxEK291T874.jpg)

As you can see this works as expected.... Yet another reason I hate python :D

The two WebServers will - most likely - not run in parallel, you are right. The SSL one is of extremely low usage anyway (ok, skip the iMovie issue...). However, depending on your setup (multiple aTVs anyone?), DNS and WebServer might want to run in parallel.

But then again our "worker" WebServer calling XMLConverter might get multiple requests at the same time as well, all of which are currently not really answered in parallel... tststs.

Unless you have like hundreds of AppleTVs around, the dns will get hit very very rarely. And, even if it was the case, it would be a lot more efficient to simply provide a response with a very long TTL.

Moreover, the threads will run "more or less" in parallel anyway, because most of the time is spent downloading data from plex or uploading data to the appletv. 

https://www.youtube.com/watch?v=Tmlnht6nn_c

Thanks Wahlman. I already did that and it didn't help. But today, I am a happy user again. I don't know why, but it is working again. The only thing I did is connecting my aTV with a new Ethernet cable (I was using wifi at the moment). Isn't it supposed to be working also with wifi? And the other thing I noticed, is that my icloud and itunes log-ins in aTV where kicked out. They do not appear anymore. Would be nice to know what caused the problem. I will try now to resolve the problem with my friends aTV. Will report back.

Edit: Ah and iMovie is working great with the patch! Thanks!

I just wanted to confirm that applying the AppleTV update with the standard Trailers highjack worked flawlessly for me.

  • Switched DNS to automatic
  • Updated to new software version
  • Re-added my PlexConnect server as DNS
  • Everything works as before

I have always said that 5% of failures are due to code.  As for the remaining 95%, the rot cause resides between the chair and the keyboard.  Thank you Azathooth for identifying the obvious mistake of my ways.  I have forgoten to change the DNS back to PlexConnect.

I guess what I'm trying to say is that the ATV update released yesterday had no impact on PlexConnect performance.  Except, maybe like wahlman.j highlighted, it seems faster.  For an ATV 2 & ATV 3, I'm running:

1. Mavericks V10.9.5 on a late 2011 MBP with 2.2 GHz Intel Core i7 processor

2. Airport Extreme V7.7.3

3. OpenPlex V1.0

4. PlexConnect V0.3.1+

5. PMS V0.9.10.1.585-f31034e

What did I do...?

1. Reset ATV to factory settings

2. Updated ATV Software

3. Logged in to: iTunes, iCloud and activated Home Sharing

4. Loaded Trailers Certificate using the Network process (http://xxx.xxx.xxx.xxx/trailers.cer)

5. Modified DNS server to PlexConnect/PMS IP address (xxx.xxx.xxx.xxx)

It is a beautiful thing.  Thank you team, you are superstars!

Dammit. I thought I would play a little with the themes... chose a new one in the theme tab which deleted the certs. I hijacked iMovie again, went to my aTV, deleted the old profile, loaded the new one, restarted and aaaaaaaaaaahhhhhhhhhhhhhhh: THE PROBLEM APPEARED AGAIN!! I can not understand what the problem is. But it seems it is something very simple...

You would have to reapply the iMovie patch every time if switching themes then you would need to restart plexconnect again to load the iMovie patch:

1. choose theme

2. pick hijack

3. load certs onto aTV

4. Apply patch https://www.dropbox....ZGSeBRF1Ga?dl=0

5. restart plexconnect

6. Restart aTV (clear cache)

7. Try iMovie on IOS 8

Kick me I know, but is the latest ver of plexconnect working with iOS 7 now for iMovie?  Is it on iBaa's github?

Only if Apple changed the iMovie requests back to HTTP?!?

Only if Apple changed the iMovie requests back to HTTP?!?

Ok, thanks Baa, I will keep iOS 6 going on my atv3 then :)

> Overlay

Interesting. The issue seems to be that iOS now doesn't show the progress bar right at the beginning. It's not shown, it won't need to get hidden - so PlexConnect is not notified to fade out the own displays.

Will get fixed - like generate hidden at startup, or add a nice reminder to hide it 5sec later?

I think it should come up for 5 or 10 seconds :)

You would have to reapply the iMovie patch every time if switching themes then you would need to restart plexconnect again to load the iMovie patch:

1. choose theme

2. pick hijack

3. load certs onto aTV

4. Apply patch https://www.dropbox....ZGSeBRF1Ga?dl=0

5. restart plexconnect

6. Restart aTV (clear cache)

7. Try iMovie on IOS 8

Every time I try following these steps, plexconnect stops working on number 5 restarting plexconnect. It says in the notification center: PlexConnect is Not Running...

For the meantime on OSX I am coding a temporary fix until this can be resolved for ios 8 via OpenPlex. I think it's a little much just for iMovie to work when there is plenty of other apps to hijack but to each their own. Also you cannot update to the latest github commit when you overwrite the git cloned files with the temporary fix since it modifys the git clone so you would need to git clone and patch every time if iMovie is a must for you on iOS 8. I recommend using the storefront button to find a alternative app in your geographic location instead but again this is up to the user to go thru all of that just for iMovie to work.

@creativeblends install teamviewer and send me a pm with your temporary id/pw and I can help you. Please restart you mac and do not start plexconnect via terminal then send me the login info.

I recommend using the storefront button to find a alternative app in your geographic location instead but again this is up to the user to go thru all of that just for iMovie to work.

 
It's not "just for iMovie to work": There's actually a bug in the way PlexConnect handles https connections, and the fix itself is not really such a big deal. 

First off, it's not like PlexConnect is going to be used to serve a hundred of clients and the webserver, internally, will use threads to serve multiple parallel requests anyway.