[BUG]: app crashes when trying to start recording during a phone call
See original GitHub issueFlutter Sound Version :
-
FULL
-
Important: Result of the command :
flutter pub deps | grep flutter_sound
|-- flutter_sound 8.3.9 | |-- flutter_sound_platform_interface 8.3.9 | |-- flutter_sound_web 8.3.9 | | |-- flutter_sound_platform_interfaceβ¦
Severity
- Crash
Platforms you faced the error
- iOS version 14.7.1 real device
Describe the bug App crashes when trying to start recording during a phone call.
To Reproduce Steps to reproduce the behavior:
- Answer a phone call
- Go to app and start recording
- App crashes
Logs!!!
(This is very important. Most of the time we cannot do anything if we do not have information on your bug).
To activate the logs, you must instantiate your modules with the Log Level set to Level.debug
:
flutter: \^[[38;5;4m2021-09-29 07:45:00.127378Z General, I: GetPermission called for 7, got PermissionStatus.granted<β¦>
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 new FlutterSoundRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:155:13)
flutter: β #1 AudioRecorder._initRecorder (package:tw_app/UI/Mobile/Widgets/General/AudioRecorder.dart:49:22)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π ctor: FlutterSoundRecorder()
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:393:13)
flutter: β #1 AudioRecorder._initRecorder (package:tw_app/UI/Mobile/Widgets/General/AudioRecorder.dart:50:27)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:---> openAudioSession
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder._openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:413:13)
flutter: β #1 FlutterSoundRecorder.openAudioSession.<anonymous closure> (package:flutter_sound/public/flutter_sound_recorder.dart:395:17)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π ---> openAudioSession
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.openRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:186:13)
flutter: β #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98:22)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π ---> openRecorderCompleted: true
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.openRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:197:13)
flutter: β #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:98:22)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π <--- openRecorderCompleted: true
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder._openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:449:13)
flutter: β #1 <asynchronous suspension>
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π <--- openAudioSession
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:403:13)
flutter: β #1 <asynchronous suspension>
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:<--- openAudioSession
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: \^[[38;5;3m2021-09-29 07:45:00.179158Z General, W: AudioRecorder: _audioPath = /var/mobile/Containers/Data/Application/4AE43902-DB5A-406F-9C51-E98FB7CE1C45/Library/Caches/1632901500013.pcm<β¦>
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.setSubscriptionDuration (package:flutter_sound/public/flutter_sound_recorder.dart:561:13)
flutter: β #1 AudioRecorder.startAudioRecording (package:tw_app/UI/Mobile/Widgets/General/AudioRecorder.dart:125:27)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:---> setSubscriptionDuration
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.setSubscriptionDuration (package:flutter_sound/public/flutter_sound_recorder.dart:568:13)
flutter: β #1 <asynchronous suspension>
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:<--- setSubscriptionDuration
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder.startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:635:13)
flutter: β #1 AudioRecorder.startAudioRecording (package:tw_app/UI/Mobile/Widgets/General/AudioRecorder.dart:140:29)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:---> startRecorder
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β #0 FlutterSoundRecorder._startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:659:13)
flutter: β #1 FlutterSoundRecorder.startRecorder.<anonymous closure> (package:flutter_sound/public/flutter_sound_recorder.dart:637:13)
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flutter: β π FS:---> _startRecorder.
flutter: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[aurioc] AURemoteIO.cpp:1097:Initialize: failed: 561017449 (enable 1, outf< 2 ch, 0 Hz, Float32, non-inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
[avae] AVAEInternal.h:76 required condition is false: [AVAEGraphNode.mm:823:CreateRecordingTap: (IsFormatSampleRateAndChannelCountValid(format))]
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: IsFormatSampleRateAndChannelCountValid(format)'
*** First throw call stack:
(0x1903ff25c 0x1a4194480 0x19030cc98 0x1d998cb80 0x1d99f085c 0x1d99d7dd0 0x1d9a5c110 0x1d9a3d410 0x1048e0844 0x1048e1064 0x1048df59c 0x1008acb4c 0x1008ae068 0x104d7aa60 0x104a8bd7c 0x104d95070 0x104d2f1d4 0x104d319fc 0x19037f0a8 0x19037eca8 0x19037e17c 0x1903784b4 0x1903777d0 0x1a6ab9570 0x192ca42d0 0x192ca984c 0x10015b6a0 0x190056140)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001bc1ed7b0 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x1bc1ed7b0 <+8>: b.lo 0x1bc1ed7cc ; <+36>
0x1bc1ed7b4 <+12>: stp x29, x30, [sp, #-0x10]!
0x1bc1ed7b8 <+16>: mov x29, sp
0x1bc1ed7bc <+20>: bl 0x1bc1ca1fc ; cerror_nocancel
Target 0: (Runner) stopped.
Lost connection to device.
See this
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Android 11 - Phone App crashes, phone freezes (Page 1)
Please use settings (2), and enable the option "Call Settings - Fix Recording Issues - Start Input Stream", then test again. If it...
Read more >How to Fix Crashing Apps on an iPhone or Android?
Fix App Crashes on your Apple iPhone or Android smartphone. Kill the App; Restart the Phone; Update the App; Official Support; Use Bugfender!...
Read more >App crashing immediately on start up after upgrading to iOS12.
Running fine in simulator but crashes in device. No crash logs recorded. In line error shown after launching the app Thread 1: EXC_BAD_ACCESS...
Read more >Camera App crashing while recording - OnePlus Community
Try going into Settings --> Apps --> Application List --> Camera --> Storage --> Clear cache and clear data. Reboot your phone. See...
Read more >Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK. I think that there is some bugs when recording Streams. Actually we support only PCM - INTEGER16, but the default PCM format on iOS is FLOAT32.
I am almost sure that the problem is because the iOS device switched to FLOAT32.
I am currently busy working on Tau Sound 9.0. This new branch will support many different PCM formats :
So your Problem Report is really interesting for me, to help me debug this stuff.
Yes, @kiwicmc , Your shared info with your App are interesting.
I can understand that the microphone cannot belong to two App at the same time. But having a phone call during the run of Flutter Sound is something that can happen very often, and the App must be able to handle this thing. (The App is the only people knowing what to do in this case).
Probably, Flutter Sound should trigger an explicit (and well documented) exception, instead of falling into un-understandable traps. If someone can do a Pull Request for that, it would be great : I actually have much work on Ο Sound 9.0, and I have no time to spend on Flutter Sound 8.4