EASession return nil on iOS18

On iOS 18.x when try to create EASession we get nil, but on iOS 17.x everything works.

We have app which use USB cable for connecting external accessories. Scenario is when we have fresh instal, connecting with accessory work fine, EASession is created, streams are opened. When we unplug USB, we close streams, remove any reference to session and accessory, remove accessory delegate. When plug it again, creating EASession is returning nil. Only after restarting iPhone, we can create new EASession with appropriate protocol and accessory. Every next attempt without reseting iPhone is failing.

Logs from accessory is following:

 
00:05:51.811000 : onUSBDeviceFound(pDevice=0xffc818)) iPhone USB device already in the device list w/id=1 -> update status now[21;1H
00:05:51.830000 : setConnectionStatus(status=connected) [devId=1] state updated -> forward[21;1H
 
Capabilities indicate HostMode possibility => role switch is triggered
 
00:05:52.848000 : updateDIPODeviceConnections() iPhoneUSB w/caps=5 (=CarPlay or HostMode), deviceTag=2 in Device mode -> request role switch[21;1H
 
Role switch seems to be successful
 
00:05:54.914000 : setSwitching('stable') changed[21;1H
00:05:54.915000 : updateDIPODeviceConnections() iPhoneUSB w/caps=2, id=1, deviceTag=2 and native transport -> request app launch and call connectUSB[21;1H
00:05:54.967000 : ConnectiAP2(05ac:12a8, s/n='00008101000160921E90801E', writeFD='/dev/ffs/ep3', readFD='/dev/ffs/ep4', hostMode){3}[21;1H
 
Native transport should become available but does not (the following line is not present for failed case. Taken from successful case)
 
00:05:24.983000 : OnDBusPropChanged_NativeTransport(): deviceId=2, started=1, iAP2iOSAppIdentifier=1, sinkEndpoint=3, sourceEndpoint=4, TransactionID=1
 
EAP Start event not received (trace line from success try)
 
00:05:25.057000 : EAPSessionStart(ctx=0x74e0b800){2} called[21;1H

Is there any braking change on iOS 18 considering EASession? Also what is strange is that it works on fresh instal/restart iPhone, but not working on second attempt?

Answered by DTS Engineer in 810501022

On iOS 18.x when try to create EASession we get nil, but on iOS 17.x everything works.

Please file a bug report and then post the bug number back here. As part of that bug, please go throw the testing process:

  1. Restart the device so that you're starting with a "clean" testing device.

  2. Unlock the device, then leave it alone for a few minutes. The goal here is let the device fully complete any startup activity before you start testing.

  3. Note the exact time (as accurately as possible) and plug your accessory in to the device. Wait for ~1 min.

  4. Note the exact time (as accurately as possible), then launch your app and proceed with your normal testing process to verify the accessory is working. During this testing, try to move slowly and deliberately through your interface and your interaction with the accessory. When you've finished your testing process, note the exact time (as accurately as possible).

  5. Wait for a few minutes.

  6. Repeat the process from step #3, replicating the failure. It's not clear from your description which of these (or both) are failing, so please do the same test cycle and test both:

  • Opening your app again and trying to reconnect.

  • Force quitting your app and relaunching it.

  1. Once all testing is finished, wait 2-3 minutes, then trigger and collect a sysdiagnose.

  2. Upload that sysdiagnose to your bug.

FYI, the reason I've asked for time stamps and the "slow" testing process is that it can make the console data much easier to interpret. On the time stamp side, the difference between a "working case" and a "failing case" aren't always obvious and the log volume is high enough that it's easy to end up wasting a lot of time looking at log data that isn't actually relevant. Similarly, the "slow" testing process helps "spread" the process over a wider time span, which makes it easier to track exactly what system activity is tied to the corresponding app/accessory activity. A lot of the system activity is asynchronous, which means "full speed" often causes the logging tied of one event/interaction to closely follow or overlap with other activity, making the chain of events harder to follow. Slowing the testing process down helps prevent that. The delay at the end of testing is just the more extreme example of that- the sysdiagnose process itself generates large amounts of log noise, so immediately triggering the sysdiagnose ends up piling up a bunch of log noise at exactly the wrong place.

Is there any braking change on iOS 18 considering EASession?

This is the first report of seen about this.

Also what is strange is that it works on fresh instal/restart iPhone, but not working on second attempt?

I need to see the sysdiagnose data to say anything specific, but what typically causes this kind of failure pattern is that a failure at the end of the working cases left the supporting system daemon in a broken state, which then causes the second attempt to fail. A few things that would be interesting to test around that issue:

  • Assuming you have access to multiple examples (copies? instances?) of the same accessory, see if using on of the other accessories work. This can help differentiate between a failure that's tied to the system tracking an individual device and a broader failure.

  • Try connecting to the same accessory with a different app. You can either use a simple test project, or change the bundle ID of your actually application.

  • Test with other unrelated accessories and apps to see if the issue is effecting the entire "stack" or just your app. Putting that test another way, does the succes of your accessory/app break create an immediate failure in the other accessory/app.

-Kevin

We have the exact same issue with our accessory. This only happens on devices running iOS18 and rebooting the iOS device allows the accessory to connect.

We have also filed a bug on feedback assistant for this issue but so far there has been no response.

Yes, we are experiencing this exact issue as well.

On iOS 18.x when try to create EASession we get nil, but on iOS 17.x everything works.

Please file a bug report and then post the bug number back here. As part of that bug, please go throw the testing process:

  1. Restart the device so that you're starting with a "clean" testing device.

  2. Unlock the device, then leave it alone for a few minutes. The goal here is let the device fully complete any startup activity before you start testing.

  3. Note the exact time (as accurately as possible) and plug your accessory in to the device. Wait for ~1 min.

  4. Note the exact time (as accurately as possible), then launch your app and proceed with your normal testing process to verify the accessory is working. During this testing, try to move slowly and deliberately through your interface and your interaction with the accessory. When you've finished your testing process, note the exact time (as accurately as possible).

  5. Wait for a few minutes.

  6. Repeat the process from step #3, replicating the failure. It's not clear from your description which of these (or both) are failing, so please do the same test cycle and test both:

  • Opening your app again and trying to reconnect.

  • Force quitting your app and relaunching it.

  1. Once all testing is finished, wait 2-3 minutes, then trigger and collect a sysdiagnose.

  2. Upload that sysdiagnose to your bug.

FYI, the reason I've asked for time stamps and the "slow" testing process is that it can make the console data much easier to interpret. On the time stamp side, the difference between a "working case" and a "failing case" aren't always obvious and the log volume is high enough that it's easy to end up wasting a lot of time looking at log data that isn't actually relevant. Similarly, the "slow" testing process helps "spread" the process over a wider time span, which makes it easier to track exactly what system activity is tied to the corresponding app/accessory activity. A lot of the system activity is asynchronous, which means "full speed" often causes the logging tied of one event/interaction to closely follow or overlap with other activity, making the chain of events harder to follow. Slowing the testing process down helps prevent that. The delay at the end of testing is just the more extreme example of that- the sysdiagnose process itself generates large amounts of log noise, so immediately triggering the sysdiagnose ends up piling up a bunch of log noise at exactly the wrong place.

Is there any braking change on iOS 18 considering EASession?

This is the first report of seen about this.

Also what is strange is that it works on fresh instal/restart iPhone, but not working on second attempt?

I need to see the sysdiagnose data to say anything specific, but what typically causes this kind of failure pattern is that a failure at the end of the working cases left the supporting system daemon in a broken state, which then causes the second attempt to fail. A few things that would be interesting to test around that issue:

  • Assuming you have access to multiple examples (copies? instances?) of the same accessory, see if using on of the other accessories work. This can help differentiate between a failure that's tied to the system tracking an individual device and a broader failure.

  • Try connecting to the same accessory with a different app. You can either use a simple test project, or change the bundle ID of your actually application.

  • Test with other unrelated accessories and apps to see if the issue is effecting the entire "stack" or just your app. Putting that test another way, does the succes of your accessory/app break create an immediate failure in the other accessory/app.

-Kevin

Hi Kevin,

Thank you for the response. I am not the original post creator but as I mentioned our accessory also has the same exact problem.

We actually submitted a bug via Feedback Assistant on Oct 11 (FB15464483 (EASession fails intermittently with no error)).

We have also filed for a code level support for the same issue (Case-ID: 9616754) but so far we have not received any response in either of these places.

I have updated the bug on Feedback Assistant with the logs you requested along with the timestamps. I am attaching the timestamps below for reference as well

  • Apple device booted to homescreen - 8:48:30
  • Accessory plugged in for the first time - 8:51:00
  • Click "Allow" on App launch dialog - 8:52:00
  • Verified accessory is connected via the app - 8:52:08
  • Disconnect accessory by unplugging the lightning connector from iOS device - 8:55:02
  • Reconnect accessory with app still open - 8:56:00
  • Issue reproduced - 8:56:08
  • Sysdiagnose triggered - 8:59:00

It's not clear from your description which of these (or both) are failing, so please do the same test cycle and test both:

  • Opening your app again and trying to reconnect.
  • Force quitting your app and relaunching it.

Actually neither of these actions trigger the bug in question. It is only when you reconnect the accessory physically by disconnecting and reconnecting the lightning (or USB-C) connector from the iOS device that it fails to establish connection. The bug is also reproduced if we just turn off the accessory and turn it back on but the mechanism is probably the same in both cases.

Assuming you have access to multiple examples (copies? instances?) of the same accessory, see if using on of the other accessories work. This can help differentiate between a failure that's tied to the system tracking an individual device and a broader failure.

Yes we have tested this on multiple units (>10) and the bug is reproduced on all of them. So it is not a failure that is tied to a particular unit.

Try connecting to the same accessory with a different app. You can either use a simple test project, or change the bundle ID of your actually application.

As part of the code level support we created a completely new test project that does just basic connection and communication with the accessory and the issue was reproduced there as well.

Test with other unrelated accessories and apps to see if the issue is effecting the entire "stack" or just your app. Putting that test another way, does the succes of your accessory/app break create an immediate failure in the other accessory/app.

We will check if we have any other accessories that connect via Lightning/USB-C but this may take some time.

However the fact that this happens only on iOS18 and not on any lower version (iOS17 and below) is a strong indication that it is related to our accessory itself.

Please let me know if you need more information to debug the issue. This is affecting all our customers who are running iOS18 and it would be great to find a solution soon!

Thanks, Amith

Assuming you have access to multiple examples (copies? instances?) of the same accessory, see if using on of the other accessories work. This can help differentiate between a failure that's tied to the system tracking an individual device and a broader failure.

Yes we have tested this on multiple units (>10) and the bug is reproduced on all of them. So it is not a failure that is tied to a particular unit.

Just to clarify the testing I was talking about here, it would look something like this:

  1. Reproduce the issue with Accessory 1

  2. Test with accessory 2.

  • Does Accessory 2 immediately fail or does it work once and THEN fail (just like Accessory 1)?
  1. Perform stage 1 with Accessory 1 (do the "working" test, but to NOT generate the actual failure).

  2. Test with Accessory 2.

  • Does Accessory 2 work once then fail, or does it fail immediately?

We will check if we have any other accessories that connect via Lightning/USB-C but this may take some time.

However the fact that this happens only on iOS18 and not on any lower version (iOS17 and below) is a strong indication that it is related to our accessory itself.

Agreed and, to be clear, I don't think (and never have) the issue is your accessory. Part of that is certainly that it "used to work", however, that's only one factor here. One of the major goals of the MFI licensing process is to establish and verify consistent accessory behavior so that accessories DON'T break as the system changes and evolves. More the point, unless you're accessory is quite unusual, it completely powered down* at the unplug event so the only component that "knows" about the previous usage cycle and could have changed it's behavior based on that.

*This doesn't change the broader point, but if your accessory ISN'T doing a full power off when it's unplugged, then it's certainly worth seeing if fully powering off your accessory does change anything.

My goal with this kind of testing is to try and get clearer picture of exactly how the failure is playing mostly to help the investigation on our side, partially with the hope that the testing might uncover some kind of "oddity" that might open the door to a workaround. Having said all that, I have looked at your log data and, based on that, I suspect that this is a bug on our end and that there isn't going to be any workaround. I'd still like to know what you're own testing finds, but I also don't want to set unrealistic expectations the possibility of a workaround.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

@DTS Engineer Hi Kevin,

Thank you for the response, I understand what you meant by testing with different accessories now. Please find the results below.

  1. Reproduce the issue with Accessory 1
  2. Test with accessory 2.
  • Does Accessory 2 immediately fail or does it work once and THEN fail (just like Accessory 1)?

Accessory 2 fails immediately. Does not work even once.

  1. Perform stage 1 with Accessory 1 (do the "working" test, but to NOT generate the actual failure).
  2. Test with Accessory 2.
  • Does Accessory 2 work once then fail, or does it fail immediately?

Accessory 2 fails immediately. Does not work even once.

Let me know if you need additional information!

Thanks, Amith

@DTS Engineer Hi Kevin,

We found some new information that may be helpful for you to diagnose the problem.

We bought a different MFi accessory from another company (Lets call it Accessory B for reference) that we thought could potentially use iAP. This was proved correct after using ATS to analyze the traffic. Here are the findings

  • Accessory B uses "iAP2 EA Session" where as our accessory uses "EA Native Transport"
  • We cannot reproduce the connection issue with Accessory B on iOS18. i.e. even after multiple disconnects/reconnects it is able to open the session.

So it looks like this issue only affects the "EA Native Transport" option but not the "iAP2 EA Session". I am not sure if this helpful but we thought it was worth sharing.

Again please let us know if you need additional information to debug the issue.

Thanks, Amith

@DTS Engineer Hi Kevin, Were there any updates from your side from our updated information shared last week or the bug in general?

We are extremely concerned because over half a million of our products have been sold to 100,000s customers (all schools and universities), and this issue has now affected thousands of our customers. We always recommend the use of our product with an iOS device, so this issue now reflects extremely negatively on both of our companies. Given that all of them are in an educational environment, they all depend on our tools daily.

Here is just a sliver of feedback we get daily from our extremely disappointed customers, copy and pasted and attached for your reference:

Customer Feedback:

“Our Apple IPADS have updated to IOS 18 and we are currently unable to use the (your) device. Will there be an update to the Swivl app to connect? Do I need to purchase a new device, if so, how long will this be supported for?

“We have recently purchased a Swivl CX-3 and wanted to use it with our iPad mini 2 (6th gen) running iOS 18.1. Unfortunately, the Swivl Capture App running version 10.5.2 does not always want to connect to the Swivl Robot. It is impossible for us to use the robot reliably in a school setting because of this issue. I hope to hear from you soon about this issue.”

Please let us know what we can do to help Apple debug this issue!

EASession return nil on iOS18
 
 
Q