Possible idea to fix slow Break time on serial-based controllers degrading refresh rate
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- embedded-iot
调研方向
首先阅读 SerialController._transmit() 方法,并将其当前的 send_break 序列与建议的波特率和空字节序列进行比较。重现原始串行测试,然后在可用平台上验证控制器行为;完成的标准是改善 DMX 刷新,同时不存在所述的刷新缓冲区或重新配置问题。
由索引模型根据 Issue 内容生成。
描述
Hi.
Having the same problem on another platform (Linux, PC), I found another solution : instead of explicitely sending a Break, if we send a null byte at a slow enough baudrate, it will be interpreted as a Break followed by the Mark-After-Break on the fixtures' side.
(I thought about this trick first for microcontrollers with rudimentary UARTs which can't explicitely send Break states).
Therefore, in the _transmit() method from the SerialController class, instead of :
# Write
self.__device.send_break(100e-6)
sleep(10e-6)
self.__device.write(data)
I would do something like :
#self.__device.flush()
self.__device.baudrate = 80000
self.__device.write(bytearray(0))
self.__device.flush()
self.__device.baudrate = 250000
self.__device.write(data)
#self.__device.flush()
Because the serial device stays opened, we need to flush the write operations before changing the baudrate (it is not done in the Serial class, despite the reconfiguration), especially just after writing the null byte at a slower baudrate.
However, whereas a flush after writing the DMX data is required in a raw test of this code snippet, it seems to break things when done inside the SerialController class, for an unknown reason.
So the fix can unfortunately not be validated yet, not counting that I can't test it on several platforms.
By the way, the raw test shows a refresh rate of 34Hz or a bit more (VS the theoretical maximum of 44Hz) for a 512-channel frame : it seems not so bad, given the processor time consumed by the Python interpreter and all software layers down to the kernel.
What do you think about it ?
- 主要语言
- Python
- 星标
- 143
- 派生
- 23
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MattIPv4/PyDMXControl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 30/100
MattIPv4/PyDMXControl#58 ·
-
难度 5/5 一周以上 新手友好度 25/100
MattIPv4/PyDMXControl#56 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
MattIPv4/PyDMXControl#55 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 18/100
MattIPv4/PyDMXControl#52 · 5 条评论 ·
-
Custom Channels 未关闭
难度 4/5 3-5 天 新手友好度 35/100
MattIPv4/PyDMXControl#51 · 3 条评论 ·
查看 MattIPv4/PyDMXControl 的全部 Issue
相似的 Issue
-
bug priority:low
难度 2/5 1-3 小时 新手友好度 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
难度 2/5 1-3 小时 新手友好度 86/100
NousResearch/hermes-agent#122386 · 1 条评论 ·
-
ai-generated
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/production-stack#1105 ·
-
难度 2/5 1-3 小时 新手友好度 88/100