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

Cannot record a voice message #3904

Closed
532910 opened this issue Aug 26, 2021 · 30 comments
Closed

Cannot record a voice message #3904

532910 opened this issue Aug 26, 2021 · 30 comments
Labels
A-Voice-Messages O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@532910
Copy link
Contributor

532910 commented Aug 26, 2021

Steps to reproduce

I dunno how to reproduce this.
https://user-images.githubusercontent.com/14617699/130969769-e454062e-1672-4c30-bb42-7bc612eeea82.mp4

All permissions are granted and voice/video calls works as expected.

What did you expect?

A recorded voice message.

What happened?

Unable to record a voice message.

Your phone model

No response

Operating system version

No response

Application version and app store

No response

Have you submitted a rageshake?

Yes

@532910 532910 added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Aug 26, 2021
@jdannenberg
Copy link

I can confirm this bug and add a few details from my side:

Element Android 1.20.0 (Fdroid)
Android 11 / LineageOS (4microg) 18.1
LG G5 (H850)

@532910
Copy link
Contributor Author

532910 commented Aug 27, 2021

on Android 11 / LineageOS (4microg) 18.1, OP3T GPlay beta it works fine for me

@teldra
Copy link

teldra commented Aug 27, 2021

Not working
Element 1.2.0 (F-Droid)
Android 11 / LineageOS 18.1
a5xelte

@takiainen
Copy link

Does not work.
Latest Element (F-DROID).
microg Lineage OS 18.1
Oneplus One / bacon

I don't have GAPPS installed.

@532910
Copy link
Contributor Author

532910 commented Aug 28, 2021

@takiainen, @teldra, @bigCrash could you create a screenshot for more visibility?

@jdannenberg
Copy link

Your screen video is pretty on point. I do not know anything to add with a screenshot.

@takiainen
Copy link

Exactly, the video above already shows everything there is to see. Mine behaves just like that.

@bmarty
Copy link
Member

bmarty commented Oct 4, 2021

The MediaRecorder fails to initialize. Can you send a rageshake just after reproducing the issue please? You can mention this issue number (#3904) in the bug report description.

@532910
Copy link
Contributor Author

532910 commented Oct 5, 2021

The rageshake was sent before this issue,
I can give you matrix account ID which it was sent from.

bmarty added a commit that referenced this issue Oct 5, 2021
… voice message

Will help debugging issues like #3904
onurays pushed a commit that referenced this issue Oct 5, 2021
* develop: (350 commits)
  Remove redundancy in heading in bug report issue form
  Fix typo: your->you're
  Minimize the use of exported="true" in android Manifest  - Add comments on Add exported="true" attributes  - Disable manifest exporting for:       - (service) VectorConnectionService       - (receiver) MediaButtonReceiver
  Add a log to get info when an error occurred when recording / playing voice message Will help debugging issues like #3904
  Fix test compilation
  changelog
  Create extension `String.isMxcUrl()`
  Improve code
  Load existing DM instead of creating a new one
  Remove unused SendRelationWorker and related API call (3588)
  Fix compilation issue
  changelog
  Message bottom sheet: move "View Reactions" action just below "Add Reaction"
  Update wording in message bottom sheet (#3869)
  Troubleshoot notification: Fix button not clickable
  Improve reusability of code
  Update changelog
  Add missing proper configuration for manual publishing of alias
  limit alias length in candidateAliasFromRoomName()
  Create MatrixConstants to handle max alias length limitation
  ...
@vsatmydynipnet
Copy link

  • 1 LOS 18.1 - 1.2.2 F-Droid; all permissions set

@lfom
Copy link

lfom commented Dec 7, 2021

Same problem here, v1.3.9 from GitHub, Android 12 GSI with MicroG, rageshake reports sent.
All permissions granted, recording audio works on Telegram, for instance.
App crashes when recording is locked (no waveform shown tho) and the message field is tapped.

@lfom
Copy link

lfom commented Dec 8, 2021

@bmarty and other devs
I got some logcats, hopefully it can hel fixing it soon.

Command to grab log:
adb logcat | grep -i -e element -e vector -e media

Cannot record a voice message

12-07 22:22:07.523  1095  1949 E MediaProfiles: The given audio encoder 7 is not found
12-07 22:22:07.523  1095  1949 I chatty  : uid=1013(media) Binder:1095_2 identical 4 lines
12-07 22:22:07.523  1095  1949 E MediaProfiles: The given audio encoder 7 is not found
12-07 22:22:07.549 23665 23665 E MediaRecorder: start failed: -2147483648
12-07 22:22:08.708 23665 23665 W im.vector.app: type=1400 audit(0.0:130462): avc: denied { search } for name="/" dev="cgroup2" ino=1 scontext=u:r:untrusted_app:s0:c104,c257,c512,c768 tcontext=u:object_r:cgroup_bpf:s0 tclass=dir permissive=0 app=im.vector.app

Crash when tapping on the message field

12-07 22:22:14.753 23665 23665 E MediaRecorder: stop called in an invalid state: 32
12-07 22:22:14.762 23665 23665 E AndroidRuntime: Process: im.vector.app, PID: 23665
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at android.media.MediaRecorder.stop(Native Method)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.voice.AbstractVoiceRecorder.stopRecord(AbstractVoiceRecorder.kt:2)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.VoiceMessageHelper.pauseRecording(VoiceMessageHelper.kt:1)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.MessageComposerViewModel.handlePauseRecordingVoiceMessage(MessageComposerViewModel.kt:1)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.MessageComposerViewModel.handle(MessageComposerViewModel.kt:14)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.RoomDetailFragment$setupVoiceMessageView$1.onRecordingWaveformClicked(RoomDetailFragment.kt:1)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.voice.VoiceMessageRecorderView$initListeners$1.onWaveformClicked(VoiceMessageRecorderView.kt:4)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.voice.VoiceMessageViews.start$lambda-2(VoiceMessageViews.kt:1)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.features.home.room.detail.composer.voice.VoiceMessageViews.$r8$lambda$v-i1bNY-S5BoZBD3SibRhxyEML4(Unknown Source:0)
12-07 22:22:14.762 23665 23665 E AndroidRuntime: 	at im.vector.app.core.ui.views.KeysBackupBanner$$ExternalSyntheticLambda0.onClick(Unknown Source:54)
12-07 22:22:14.769  1568  5572 W ActivityTaskManager:   Force finishing activity im.vector.app/.features.home.room.detail.RoomDetailActivity
12-07 22:22:15.011  1568  5572 I ActivityManager: Process im.vector.app (pid 23665) has died: fg  TOP 

Please feel free to ask for more info/logs if needed.

@Axeltherabbit
Copy link

Axeltherabbit commented Jan 12, 2022

Same issue, android12,Lineage19 GSI, voice calls work fine, all permissions granted, FDROID version

@cahlenlee
Copy link

Same issue on Android 11 (LineageOS no GAPPs). I have two identical phones, and the same thing happens on both. Same issue on FDroid and Aurora Store versions.

This is a major feature that's been broken for a long time. Any plans to address?

@sans-c
Copy link

sans-c commented Feb 13, 2022

Let me chime in. Same issue here on Lineage18.1 (Android 11, no gapps). If more data or logs are needed, let me know.

@ouchadam ouchadam added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Occasional Affects or can be seen by some users regularly or most users rarely labels Mar 16, 2022
@jtbx
Copy link
Contributor

jtbx commented May 25, 2022

I also have the same issue, from F-Droid. I'm running LineageOS 18.1-20220428-NIGHTLY-jfltexx, Android 11 with no gapps. Phone model is Samsung Galaxy S4 (GT-I9505).

@lfom
Copy link

lfom commented Jun 3, 2022

For anyone having this issue: it seems that Element on Android uses some library provided by Google Play Services in order to record audio, so it does not work when using a GSF free OS (like LineageOS + microG) Opus library issues with some ROMs. As a workaround, it seems that FluffyChat works fine.

@HarHarLinks
Copy link
Contributor

HarHarLinks commented Jun 17, 2022

I agree it should be made to work with all the mentioned libre configurations, however

does not work when using a GSF free OS (like LineageOS + microG)

it works for me with RROS 8.6.9 (which is based on lineage) + microG 0.2.18.204714.
Unless my phone isn't as libre as I thought it is.

@jeroenhd
Copy link

jeroenhd commented Jun 17, 2022

Looking at the source code, I disagree with the conclusion that Element uses some kind of Google library to record audio. The entire recording process is based on native Android code with a dedicated native library to encode the file. There is no dependency on Google at all when it comes to audio recording, except for the open source Android parts, of course.

The error logs posted earlier (The given audio encoder 7 is not found) indicates that native OPUS support was not working on the device in question, something I can find complaints about in various custom ROM threads all over the internet. It seems that the Qualcom drivers for hardware OPUS support on some custom ROMs have issues with that specific codec, but some ROMs list hardware support for OPUS regardless. This is a device/ROM issue that would need to be resolved by the ROM developers, though app developers may choose a different codec to work around buggy ROMs. If this error was logged on your device, I'd expect other apps to have issues with voice recording as well!

However, the current configuration seems to rely on codecs and configurations that should work across the board. The backing audio codec library has also changed. If your device still can't record audio now, you should probably provide some logs.

As far as I can tell from the source code, this has nothing to do with Google libraries and everything to do with custom ROMs/buggy official ROMs with wonky audio support. However, since the change from ffmpeg to opuscodec a few weeks ago I'd personally expect this issue to be resolved for most users!

@jdannenberg
Copy link

I can confirm this bug and add a few details from my side:

Element Android 1.20.0 (Fdroid) Android 11 / LineageOS (4microg) 18.1 LG G5 (H850)

I reported here with my old LG G5. I now have a One+ Nord with a similar setup (Lineage + microg) and this issue never occurred for me. Neither with Android 10 nor with Android 12 (Los 19).

So it seems not to be GSF related.

@532910
Copy link
Contributor Author

532910 commented Jun 17, 2022

This issues is NOT related to Lineage or microG.
microG and lineage works fine.

The issue was opened and rageshake was send from a non-rooted non-customized phone with GAPPS.

@Axeltherabbit
Copy link

Axeltherabbit commented Jun 18, 2022

Looking at the source code, I disagree with the conclusion that Element uses some kind of Google library to record audio. The entire recording process is based on native Android code with a dedicated native library to encode the file. There is no dependency on Google at all when it comes to audio recording, except for the open source Android parts, of course.

The error logs posted earlier (The given audio encoder 7 is not found) indicates that native OPUS support was not working on the device in question, something I can find complaints about in various custom ROM threads all over the internet. It seems that the Qualcom drivers for hardware OPUS support on some custom ROMs have issues with that specific codec, but some ROMs list hardware support for OPUS regardless. This is a device/ROM issue that would need to be resolved by the ROM developers, though app developers may choose a different codec to work around buggy ROMs. If this error was logged on your device, I'd expect other apps to have issues with voice recording as well!

However, the current configuration seems to rely on codecs and configurations that should work across the board. The backing audio codec library has also changed. If your device still can't record audio now, you should probably provide some logs.

As far as I can tell from the source code, this has nothing to do with Google libraries and everything to do with custom ROMs/buggy official ROMs with wonky audio support. However, since the change from ffmpeg to opuscodec a few weeks ago I'd personally expect this issue to be resolved for most users!

No, I updated to the latest FDroid version (1.4.19) and it does not work, I have this problem only with element, any other app works fine, and I do not have any google app installed nor microG or similar things

@lfom
Copy link

lfom commented Jun 18, 2022

OK, I take it back: it it does not seem to require GSF. But then officially Opus encoding is available only from Android 10 and up. So I guess other ROMs may not have it working properly.

https://developer.android.com/guide/topics/media/media-formats

I have seen other apps that simply use a bundled Opus library, so perhaps it is a better solution?

@oktayacikalin
Copy link

My son has a Moto X2 with LineageOS 18.1 (Android 11) is also getting a general error message. Rageshake sent.

@overtinkering
Copy link
Contributor

Same problem here. I'd say it stopped working since last update to 1.4.32 [40104320] [F-ce28d7f8] (f-droid).
olm 3.2.12

@lfom
Copy link

lfom commented Aug 26, 2022

It still isn't working, but it's even worse now: the app crashes if the mic icon is used. Please consider including the Opus library in the app, like many other apps do.

@jmartinesp
Copy link
Member

@oktayacikalin , @overtinkering & @lfom , in v1.4.36 we released some code to try to detect if the device has an Opus encoder included and use the fallback one bundled in the app otherwise. Please let us know if that fixes the issues you mentioned.

@sans-c
Copy link

sans-c commented Oct 3, 2022

@oktayacikalin , @overtinkering & @lfom , in v1.4.36 we released some code to try to detect if the device has an Opus encoder included and use the fallback one bundled in the app otherwise. Please let us know if that fixes the issues you mentioned.

You didn't ping me but I had the same issue as stated above. I can confirm that the issue is now fixed for me on Lineage 18.1 and the Element fdroid-release! There are some slight hiccups but that's stuff for another issue. I'll see if I can manage to report today. This specific issue here is solved however. For me at least. Thanks a lot!

@lfom
Copy link

lfom commented Oct 3, 2022

@jmartinesp I am using v1.5.1 and it seems to be working fine! Thanks, Android Element dev team!

@jmartinesp
Copy link
Member

I'm closing this issue as it seems like it's finally solved. Please re-open it if that's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Voice-Messages O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests