Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Empty AudioDeviceManager.audioDeviceManager.deviceNames under sudo #3453

Open
itlancer opened this issue Sep 8, 2024 · 0 comments
Open
Labels

Comments

@itlancer
Copy link

itlancer commented Sep 8, 2024

Problem Description

AudioDeviceManager.audioDeviceManager.deviceNames return empty array when AIR application run under sudo with Linux.
Sometimes multimedia applications should be run with root privileges (for example when autostart enabled). That's why it is crucial.
In such cases there is no way to use AudioDeviceManager right now.

Tested with multiple AIR versions, even with latest AIR 51.1.1.3 with multiple different Linux x86_64 devices (VM and real), different OS versions and different applications.
There is no such issue without sudo.
There is no such issue using aplay.
There is no such issue with other platforms.

Related issues:
#3452
#3450
#1984
#365

Steps to Reproduce

Launch application with code below with any Linux under sudo:
sudo ./linux_audiodevicemanager_devicenames_empty_root_bug
It should trace audio output devices.

Application example with sources attached.
linux_audiodevicemanager_devicenames_empty_root_bug.zip

package {
	import flash.display.Sprite;
	import flash.media.AudioDeviceManager;
	
	public class LinuxAudioDeviceManagerDeviceNamesRootBug extends Sprite {
		
		public function LinuxAudioDeviceManagerDeviceNamesRootBug() {
			trace(AudioDeviceManager.audioDeviceManager.deviceNames);//Empty under sudo
		}
	}
}

Actual Result:
AudioDeviceManager.audioDeviceManager.deviceNames return empty array.

Expected Result:
AudioDeviceManager.audioDeviceManager.deviceNames return audio output devices.

Known Workarounds

  1. Use aplay -l or other with NativeProcess to get audio output devices.
  2. Write own native extension to get audio output devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant