Problem with audio input in Android device (Galaxy S10)

Hi there!

We’ve run into a strange issue with a Samsung Galaxy S10 device. For some reason, RuntimeManager.CoreSystem.getRecordDriverInfo returns a channel count of 2 (stereo). Which shouldn’t be the case, as it doesn’t have a stereo microphone.

I’m trying to force to mono, but the resulting audio is not usable / sample values are 0. This is the code we’re using:

            CREATESOUNDEXINFO exinfo = default;
            exinfo.cbsize = Marshal.SizeOf(typeof(CREATESOUNDEXINFO));
            exinfo.numchannels = 1;
            exinfo.format = SOUND_FORMAT.PCMFLOAT;
            exinfo.defaultfrequency = deviceSampleRate;
            exinfo.length = (uint)(deviceSampleRate * sizeof(float));
            var sys = RuntimeManager.CoreSystem;
            if (!Check(sys.createSound("recording", MODE.LOOP_NORMAL | MODE.OPENUSER, ref exinfo, out _sound), "Failed to call `createSound`"))
                return null;

            if (!Check(_sound.getLength(out _soundLength, TIMEUNIT.PCM), "Failed to call `getLength`"))
                return null;

            if (!Check(_sound.getFormat(out var st, out var sf, out var sc, out var sb), "Failed to call `getFormat`"))
                return null;
            Log.Debug($"FMOD Recording SoundType:{st} Format:{sf} Channels:{sc} Bits:{sb} freq:{deviceSampleRate}");

            // Start recording into the sound buffer
            if (!Check(sys.recordStart(_deviceID, _sound, true), "Failed to call `recordStart`"))
                return null;
            IsRecording = true;

Is this approach correct? Should we try any other settings? The thing is that on this S10 device, other apps are using the device mic just fine. That means to me that there must be an issue with FMOD or our implementation.

Maybe you have an idea what this could be about; and what we should try next. Thank you!

Hi,

Thank you for sharing the code. Unfortunately, I was unable to reproduce the issue from our end.

Can I get the version number of the FMOD and FMOD Unity integration plugin you are using?

Also, would it be possible for you to download the OboeTester to your Galaxy S10 device and run a RECORD AND PLAY test to check the Channels number and share a screenshot with us?

Thank you for looking into this!
We are on FMOD Studio Unity Integration 2.02.19, and FMOD Studio itself shows the same version.

This is what OboeTester shows us:

Thank you for sharing the screenshot! It seems that Galaxy S10 does have 2 channels, and I can see clearly that you already force them to mono by setting the channel number to 1.

I apologize if my previous reply was unclear. Could you please click the RECORD button while you are in Recorder Test and check if any bars show up at the bottom? Just want to confirm how many bars are shown up and if they are responding correctly based on the direction where sound comes from.

Here is a video pressing record and checking out the results: VID_20240605_212838.mp4 - Google Drive

The bars at the bottom don’t seem to do anything. Does that mean it’s a device/os issue and not FMOD? I do wonder why other apps seem to be recording and using the MIC fine…

Thanks for the video! Yes, I agree with you, It doesn’t seem like your device’s issue if you can get other recording apps working properly.

In your Unity project, could you please try ticking Enable API Error Logging, setting Logging Level to Log within your FMOD Settings? (FMOD => Editor Settings),
Would it be possible for you to share a Log file saved to a text file from your device while running the mono recording project? It would help us to pinpoint the issue if you could upload it to your profiler.