No microphone input on Android 9 and below
Steps to reproduce
- Take an emulator or a physical device with Android 9 or lower
- Receive an audio call
- Produce some sound on the device in question
- Observe that no sound was transmitted to the other party
Expected behaviour
Sound is being transmitted.
Actual behaviour
No sound is being transmitted.
Device brand and model
Emulator / Cubot Kingkong Mini
Android version
9
Nextcloud Talk app version
21.0.1
Nextcloud server version
No response
Talk version
No response
Custom Signaling server configured
Yes (specify version in Additional Information)
Custom TURN server configured
Yes
Custom STUN server configured
Yes
Android logs
Log of a call
Server log
Additional information
Snippet from the log that I think is relevant
W org.webrtc.Logging: WebRtcAudioRecordExternal: Potential microphone conflict. Active sessions: 1
I org.webrtc.Logging: WebRtcAudioRecordExternal: startRecording
D ParticipantsAdapter: hasSurface: false
E AudioRecord: start() status -38
E org.webrtc.Logging: WebRtcAudioRecordExternal: Start recording error: AUDIO_RECORD_START_STATE_MISMATCH. AudioRecord.startRecording failed - incorrect state: 1
I think the issue is that the mic is used in two places simultaneously (WebRTC and startMicInputDetection()). AFAIK, that feature is added in Android 10. See: https://source.android.com/docs/core/audio/concurrent
Further details:
- There is no issue on Android 10
- Audio is working on Android 9 if
micInputAudioRecorder.startRecording()andmicInputAudioRecordThread!!.start()instartMicInputDetection()is commented out
Confirmed on a Samsung Galaxy Note8 (SM-N950W) (Android 9) too.
Thank you for the detailed info @MmAaXx500 👍 We will have a closer look soon!
Also a user review from gplay (using Android 9):
Unfortunately, this update does not seem to fix the problem with the microphone, even though it says so in the fix description. You can record and send voice messages but when I'm on the phone my smartphone remains silent on the other side...
I didn't find earlier, but #4675 might be the same issue. It is in the 21.0.1 milestone.
I have this issue on a Lineage 21 (Android 14) on a Raspberry Pi panel with a USB microphone.
It stopped working long ago after some update, I think 17.0.x, can't remember exactly.
There are some other opened issues that may be related to this problem: https://github.com/nextcloud/talk-android/issues/4675, https://github.com/nextcloud/talk-android/issues/3834 and the oldest https://github.com/nextcloud/talk-android/issues/3327
The microphone double usage is introduced in https://github.com/nextcloud/talk-android/commit/a58a5df3ec65d3f4136b58ee4494ef2f34d73004 (https://github.com/nextcloud/talk-android/pull/3298). This change first appeared in release 17.1 on 2023-09-15, which aligns with the other reported issues.
@mahibi could we have an action build reverting microphone detection? Would greatly help investigating this
@farfromrefug I have a commit that disables the mic detection on <= Android 9. https://github.com/MmAaXx500/talk-android/commit/c6a5de497131f9465504042d956020f0df14e6aa However, it breaks features like speaker highlight and time spoken.
@MmAaXx500 Is it possible possible for you to build an APK? I would love to try it.
@Simounet Uploaded one there: https://github.com/MmAaXx500/talk-android/releases/tag/v21.0.1-4888-dummy built from the issue-4888-no-micdetect branch.
This a QA version that you can install alongside of the official one, but it will have no notifications (normal for QA versions), so be aware of that when testing.
I can confirm that @MmAaXx500 version fixed my microphone issue.
Hi, sorry this one slipped through! Thank you @MmAaXx500 for analyzing and trying out! We will have a closer look
Hi. Is there any update on this issue? I do have the same problem with one of my devices, which is running LineageOS 23 (ASOP). It shows the same Logs reported by @MmAaXx500. Rebuilding Talk with the line commented out also fixed the issue for me. However, since my device runs Android 16, disabling the function for Android 9 or below would not fix the issue. What I did so far is to add an additional option in the settings to disable the microphone input detection manually. Although it may break some other functionality, it at least enables me to use the app. Maby such an option would be a at least temporarily way to use the app on such devices?