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

顔の描画が処理落ちする #214

Open
meganetaaan opened this issue Sep 29, 2023 · 1 comment
Open

顔の描画が処理落ちする #214

meganetaaan opened this issue Sep 29, 2023 · 1 comment

Comments

@meganetaaan
Copy link
Collaborator

不具合の概要
ElevenLabsなどmp3をデコードしながら音声を再生する際、顔の描画処理が間に合わず描画がとぎれとぎれになります。

再現手順
不具合を再現できる手順を記述してください

  1. ElevenLabsのTTSを設定する
  2. 喋らせる
  3. 顔の描画が遅れる

想定する挙動
描画が間に合う

環境 (次の項目を埋めてください):

  • スタックチャンのバージョン: 7b57feb
  • 使用するM5Stackの種類: M5Stack Core2
@meganetaaan
Copy link
Collaborator Author

2つ方向性があり、並行して検討すべきです。

  1. 既存の処理をチューニングしてCPUの負荷を減らす
  2. マルチスレッド処理をする

2について。ModdableのJavaScript仮想マシンはシングルスレッドで動作しています。したがってESP32の2個あるコアのうち普段は片方しか使われません。マルチスレッドで動作させるには次の選択肢があります

  • cの関数から直接xTaskCreateなどを使う
  • workerを使って2個目の仮想マシンを作成する

workerを使うとJavaScript中心にマルチスレッドが実現できます。試しにworkerを立てて音声合成を実行するサンプルを書いてみました。

https://github.com/meganetaaan/stack-chan/tree/feature/tts-worker/firmware/tests/workers/tts-worker

再生する様子

https://x.com/stack_chan/status/1704854420247433289?s=20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant