You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application hangs on close with started Worker after audio usage stop.
So there is no way to correct close application in such cases.
It happens with Sound and with NetStream too.
Tested with multiple AIR 51 versions, even with latest AIR 51.1.3.2 with multiple different Linux x86_64 devices (physical and VM), different OS versions and different applications. With and without sudo privileges. With and without workarounds mentioned here #3450.
Tested with multiple Ubuntu x86_64 22.04.4 LTS and Ubuntu x86_64 24.04.1 LTS devices with different window managers.
Same issue in all cases.
There is no such issue with other platforms.
Launch code below with any Linux x86_64 device.
Notice: launch it from terminal/console to detect that process will not be finished.
Audio file playback will be started. Click anywhere on stage - it will cause sound will be stopped and NativeApplication.nativeApplication.exit() called to close application.
package {
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.desktop.NativeApplication;
import flash.system.Worker;
import flash.system.WorkerDomain;
public class LinuxSoundCloseWorkerHang extends Sprite {
private var soundChannel:SoundChannel;
private var worker:Worker;
public function LinuxSoundCloseWorkerHang() {
if (Worker.current.isPrimordial) {
addEventListener(Event.ADDED_TO_STAGE, init);
} else {
trace("worker");
}
}
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes, true);
worker.start();
var sound:Sound = new Sound(new URLRequest('audio.mp3'));
soundChannel = sound.play();
stage.addEventListener(MouseEvent.CLICK, click);
}
private function click(e:MouseEvent):void {
trace("click");
soundChannel.stop();//This line cause application hang on exit
//worker.terminate();//This line doesn't help here
NativeApplication.nativeApplication.exit();
}
}
}
Actual Result:
Audio playback stop, application visually will be "closed" but application process still will not be finished. You can see it in terminal.
Expected Result:
Application will be closed properly.
Known Workarounds
Terminate Worker before application exit and wait for WorkerState.TERMINATED state.
package {
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.desktop.NativeApplication;
import flash.system.Worker;
import flash.system.WorkerDomain;
import flash.system.WorkerState;
public class LinuxSoundCloseWorkerHang extends Sprite {
private var soundChannel:SoundChannel;
private var worker:Worker;
public function LinuxSoundCloseWorkerHang() {
if (Worker.current.isPrimordial) {
addEventListener(Event.ADDED_TO_STAGE, init);
} else {
trace("worker");
}
}
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes, true);
worker.start();
var sound:Sound = new Sound(new URLRequest('audio.mp3'));
soundChannel = sound.play();
stage.addEventListener(MouseEvent.CLICK, click);
}
private function workerStateChanged(e:Event):void {
trace("workerStateChanged", worker.state);
if (worker.state == WorkerState.TERMINATED){
NativeApplication.nativeApplication.exit();
}
}
private function click(e:MouseEvent):void {
trace("click");
soundChannel.stop();
worker.addEventListener(Event.WORKER_STATE, workerStateChanged);
worker.terminate();
}
}
}
The text was updated successfully, but these errors were encountered:
Problem Description
Application hangs on close with started
Worker
after audio usage stop.So there is no way to correct close application in such cases.
It happens with
Sound
and withNetStream
too.Tested with multiple AIR 51 versions, even with latest AIR 51.1.3.2 with multiple different Linux x86_64 devices (physical and VM), different OS versions and different applications. With and without
sudo
privileges. With and without workarounds mentioned here #3450.Tested with multiple Ubuntu x86_64 22.04.4 LTS and Ubuntu x86_64 24.04.1 LTS devices with different window managers.
Same issue in all cases.
There is no such issue with other platforms.
Related issues:
#3619
#3505
#3498
#3453
#3452
#3450
#3389
#2523
#1984
Steps to Reproduce
Launch code below with any Linux x86_64 device.
Notice: launch it from terminal/console to detect that process will not be finished.
Audio file playback will be started. Click anywhere on stage - it will cause sound will be stopped and
NativeApplication.nativeApplication.exit()
called to close application.Application example with sources and audio sample attached.
linux_sound_close_worker_hang.zip
Actual Result:
Audio playback stop, application visually will be "closed" but application process still will not be finished. You can see it in terminal.
Expected Result:
Application will be closed properly.
Known Workarounds
Terminate
Worker
before application exit and wait forWorkerState.TERMINATED
state.The text was updated successfully, but these errors were encountered: