macOS extremely slow refresh rate when using a serial-based controller due to break time
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
PyDMXControl/controllers/_SerialController.py の Ticker ループと PySerial の send_break 呼び出しから始めてください。macOS における break-time の動作と、文書化されている break_condition の workaround を調査してください。DMX のタイミング要件に違反せずに、より高速な refresh rate を実現できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
This is more of an FYI for anyone else that tries to use this on macOS than an issue I expect fixed, but I'll document it here in case anyone wants to implement a more elegant solution.
When running PyDMXControl on macOS, the refresh rate for packets sent out is capped around ~2Hz due to the underlying implementation of sending a break in PySerial. A user in this thread helpful did some digging into the tcsendbreak function and found that it's hardcoded to 400ms on macOS, no matter what duration is passed in: link.
That means that the Ticker loop in this module blocks on the the call to PySerial's send_break function for 400ms and cannot spin any faster than that. My current workaround is to comment out the send_break and sleep calls here and instead replace it with:
self.__device.break_condition = True
sleep(5e-6)
self.__device.break_condition = False
sleep(1e-6)
Those sleep times are actually way shorter than what is supported by the DMX standard (min 88uS and 10uS respectively I think), but since the python sleep module isn't really accurate below 1ms, the actual break and MAB measured with a logic analyser ended up around 200uS and 300uS respectively. That will probably vary greatly depending on the system, but thankfully the DMX spec only mandates minimum lengths for both, and most DMX devices will do just find with longer breaks/MABs.
I don't know enough python to know if there are more reliable ways to do timing on a microsecond level, but this hack works well enough for the basic bringup I need to do with this module.
- 主要言語
- Python
- スター
- 143
- フォーク
- 23
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MattIPv4/PyDMXControl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
MattIPv4/PyDMXControl#60 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
MattIPv4/PyDMXControl#56 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
MattIPv4/PyDMXControl#55 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
MattIPv4/PyDMXControl#52 · コメント 5 件 ·
-
Custom Channels オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
MattIPv4/PyDMXControl#51 · コメント 3 件 ·
MattIPv4/PyDMXControl の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100