Further investigation shows that these pauses only occur when what’s being written is the image from the camera (not the IMG_HEADER or the STREAM_BOUNDARY text items).
When these pauses occur, I’m sending sendChunk(client, (uint8_t*)img_addr, img_len);
from the camera, where img_addr is the address of the frame to send, and img_len is the length of the frame. The paused frames are not notably long. The pauses don’t corrolate with the skb_unavailable errors.
void CameraView::sendChunk(WiFiClient& client, uint8_t* buf, uint32_t len) {
uint8_t ch_buf[64] = {0};
uint8_t ch_len = snprintf((char*)ch_buf, 64, "%lX\r\n", len);
client.write(ch_buf, ch_len);
client.write(buf, len);
client.print("\r\n");
}
I’ve removed a lot of junk data from the serial stream below - the frames that go right, the endless "ERROR] get_available Accept connection failed
"messages that come when the server is not set to blocking mode - and an example log of the long pauses is below.
prof_b
is the time in milliseconds it took `client.write(buf, len); to execute, and
prof_c
is the size of the JPEG frame in bytes.
typically (in “working” frames without an extra pause), prof_b
takes 4 milliseconds, in rare cases up to 10. Unless it’s in an extra pause, shown below. The pauses can reach into the 4,000 milliseconds. During these extra pauses, there’s a noticeable hiccup in the video stream.
I’ve forced the AMB82-MINI to 5GHz WiFi (by filtering the MAC address off my 2.4GHz - verified by looking at the device connections in my router). Still seeing pauses upon frame write.
prof_b: 1299, prof_c: 39807
[Driver]: skb_unavailable=2 in last 2 seconds
[Driver]: skb_unavailable=24 in last 2 seconds
[Driver]: skb_unavailable=28 in last 2 seconds
[Driver]: skb_unavailable=29 in last 2 seconds
[Driver]: skb_unavailable=30 in last 2 seconds
[Driver]: skb_unavailable=24 in last 2 seconds
[Driver]: skb_unavailable=21 in last 2 seconds
[Driver]: skb_unavailable=9 in last 2 seconds
prof_b: 931, prof_c: 34075
[Driver]: skb_unavailable=21 in last 2 seconds
[Driver]: skb_unavailable=26 in last 2 seconds
[Driver]: skb_unavailable=23 in last 2 seconds
prof_b: 1104, prof_c: 39920
[Driver]: skb_unavailable=5 in last 2 seconds
[Driver]: skb_unavailable=3 in last 2 seconds
[Driver]: skb_unavailable=6 in last 2 seconds
prof_b: 1277, prof_c: 31087
[Driver]: skb_unavailable=1 in last 2 seconds
[Driver]: skb_unavailable=21 in last 2 seconds
[Driver]: skb_unavailable=17 in last 2 seconds
[Driver]: skb_unavailable=12 in last 2 seconds
[Driver]: skb_unavailable=12 in last 2 seconds
prof_b: 1122, prof_c: 31790
[Driver]: skb_unavailable=8 in last 2 seconds
[Driver]: skb_unavailable=14 in last 2 seconds
prof_b: 996, prof_c: 43989