Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
Enhanced Microphone not Working Android
Problem Description
I already asked to resolve this problem. But until now nothing happened. On Android Phones, in my Case Samsung S9+ the Enhanced Microphone does not work anymore. What happens: The Phone is muted. Even moving all Volume Sliders to the maximum. It seems that the enhanced microphone sets the volume of the speakers to 0 On my Tablet - Samsung Tab S6 Lite - the enhanced Microphone works.
- Which AIR SDK did you use? 50.2.1.1
- Android 9, Samsung s9+
Steps to Reproduce
Adding enhanced Microphone as Standard Microphone
My Code which does not work on phone:
_mic = Microphone.getEnhancedMicrophone(); options = new MicrophoneEnhancedOptions(); options.mode = MicrophoneEnhancedMode.FULL_DUPLEX; options.echoPath = 256; options.autoGain = false; options.nonLinearProcessing = true; _mic.enhancedOptions = options; _mic.codec = SoundCodec.SPEEX; _mic.gain = 80; _mic.setSilenceLevel(0); _mic.rate = 11; _mic.framesPerPacket = 1; _mic.encodeQuality = 6; _mic.setLoopBack(false);
Code which works:
_mic = Microphone.getMicrophone(); _mic.codec = SoundCodec.SPEEX; _mic.gain = 80; _mic.setSilenceLevel(0); _mic.rate = 11; _mic.framesPerPacket = 1; _mic.encodeQuality = 6; _mic.setLoopBack(false);
Known Workarounds
Using the normal Microphone settings. But the problem is, that I need the enhanced Mic working, because I have a Video chat function in my App.
Maybe this time this problem can be resolved.
@ajwfrost Hi, do you have any idea how to resolve this?
Hi @apofis1969 - apologies for not getting back on this one earlier. I was asking one of my colleagues to look at that, we're currently unable to reproduce this though. Although there may be some other problem, since we're currently getting activity level -1 even through the 'muted' value is false.... But the above code is all run without any impact on a sound that is playing back at the time...
Are you able to create a simple but self-contained test case for this one and we can try to reproduce it here?
thanks
Hi @ajwfrost, thanks for your reply. It is happening together with a video stream. I can send you a apk-debug version of my app with enhanced microphone only.
hi @ajwfrost I realised, that with 50.2.2.2 the sound quality at iOS is very bad. As well the enhanced microphone mutes the devices, if both use the enhanced microphone. This happens together with a video stream. After the video stream is loaded at the destination device, e.g. from ipad to iphone with ios 16.3 the sound volume is incredible high and the sound quality is metallic. After this "explosion" the sound volume goes down to a very low level. Only restarting the app resolves this. I am complaining about the microphone problem since 2 years. Why it is from your side impossible to resolve the multimedia settings (sound and video)? I may help and test all changes. The app depends on this and we are struggling with this since 2 years or more. We had to remove wowza, because did not accept Speex. Created bugs. We can not use RED5 Pro because does not accept SPEEX. So we had to adapt the RED5 open source for our needs. This way it can not continue.
@apofis1969 yes multimedia has been a pain for us, mostly because of the removal of the original software codecs that Adobe had been using. It (perhaps) made sense for them to pay all the licensing fees for those, in the same way it made sense for them to give away the Flash Player, AIR SDK, etc.. sadly for us it's a different commercial model!
Because of the massive number of changes that have happened in this area in Flash/AIR over the years, the code is incredibly complex and fairly fragile i.e. a small change has a big chance of causing unexpected side effects, as we found out very early on. So our plan was to create a new multimedia framework that could be done using more modern platform APIs and simplifies things a bit to focus on the primary use cases. This is still the goal but it's taking a lot longer than anticipated. We've got a lot of the framework done on Windows, and need to start rolling this out to the other platforms.
Just to confirm what you're trying to do here - is this to record both audio and video and upload them to an origin server such as red5 or wowza? Are you using rtmp for this or something else? Preferences on the codecs and container formats to be used? We'll have to see what's available for each platform - we're also trying to design this such that it's possible to add ANEs to improve/extend the capabilities.
Apologies that this is all taking a long time though, I can understand your frustration.
thanks
hi @ajwfrost, would it help if I send you a debug version of my app? To create a streaming app is a lot of work and takes time. Even with copy and paste.... I can send you 2 versions: 1 with the getMicrophone and the 2nd version with getEnhancedMicrophone. Would this help?
On iOS the challenge is that if you sent us an IPA file, we can't then adjust it to make it call our own implementations of the functions; it would need to be a package-ready version of the app i.e. after you've compiled it to SWF etc, but before packaging it into IPA file. If you're willing to provide that to us, then yes I think it would help - although we're also likely to need to set up a server for this I guess, to pick up the media stream and be able to inspect what's coming through? Do you have a local/test server that you use?
thanks
Hi @ajwfrost I can setup a test server. Yes of course, I only do a build with IntelliJ and send you the SWF and the -app.xml, libraries, splash screens,... I can setup the same server configuration with red5 as I am using now. I think a small server is enough to test. Just tell me the region and I will start to prepare all this for you. Please tell me, if this would be an acceptable way for you. I will also send you for Android the swf, -app.xml and all the libraries. One SWF with mic normal and one swf with enhanced only - iOS and Android
hi @ajwfrost, do you want me to prepare the files and the test server?
Hi @apofis1969 - yes, sorry, that would be very useful! Appreciate the effort to get this set up... If you need to upload files, please use https://transfer.harman.com/requests/fYCxgQYvFRK1A8xM54tTbo Regionally, we're split between the UK and India; I would suggest for this we can primarily do it from the UK. thanks
Hi @ajwfrost, I will prepare the server in London this weekend. And send you the files as well. Hopefully the link will be valid until monday 3rd of April.
Awesome thanks
Hi @ajwfrost, I am a little late with my time-schedule. I already made the swfs for android. The server setup is missing and the iOS. Will be ready tomorrow. Hopefully the link is still valid.
Hi @ajwfrost, I could send the files today. Hope I could help. If you need anything, please tell me.
Hi @ajwfrost, I think I could find the problem with the enhanced microphone. On Android the enhanced microphone roots the sound to the phone call section and not to the media as the normal microphone is doing. Especially on the Phone this causes problems with sound output together with a video stream.
On iOS Phones I get a huge delay of the sound transmission or the speakers get muted suddenly. On tablet this problem does not appear.
On Android the sound is metallic and interrupted on the phone after activating the enhanced microphone on the phone. Both devices, phone and tablet do not show the media volume, show the phone call volume. But on the tablet this does not have this side effect such as on the phone.
On Mac this problem does not exist.
Is there a way to root the enhanced mic stream also only to the media section of the mobile devices? I think this would resolve the problem.
Please help, I need to send this update urgently and I spent a lot of time in investigating and testing.
Hi @ajwfrost, I sent you some emails without getting a response. I am desperately waiting for a solution or at least an update concerning the implementation to fix the issues with muted sound/mic on iOS and the runtimes for Android with a working echo cancellation. Concerning the issue #2642, it seems to be similar when sending a sound stream to the iPad from iPhone with enhanced microphone. The volume is extremely high, even the volume of the speakers is set to almost 0. If you need I send you the files of the updated iOS and macOS version Thank you!
Hi @ajwfrost since October 2020 I am complaining about the enhanced microphone problem. Now already 3 years passed (#487). Until now nothing happened and my app is going down because of this problem. It depends on this functionality. i think that this is sad, because destroys an app which had been created and was successful. Now I am already thinking to disable the app. I think you should know this and hopefully you will finally resolve this problem. Because Adobe air is a multimedia SDK as well. Within the streaming codecs and microphone functionality absolutely nothing happened. A frustrated developer.
@ajwfrost hi, will there be a Solution or will it continue how it is? It is impossible to use modern streaming platforms with all these old codecs. One more update of Adobe Air without resolving this problem.
@ajwfrost Hi, unfortunatelythe multimedia part ist still a huge problem. I tried to use the Audiorecorder ANE, which includes the AAC Codec. I can get one or 2 streams working, but then the app crashes. Just as information. The main problem which you maybe could resolve is, that the microphone gets deactivated when closing a stream. Unfortunately the microphone stays activated until pushing the app away. Is there a way to handle this? Thanks!