Picovoice / flutter-voice-processor

Flutter audio recording plugin designed for real-time speech audio processing
Apache License 2.0
31 stars 6 forks source link

Flutter Voice Processor Issue: Platform channel messages must be sent on the platform thread #17

Closed jtdLab closed 8 months ago

jtdLab commented 1 year ago

Expected behaviour

No errors

Actual behaviour

The 'flutter_voice_processor_frame_events' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.

Steps to reproduce the behaviour

Use flutter_voice_processor in a flutter application.

jtdLab commented 1 year ago

This might be helpful:

https://docs.flutter.dev/platform-integration/platform-channels?tab=type-mappings-obj-c-tab#channels-and-platform-threading

ksyeo1010 commented 1 year ago

What platform did you get this error on? Did you get crashes on the platform you tried (ios or android)?

jtdLab commented 1 year ago

I ran into it on iOS did not test Android yet. The app did not crash but showed the above warning/error. Seems to be related with newer Flutter versions being more strict with the threads where communication with native platform happens. Flutterfire had similar issue see here.

ksyeo1010 commented 1 year ago

Ok, thanks for reporting. We will work on a patch in the following weeks but cannot tell you an exact estimate on when a patch will be available.

jtdLab commented 1 year ago

Great. Thanks a lot.

sonnyvesali commented 1 year ago

would this have anything to do with it not working in a production environment?

I don't have any logs, but it works in my simulator in a debug bundle but fails in a production iOS environment?

laves commented 1 year ago

@sonnyvesali - can you open a new issue regarding this? Some additional details on reproducibility and environment setup would be very helpful. I can't say if this is related or a different issue.

sonnyvesali commented 1 year ago

@laves it was some other issue unrelated to the bug, forgot to include my leopard access key in my production .env ci/cd pipeline, silly me, thank you for the prompt reply!

laves commented 9 months ago

@jtdLab - this issue should have been addressed in the latest release (1.1.1). Can you confirm that the warning is no longer present for you?

jtdLab commented 8 months ago

Its gone on my side