You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to place my HDMI-CEC adapter (in this case, a Pulse-Eight USB-CEC Adapter), and this component is seeming like a great option! Thank you for building this!
However, while debugging things, I've been looking at the log output from the Pulse-Eight device, and every time the ESP sends a frame, there are a ton of HIGH_ERROR messages, suggesting there is something wrong with the timing of these messages?
I'm far from an expert when it comes to precise timing with MCUs, but looking at the code, I was wondering if a few things could be the culprit:
There seems to be a mix of delayMicroseconds() and delay_microseconds_safe(). Would it be better to use only one of these for all cases?
I noticed that send_and_read_ack_() is structured using an initial start_us = micros(), and after using delayMicroseconds(HIGH_BIT_US), the timing is controlled by checking against the start time with while((micros() - start_us) < SAFE_SAMPLE_US) and while((micros() - start_us) < TOTAL_BIT_US), while send_bit_() just uses pin_->digital_write()s and delayMicroseconds(). I'd imagine the timing for these is pretty reliable, but perhaps it would also benefit from a similar looped delay structure?
As far as I can tell, the InterruptLock in send_frame_() is all that's needed to prevent interrupts, but perhaps something is still causing an interrupt or other unexpected delay?
Which version of ESPHome was used when this happened?
2024.10.2
What platform are you using?
ESP32-IDF
Board
ESP32-DevKitC
Example YAML snippet
Just the plain hdmi_cec setup will trigger this when it responds (e.g. responding to 0x83):
There seem to be Component hdmi_cec took a long time for an operation message (almost?) every time it sends. Nothing else out of the ordinary in the logs
[15:08:04][D][hdmi_cec:076]: frame received: 08:8C
[15:08:04][D][hdmi_cec:205]: sending frame: 80:00:8C:00
[15:08:04][D][hdmi_cec:219]: HDMICEC::send(): frame sent and acknowledged
[15:08:04][W][component:237]: Component hdmi_cec took a long time for an operation (121 ms).
[15:08:04][W][component:238]: Components should block for at most 30 ms.
Additional information
No response
The text was updated successfully, but these errors were encountered:
I can confirm that something is off with this implementation!
I am not able to control my Philips OLED808 with this. The TV can send me requests, but even if I reply to them, the TV keeps asking, this does not happen with ceclib on an Orange Pi.
Furthermore, the TV also ignores all my commands or requests. The only thing that triggers the TV is XF:36 (OFF as broadcast)
The problem
I'm looking to place my HDMI-CEC adapter (in this case, a Pulse-Eight USB-CEC Adapter), and this component is seeming like a great option! Thank you for building this!
However, while debugging things, I've been looking at the log output from the Pulse-Eight device, and every time the ESP sends a frame, there are a ton of
HIGH_ERROR
messages, suggesting there is something wrong with the timing of these messages?I'm far from an expert when it comes to precise timing with MCUs, but looking at the code, I was wondering if a few things could be the culprit:
delayMicroseconds()
anddelay_microseconds_safe()
. Would it be better to use only one of these for all cases?send_and_read_ack_()
is structured using an initialstart_us = micros()
, and after usingdelayMicroseconds(HIGH_BIT_US)
, the timing is controlled by checking against the start time withwhile((micros() - start_us) < SAFE_SAMPLE_US)
andwhile((micros() - start_us) < TOTAL_BIT_US)
, whilesend_bit_()
just usespin_->digital_write()
s anddelayMicroseconds()
. I'd imagine the timing for these is pretty reliable, but perhaps it would also benefit from a similar looped delay structure?InterruptLock
insend_frame_()
is all that's needed to prevent interrupts, but perhaps something is still causing an interrupt or other unexpected delay?Which version of ESPHome was used when this happened?
2024.10.2
What platform are you using?
ESP32-IDF
Board
ESP32-DevKitC
Example YAML snippet
Just the plain
hdmi_cec
setup will trigger this when it responds (e.g. responding to0x83
):Also happens for
hdmi_cec.send
actions:Anything in the logs that might be useful?
There seem to be
Component hdmi_cec took a long time for an operation
message (almost?) every time it sends. Nothing else out of the ordinary in the logsAdditional information
No response
The text was updated successfully, but these errors were encountered: