None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, but after about 30 minutes my iPad's and iPhones can no longer access the library. I see it in the shared list, but no access.

None of my iDevices can read my iTunes library after about 30 minutes. My iDevices lose connection to my library and I have to do one of the three following things in iTunes to regain connectivity: 1. Restart iTunes 2: Stop / Start Home Services 3: Start playing a song.

I'ts as if iTunes goes into a background or sleep mode. During the loss of connectivity my iDevices show that there's a library shared, but I cannot connect to it.

iPhone 4, iOS 5

Posted on May 13, 2012 1:34 PM

Reply
221 replies

Jun 6, 2012 1:57 PM in response to aut0maticdan

Mine needed another restart. It looks like 100 is probably the magic number (max connections to HS). Nobody has been home to touch the AppleTV/iTunes since the last restart (I'm ssh'd in from work). Still on old AppleTV OS. Its funny because it didn't happen all day yesterday. :shrug:


Wed Jun 06 16:47:14 -0400 2012 :: Number of HS connections: 99 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:19 -0400 2012 :: Number of HS connections: 99 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:24 -0400 2012 :: Number of HS connections: 99 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:29 -0400 2012 :: Number of HS connections: 103 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:34 -0400 2012 :: Number of HS connections: 104 (CLOSE_WAIT: 1)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:39 -0400 2012 :: Number of HS connections: 105 (CLOSE_WAIT: 2)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:44 -0400 2012 :: Number of HS connections: 106 (CLOSE_WAIT: 3)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:49 -0400 2012 :: Number of HS connections: 107 (CLOSE_WAIT: 4)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Wed Jun 06 16:47:54 -0400 2012 :: Number of HS connections: 108 (CLOSE_WAIT: 5)

restarts: 2 :: last restart: Wed Jun 06 11:20:04 -0400 2012

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Wed Jun 06 16:48:39 -0400 2012 :: Number of HS connections: 103 (CLOSE_WAIT: 0)

restarts: 3 :: last restart: Wed Jun 06 16:48:34 -0400 2012

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Wed Jun 06 16:49:25 -0400 2012 :: Number of HS connections: 0 (CLOSE_WAIT: 0)

restarts: 4 :: last restart: Wed Jun 06 16:49:20 -0400 2012

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Jun 6, 2012 2:02 PM in response to SilverSevens

Well I have been trying a different test.


I have had a book playing on the server (in a loop) for the last 12 hours - its a headless server volume turned down.


In that time I have been able to load the server library on all 3 ATVs and 3 computers without any issues - no restarts etc.


Not sure what this adds to this great thread - but information is information.


I'll leave it running overnight and see what the morning brings.

Jun 6, 2012 4:36 PM in response to SilverSevens

I can't reply with the same level of information as Aut0mation, as I'm not clever enough to understand his script. Good work though. All I can say is that things, so far, seem to be working properly now. The only problem I have had is a short wait to load the next program, while the external HDD spins up (the iMac screen stays asleep, I think). This is since updating to 5.0.2. Apple should give you guys credit, in their release notes!

Jun 7, 2012 4:31 AM in response to Stephen Connor

yeah, bummer. I had a restart over night even after updating and restarting itunes. It was due to connections in a CLOSE_WAIT state.


Thu Jun 07 06:18:59 -0400 2012 :: Number of HS connections: 97 (CLOSE_WAIT: 0)

Thu Jun 07 06:19:04 -0400 2012 :: Number of HS connections: 97 (CLOSE_WAIT: 0)

Thu Jun 07 06:19:09 -0400 2012 :: Number of HS connections: 100 (CLOSE_WAIT: 0)

Thu Jun 07 06:19:14 -0400 2012 :: Number of HS connections: 101 (CLOSE_WAIT: 1)

Thu Jun 07 06:19:19 -0400 2012 :: Number of HS connections: 102 (CLOSE_WAIT: 2)

Thu Jun 07 06:19:24 -0400 2012 :: Number of HS connections: 103 (CLOSE_WAIT: 3)

Thu Jun 07 06:19:29 -0400 2012 :: Number of HS connections: 104 (CLOSE_WAIT: 4)

Thu Jun 07 06:19:34 -0400 2012 :: Number of HS connections: 105 (CLOSE_WAIT: 5)

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Thu Jun 07 06:20:50 -0400 2012 :: Number of HS connections: 0 (CLOSE_WAIT: 0)

restarts: 1 :: last restart: Thu Jun 07 06:20:45 -0400 2012

Home sharing is broken. I am going to restart iTunes.

iTunes restarted

Thu Jun 07 06:22:05 -0400 2012 :: Number of HS connections: 0 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Thu Jun 07 06:22:00 -0400 2012

Thu Jun 07 06:22:10 -0400 2012 :: Number of HS connections: 0 (CLOSE_WAIT: 0)

restarts: 2 :: last restart: Thu Jun 07 06:22:00 -0400 2012


After updating things did briefly look better. The number of connctions alternated between 3 and 4 for a while, which is something I hadn't seen before.


I'm going to submit another bug report to apple with what we discovered here. For now, this script will manage the problem on macs. If I get a chance, I'll look into a windows solution, but its tough for me since I don't have a windows machine (we have a few XP & 7 machines at work).


EDIT: windows users may want to try Davids8477's book/mp3 loop. Hows that going David?


Message was edited by: aut0maticdan

Jun 7, 2012 7:20 AM in response to cendrizzi

Honestly, I'm not sure. Since we can't look at the source code of iTunes and appletv, we are pretty much left observing its behavior. I know I've had days go by without a problem. Let's compare hardware and software.


I am running an AppleTV 3 (preorder/first batch). Model number MD199LL/A. The software version is 5.0.2 (4250). It is set to sleep after 30 minutes.


The iTunes side is an i7 quad-core mac mini from this year running OSX Lion Server (10.7.4) w/promise 6-drive thunderbolt RAID hosting the library. iTunes 10.6.1 (7).


There is a Dell business-class switch connecting the two. I have a current-gen Airport Extreme, but its not techincally involved. Everything is hard-wired cat 5/6.


For the most part everything I have is current-gen top of the line and up to date on software. : /

Jun 7, 2012 11:51 AM in response to aut0maticdan

I see that you can't view my bug or comment/vote for it. Apparently apple uses the volume of bug reports for a particular issue to determine the severity. I'd recommend anyone interested in getthing this fixed to log a real bug report (not one of those basic support submitions).


Here is what I wrote. You can copy/paste most of it:


07-Jun-2012 02:26 PM Daniel Wharton:

Summary:


If an AppleTV is connected to iTunes via Home Sharing and left idle, connections to TCP port 3689 on the iTunes side begin to build up between the AppleTV and home sharing. Once the number of connections crosses 100, all new connections go to a CLOSE_WAIT state and home sharing begins to fail for any device or computer trying to connect.


A restart of itunes or a logging out and logging in of Home sharing on the iTunes side resolves the issue. Restarting the appleTV has no effect on the connections.


Steps to Reproduce:


Turn on home sharing on both iTunes and AppleTV. Connect to the library and then leave idle.


Expected Results:


I would expect iTunes would release home sharing connections as necessary and all Home Sharing clients to have no problem connecting and accessing the iTunes library.


Actual Results:


ESTABLISHED connections will build up on the iTunes host from the apple TV on TCP port 3689. Once the number of ESTABLISHED connections crosses 100, all new connections will go right to a CLOSE_WAIT state and no new clients can connect (you get a timeout).


Regression:


Notes:


It does not seem that this problem is universal. Some users do not exhibit this problem at all. It does transcend Mac and Windows iTunes libraries.


We have quite a discussion going here: https://discussions.apple.com/thread/3948888?start=105&tstart=0


I wrote a Ruby script to monitor, debug and restart itunes when necessary. You can find it here: http://djw.s3.amazonaws.com/homesharing-keepalive.rb


I recommend turning debug on.


AppleTV model number MD199LL/A. The software version is 5.0.2 (4250). It happened in earlier versions as well. It seems to have started in iTunes 10.6.1.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

None of my iDevices can read my iTunes library after an hour of availibility. When I first start iTunes I can read the library, but after about 30 minutes my iPad's and iPhones can no longer access the library. I see it in the shared list, but no access.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.