Picovoice / flutter-voice-processor

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

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

Closed jtdLab closed 7 months ago

jtdLab commented 11 months 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 11 months 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 11 months ago

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

jtdLab commented 11 months 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 11 months 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 11 months ago

Great. Thanks a lot.

sonnyvesali commented 10 months 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 10 months 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 10 months 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 7 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 7 months ago

Its gone on my side