Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

[Linux] Scout session stops sometimes on `Stage3D`/`Context3D` errors

Open itlancer opened this issue 6 months ago • 0 comments

Problem Description

Scout session stops sometimes with error. Usually it happens when some error happens with Stage3D/Context3D.

Tested with multiple AIR versions, even with latest AIR 51.2.1.4 with multiple different Linux devices, OS versions with different applications. The same issue in all cases when Stage3D/Context3D error happens. 100% reproducible with Linux. But sometimes it observed with more complex scenarios with Android too. This makes very difficult to debug applications using Stage3D/Starling.

Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/1621 https://github.com/airsdk/Adobe-Scout/issues/6 https://github.com/airsdk/Adobe-Runtime-Support/issues/3833 https://github.com/airsdk/Adobe-Runtime-Support/issues/3794 https://github.com/airsdk/Adobe-Runtime-Support/issues/2910 https://github.com/airsdk/Adobe-Runtime-Support/issues/2296

Steps to Reproduce

Set up Scout and launch application with code below with any Linux device. It tries to load texture image in async mode but fails because of https://github.com/airsdk/Adobe-Runtime-Support/issues/1621. This sample uses Starling cause I cannot reproduce yet this issue in simple case with pure Stage3D.

Application example with sources attached. starling_linux_image_bug.zip

package {
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.display3D.Context3DTextureFormat;
	import flash.events.Event;
	import starling.display.Image;
	import starling.textures.Texture;
	
	public class StarlingLinuxImageBug extends Sprite {
		
		[Embed(source="arrow.png")]
		private var Picture:Class;

		/**
		 * Starling texture
		 */
		private var _starlingTexture:Texture;
		
		/**
		 * Starling bitmapdata holder
		 */
		private var _starlingImage:Image;

		public function StarlingLinuxImageBug() {
			addEventListener(Event.ADDED_TO_STAGE, this_addedToStage);
		}

		private function this_addedToStage(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, this_addedToStage);
			init();
		}
		
		private function starling_inited(e:Event):void {
			init();
		}

		private function init():void {
			if (!StarlingManager.instance.inited) {
				StarlingManager.instance.addEventListener(Event.COMPLETE, starling_inited);
				StarlingManager.instance.init(stage);
				return;
			}
			try {
				Texture.asyncBitmapUploadEnabled = true;//This line cause image not visible
				_starlingTexture = Texture.fromBitmapData((new Picture() as Bitmap).bitmapData, false, false, 1, Context3DTextureFormat.BGRA, false, onTextureComplete);
			} catch (e:Error) {
				trace("error", e.message);
			}
		}
		
		private function onTextureComplete(t:Texture):void {
			trace("texture complete");
			_starlingImage = new Image(_starlingTexture);
			StarlingManager.instance.root.addChild(_starlingImage);
		}
		
	}
}

Actual Result: In Scout session will be stopped with error: Image

Expected Result: Scout session not stopped.

Known Workarounds

none

itlancer avatar May 31 '25 21:05 itlancer