FIXED: Previews don't show contents on some iPad models

Report bugs and check on fixing progress. This version is not available anymore, please go to the VisualSwift - Music forum above.
Post Reply
numbuh37
Posts: 9
Joined: Thu Jul 23, 2020 7:38 pm

FIXED: Previews don't show contents on some iPad models

Post by numbuh37 » Sat Jul 25, 2020 7:40 pm

Platform: iPad Air 2, iOS 13.5.1
Version: 0.5.13
Problem: The top level schematic and sub-schematics don't display their contents.

Steps to reproduce:
  1. Add a VStack or HStack to the top level schematic
  2. Add any component such as a color, text, or a bundled component.
  3. Connect all together
Expected behavior: Components are displayed in the VStack or HStack in the top level schematic. Sub components display their contents in the lower level schematic (color shows a background color, text shows the text contents, etc.).

Current behavior: 99% of the time nothing displays in component views either at the top level or in the sub components. On rare occasions something does display. I've not been able to find steps to reproduce making something display.

The MacOS version displays as it should, even with the same maps that don't work on the iPad.

Screen shot from iPad:
IMG_DBBDE46D0468-1.jpeg
IMG_DBBDE46D0468-1.jpeg (179.87 KiB) Viewed 21236 times
Last edited by numbuh37 on Sun Jul 26, 2020 8:23 pm, edited 3 times in total.

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: Previews don't show contents on iPad Air 2

Post by jorge » Sat Jul 25, 2020 9:50 pm

Thanks, this is very useful as I haven't come across is so far. I don't have an iPad Air 2 but I do have an older iPad which I'll start using for testing, hopefully I'll be able to replicate the issue with it. I'll report back here.

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: Previews don't show contents on iPad Air 2

Post by jorge » Sun Jul 26, 2020 11:32 am

Luckily my 2nd generation iPad Pro had the same issue. Hopefully it is fixed in version 0.5.14 but because it's an intermittent bug I'm not completely sure. I think the issue was caused by the Text component.

numbuh37
Posts: 9
Joined: Thu Jul 23, 2020 7:38 pm

Re: Previews don't show contents on iPad Air 2

Post by numbuh37 » Sun Jul 26, 2020 7:28 pm

Looks better! VStack is working. HStack still has the problem. v0.5.14
IMG_3455872D628D-1.jpeg
IMG_3455872D628D-1.jpeg (203.1 KiB) Viewed 21220 times

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: Previews don't show contents on iPad Air 2

Post by jorge » Sun Jul 26, 2020 7:40 pm

Thanks, I get the same behaviour. I think I have a fix, I'm now uploading v0.5.15.

numbuh37
Posts: 9
Joined: Thu Jul 23, 2020 7:38 pm

Re: Previews don't show contents on iPad Air 2

Post by numbuh37 » Sun Jul 26, 2020 8:17 pm

Thanks! Confirmed - it is working for VStack and HStack (even nested) in 0.5.15.
Should I change the title to reflect *SOLVED* or leave it as-is for now?

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: Previews don't show contents on iPad Air 2

Post by jorge » Sun Jul 26, 2020 8:18 pm

Yes please, feel free to change the title.

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: FIXED: Previews don't show contents on some iPad models

Post by jorge » Mon Jul 27, 2020 9:02 am

I've noticed that while fixing the bug for iPad Air 2 and 2nd generation iPad Pro, the 3rd generation iPad Pro is now not as smooth as before.

I'll give some detail which can be useful for anyone testing:

There is a modifier in SwiftUI called "drawingGroup" which when applied to a SwiftUI Views makes them run really fast using the devices GPU. On a 3rd generation iPad Pro this makes a very big difference, scrolling the schematics in VisualSwift becomes incredibly smooth specially with the 120fps screen refresh.

In VisualSwift all component's canvases use the drawingGroup except when it's a control like a TextField or some views that I didn't yet make available like a Metal view for shaders or SceneKit ScnView ( I'm trying to focus on polishing the current features but the intention is to eventually plug the audio to visual effects ).

The bug that originated this thread is caused by using drawingGroup on components like the Text component that shouldn't need it. By removing drawingGroup from all canvases makes them work properly on the iPad Air 2 and 2nd generation iPad Pro but removes the big performance improvements on 3rd generation iPad Pro. From the small amount of information I found online this seems to be an Apple bug related with GPU acceleration and probably only fixable by them.

I think the solution for now will be to detect the device and enable drawingGroup for 3rd generation and higher and remove for older iPads. Because VisualSwift is only at the beginning, I need to look forward and make the latest hardware a priority.
I find the whole experience of the 3rd generation 12.9 iPad Pro with Magic Keyboard quite amazing.

jorge
Site Admin
Posts: 53
Joined: Sat Nov 30, 2019 2:17 pm

Re: FIXED: Previews don't show contents on some iPad models

Post by jorge » Mon Jul 27, 2020 10:40 am

Here's the solution I came up with ( for now ) to allow older devices to work and more recent devices to take full advantage of the GPU:

In the settings you now have a Toggle switch for enabling/disabling GPU:

Image


All the devices in the following list will be initialised with the toggle switch off although you will still be able to override the initialisation and switch it on, you'll have to close the schematic and open again for the setting to take effect or somehow cause the canvases to reload:

iPad1,1 : iPad
iPad1,2 : iPad 3G
iPad2,1 : 2nd Gen iPad
iPad2,2 : 2nd Gen iPad GSM
iPad2,3 : 2nd Gen iPad CDMA
iPad2,4 : 2nd Gen iPad New Revision
iPad3,1 : 3rd Gen iPad
iPad3,2 : 3rd Gen iPad CDMA
iPad3,3 : 3rd Gen iPad GSM
iPad2,5 : iPad mini
iPad2,6 : iPad mini GSM+LTE
iPad2,7 : iPad mini CDMA+LTE
iPad3,4 : 4th Gen iPad
iPad3,5 : 4th Gen iPad GSM+LTE
iPad3,6 : 4th Gen iPad CDMA+LTE
iPad4,1 : iPad Air (WiFi)
iPad4,2 : iPad Air (GSM+CDMA)
iPad4,3 : 1st Gen iPad Air (China)
iPad4,4 : iPad mini Retina (WiFi)
iPad4,5 : iPad mini Retina (GSM+CDMA)
iPad4,6 : iPad mini Retina (China)
iPad4,7 : iPad mini 3 (WiFi)
iPad4,8 : iPad mini 3 (GSM+CDMA)
iPad4,9 : iPad Mini 3 (China)
iPad5,1 : iPad mini 4 (WiFi)
iPad5,2 : 4th Gen iPad mini (WiFi+Cellular)
iPad5,3 : iPad Air 2 (WiFi)
iPad5,4 : iPad Air 2 (Cellular)
iPad6,3 : iPad Pro (9.7 inch, WiFi)
iPad6,4 : iPad Pro (9.7 inch, WiFi+LTE)
iPad6,7 : iPad Pro (12.9 inch, WiFi)
iPad6,8 : iPad Pro (12.9 inch, WiFi+LTE)
iPad6,11 : iPad (2017)
iPad6,12 : iPad (2017)
iPad7,1 : iPad Pro 2nd Gen (WiFi)
iPad7,2 : iPad Pro 2nd Gen (WiFi+Cellular)
iPad7,3 : iPad Pro 10.5-inch
iPad7,4 : iPad Pro 10.5-inch
iPad7,5 : iPad 6th Gen (WiFi)
iPad7,6 : iPad 6th Gen (WiFi+Cellular)
iPad7,11 : iPad 7th Gen 10.2-inch (WiFi)
iPad7,12 : iPad 7th Gen 10.2-inch (WiFi+Cellular)

If this becomes an issue, I'll work on caching the preview canvases as images to improve performance of older devices.

Post Reply