talk-android icon indicating copy to clipboard operation
talk-android copied to clipboard

No microphone input on Android 9 and below

Open MmAaXx500 opened this issue 8 months ago • 13 comments

Steps to reproduce

  1. Take an emulator or a physical device with Android 9 or lower
  2. Receive an audio call
  3. Produce some sound on the device in question
  4. 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

talk-android9-call.txt

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() and micInputAudioRecordThread!!.start() in startMicInputDetection() is commented out

MmAaXx500 avatar Apr 21 '25 18:04 MmAaXx500

Thank you for the detailed info @MmAaXx500 👍 We will have a closer look soon!

mahibi avatar Apr 30 '25 07:04 mahibi

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...

mahibi avatar Apr 30 '25 09:04 mahibi

I didn't find earlier, but #4675 might be the same issue. It is in the 21.0.1 milestone.

MmAaXx500 avatar Apr 30 '25 09:04 MmAaXx500

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

muchachagrande avatar May 02 '25 20:05 muchachagrande

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.

MmAaXx500 avatar May 02 '25 21:05 MmAaXx500

@mahibi could we have an action build reverting microphone detection? Would greatly help investigating this

farfromrefug avatar May 12 '25 05:05 farfromrefug

@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 avatar May 12 '25 09:05 MmAaXx500

@MmAaXx500 Is it possible possible for you to build an APK? I would love to try it.

Simounet avatar May 14 '25 07:05 Simounet

@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.

MmAaXx500 avatar May 14 '25 08:05 MmAaXx500

I can confirm that @MmAaXx500 version fixed my microphone issue.

Simounet avatar May 15 '25 15:05 Simounet

Hi, sorry this one slipped through! Thank you @MmAaXx500 for analyzing and trying out! We will have a closer look

mahibi avatar Jun 04 '25 08:06 mahibi

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?

freeflyk avatar Nov 01 '25 22:11 freeflyk