Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

usb-midi-device crashes esp32-s3 when OUT USB packets sent at line rate

オープン
#1,162 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
embedded-iot

調査の方向性

提供された rtmidi2 のラインレート送信側を使用して、ESP32-S3 上で midi_example.py の失敗を再現します。まず、usb/device/midi.py と usb/device/core.py の受信および転送コールバックを、特に traceback に示されている経路を中心に追跡します。持続的な MIDI 入力によって Buffer 属性エラーやハードクラッシュが発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Splitting this issue out from #1158 where it was independently discovered by @agatti while investigating a related issue.

The issue can be reproduced by setting up a CPython program that transmits MIDI data to the device as quickly as possible. For example:

import rtmidi2
out = rtmidi2.MidiOut()
# Port 1 is 'Espressif Device:Espressif Device MIDI 1 24:0' in my case
out.open_port(1)
while True:
    out.send_pitchbend(0, 0)  # channel, pitch
    out.send_noteon(0, 48, 100)
    out.send_noteoff(0, 48)
    print(".", end="")

(Note that only the second two messages are currently processed by the MIDI device class, pitchbend messages are discarded.)

If running midi_example.py on the ESP32-S3, the exhibited behaviour is a few messages may be processed normally and then the handler fails with nonsense errors such as:

Traceback (most recent call last):
  File "usb/device/midi.py", line 168, in _on_rx
  File "usb/device/core.py", line 859, in pend_read
AttributeError: 'Buffer' object has no attribute '_b'
Traceback (most recent call last):
  File "usb/device/core.py", line 342, in _xfer_cb
  File "usb/device/midi.py", line 156, in _rx_cb
  File "usb/device/core.py", line 827, in finish_write
AttributeError: 'Buffer' object has no attribute '_b'

and/or possibly a hard crash.

主要言語
Python
スター
2.9k
フォーク
1.1k
平均マージ
7日 4時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

micropython/micropython-lib のほかの issue

micropython/micropython-lib の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。