Step 3 in the code example for the simple type explicitly specifies where a URL should be provided:
Create an AVAsset instance with a URL, and then create an AVPlayerItem instance with that asset.
let url = URL(string: "http://www.examplecontenturl.com")!
let asset = AVAsset(url: url)
let item = AVPlayerItem(asset: asset)
If this were implemented, it would permit selection of where the stream is sourced from. If the server is inaccessible, feed from the local iOS storage, when at home stream directly from the server.
Ah, sorry, was viewing on mobile and distracted while traveling. You are correct. However, one of the reasons we started designing Plexamp and its custom player in the first place was the large number of limitations in AVPlayer, so we don’t use it. It’s way too simple for our needs.
My only guess is there’s something “different” about your network. I can’t think of any other factors which would cause some people to have a good experience vs not, especially with one app over another.
Bear in mind that a clue might be the technical point raised easier in this thread-if the other apps are using Airplay in the simplest mode, with AVPlayer, that could imply a path from server to AirPlay endpoint as opposed to server to device to AirPlay endpoint. There should be more than enough bandwidth to handle that, but … it could be a meaningful difference.
I just like to add something to this topic because in my opinion the title is misleading.
Plexamp and AirPlay are an excellent combination. Personally, I do not have any issues. I did have them and changing my Wi-Fi settings resolved the problem.
If there are issues, they are caused by local equipment or the local network.
I wish that were true but every other airplay app on my network, including Prism Music streaming from the same Plex server is just fine. Zero dropouts. Zero instances of audio disappearing entirely. It’s only Plexamp.
One of the apps is Overcast so usually there’s no server there. The media is usually local on the device but occasionally it is streaming from the internet.
Another app is Prism, pulling music from the same Plex server as Plexamp
Raw bandwidth is certainly not the issue. Running a Speedtest on the phone yields download speeds of 237Mbps and from the iPad (which actually performs better here) 112Mbps. A wired connection in the same room yields 941Mbps yet Plexamp from the Mac is just as bad when it
airplays.
The Mac has a 10Gbps wired connection to the switch and the NAS where PMS is running has a 2.5Gbps connection. PMS is running in docker on a QNAP TVS-h874 (i5, 32GB RAM). Overall cpu usage is low (<10%) and that server is capable of streaming 70mbps 4k bluray on our local net without any issues.
While the wifi coverage in my office may be the worst spot int he house, it’s still more than enough to direct play a 65Mbps stream over wifi without any trouble at all.
I don’t think my network has a problem. Prism, streaming from the same Plex server is solid. I’ve not experienced one dropout. With Plexamp I get dropouts and the audio frequently goes away entirely and the airplay connection needs to be reset for it to come back.
As an experiment this morning I started direct playing a 35Mbps movie from the ios Plex
app on the phone and airplaying the audio. I only listened for a few minutes but I
experienced zero dropouts. Bandwidth does not appear to be an issue.
Next I began using the ios Plex app to airplay music from the phone and 40 minutes
later there hasn’t been a dropout. That is not definitive (Plexamp has lasted that long
on occasion) but really this sure looks like a case of 'one of these things is not like
the other". I’ll continue testing using the Plex app to get a longer timebase for a conclusion but it would not be at all unusual for Plexamp to have totally dropped the audio by now.
Followup…of course, within a minute of posting the above, I experienced a couple of sub second dropouts from the Plex app though it hasn’t totally lost the audio.
looking back at the Plexamp logs from earlier in this thread … around the times you noted hearing dropouts, logs show the phone switching from wifi to cellular … this could certainly affect an airplay 1 stream (i’m thinking that similar short drops might not affect airplay 2 due to the additional buffering?) … since the issue has occurred across multiple devices, and always with at least the homepods connected to wifi, the wifi network itself seems to be the common thread?
@tgp-2, interesting observation. I’ll see what I can find at my end. Both the phone and my network controller show a strong wifi connection but transitory stuff too short for the app to show might occur.
I don’t recall now which device I grabbed those logs from but let’s assume the phone. The iPad does not have a cellular connection (it’s cellular capable but doesn’t have a plan and cell is turned off).
I’ll see if the Unify app can notify me when any of the phone, iPad or HomePods go offline. It won’t be a definitive test as it’s conceivable a very brief event might not get notified but let’s see if it turns up anything.
There are three access points in the house and it’s possible one of the devices involved could be switching access points. I can try locking the devices to a specific access point to see if that solves things. They shouldn’t be hopping access points as everything is sitting statically on a table but its worth making sure.
In case that still does not solve the issue, I missed out on the fact that this is a UniFi configuration. I had issues with it as well (not only AirPlay, also Sonos protocol) and it turned out to be some settings in the controller.
Try configuring channel width to 20 MHz (instead of 40) for 2.4 GHz radio.
I have 5 GHz radio configured at 40 MHz.
Transmit power set to auto for both radios.
My channel width’s were already as you suggested. My 2.4GHz power was set to low and the 5GHz was set to medium (that was based on some best practice thing I saw way back when on the Unify forum).
So far I’ve only been able to test for an hour or so with the devices locked to specific access points but there hasn’t been a dropout yet. It’s too early to say for sure if that fixes it but it is encouraging.
Yesterday I tried locking the HomePods and the phone to an access point and for much of the day things were great. Then in the afternoon I experienced several sudden disconnects from airplay. I happened to be looking at the phone when one happened and I did see the wifi signal drop with a brief cell connection and back to wifi.
Next I unlocked the devices and allowed them to roam again and changed the access point config to turn on fast roaming. Unifi has this turned off by default and there is a warning about it potentially causing connectivity issues for some clients.
I’ve been running in this configuration all day (about 4 and half hours of music streaming) and no dropouts yet. I’ve gone this long without a dropout but this is encouraging.
If correct it might indicate the airplay2 is more robust with respect to access point roaming than airplay1.
I’ll post another update tomorrow and let you know how it goes.
Glad you seem to be getting the to bottom of the network issues!
I think the more accurate statement might be that AirPlay 2, when it is streaming directly from the server/source, is more robust. Otherwise, data needs to stream reliably from phone to AirPlay endpoint.
Of course, AirPlay 2 also has larger buffer sizes, so assuming it’s able to recoverer from those glitches, it would be more reliable too.
The good news is no dropouts today so that continues to be encouraging.
I suspect that’s more likely to be the culprit. I know Overcast is air playing from data stored on the phone and Prism is also (I doubt Prism can hook airplay up directly to PMS).
Unless I have bad news to report, I’ll post again on Sunday to follow up. If I make it five days without a dropout it is probably solved. Previously the longest I’d gone was about 1.5 days.
It’s probably a “duh” statement, but I find that whenever I have Airplay issues with my iPhone I restart it and the problems go away for quite a while. I would estimate maybe there’s a stutter or dropout once in 100 hours of listening. The audio glitches in and out, even as Plexamp shows it’s playing (i.e. the playback isn’t paused). Usually when this happens it’s not recoverable without a restart, and there appear to be problems with Airplay at the system level because when I try to switch it to another endpoint after it starts glitching, it often won’t even switch. But I restart the phone and boom, everything immediately works 100% again. I also have my router set to restart itself every morning at 2am, because I notice that if I don’t do that then the entire network gets funky after several days (and this is with the highly rated Archer C7 router).
I also have a small USB-powered “PC” style fan plugged into the rear port, and the router sits on top of the fan. This helps keep the network stable, otherwise the router gets hot as hell 24/7 which also causes problems (e.g. the 1Gbps LAN ports will downgrade to 100Mbps when it gets hot).