smartdevicelink / sdl_ios

Get your app connected to the 🚙, make your users feel like a 🌟
www.smartdevicelink.com
BSD 3-Clause "New" or "Revised" License
169 stars 105 forks source link

Error handling needed in CarWindow for failed frame encoding #1540

Open NicoleYarroch opened 4 years ago

NicoleYarroch commented 4 years ago

Bug Report

Sometimes the pixelBuffer in SDLCarWindow is invalidated when the app is put in the background due to a VideoToolbox bug. This means that the CarWindow API can not encode the video frames and thus no video frames are sent to the head unit.

  1. This is sometimes fixed by putting the app on the device in the background and then bringing it back to the foreground. When the app is brought back to the foreground the videoEncoder is destroyed and recreated in the SDLStreamingVideoLifecycleManager. I believe this is what fixes the issue. We should try to reset the videoEncoder when the the pixelBuffer is nil.
  2. However if the bug persists after a few seconds then we should stop video streaming and let the developer know that video could not stream because of an error.
Reproduction Steps
  1. Connect navigation app using the CarWindow API to a SYNC 3 head unit. Open the SDL app.
  2. Turn off the ignition and close the doors. When screen goes dark, turn off the head unit by toggling the on/off switch on the back of the head unit. (Don't just switch off the TDK because then the library will sometimes not get a accessory disconnected notification)
  3. Lock the iPhone (This is what causes the VideoToolbox bug).
  4. Turn the TDK back on again and turn on the ignition.
  5. Unlock the iPhone
  6. If necessary, select the SDL app on the HMI.
Expected Behavior

The video streams to the head unit.

Observed Behavior

The CarWindow class does not stream video some of the time due to video encoding failing. This could happen the first time or tenth time the app is backgrounded.

OS & Version Information
E-SAITO-TMC commented 4 years ago

@joeygrover -san @theresalech -san This issue is a top priority for Toyota. Can the reproduction steps described actually reproduce this issue?

joeljfischer commented 4 years ago

@E-SAITO-TMC The underlying issue causing the pixelBuffer to become nil was fixed, however proper error handling has not yet been added.

E-SAITO-TMC commented 4 years ago

@joeljfischer -san Thank you, I understand. When will error handling be added?

joeljfischer commented 4 years ago

@E-SAITO-TMC It will not be added in the release next week, and we have not begun planning for future releases. We will consider it for the July release.

E-SAITO-TMC commented 4 years ago

@joeljfischer -san I understand. Thank you for your cooperation.