AMCP Command Queue Overflow

#1
Hello! In current project I made a timer with a CasparCG. Once i create it and then send new value to it over and over 10 times a second to show the time in format "00:00.0"
There are 2 graphic programs simultaneously: one for broadcast and one for big screen at venue. I've made an ability to specify two different IP and two different Caspar channels to control 2 PC with Decklink with one data & time source. At the moment, I'm performing a test on one PC, with 2 different Caspar channels (IP is the same). Pass some time of such test Caspar tells "AMCP Command Queue Overflow".
Even if I set 1st IP to localhost:5250 and 2nd to 192.168.1.2:5250 the result is the same - overflow :(
Question: it is because the commands comes too often, or total amount of characters of each packet is too big?
If I do the same but with one channel - there is no overflow!

Re: AMCP Command Queue Overflow

#2
Weird, you have two independant sockets to the two CasparCG Servers, right? If you only use one, it's ok and if you use both it gives errors? Are you sure, that you really send out the commands only to the individuall socket connections?
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests

Re: AMCP Command Queue Overflow

#3
As far as I got two graphic stations I perform test with two IPs and everything is ok! In case of two channels on one Caspar - the IPs is different: 192.168.1.2:5250 and localhost:5250 but it seems that Caspar is don't care - overflow comes very fast. Is there any limitation on size of incoming packet for Caspar? May be amount of data that I send each time is bigger than it should? Does anybody knows?

Re: AMCP Command Queue Overflow

#5
That error gets thrown when the command queue has 128 commands waiting to be processed, so it looks as though its down to caspar taking too long per command to update the template.
It would be better to use a html or flash template and to access it via another method, possibly the template connecting out to your controller.
This way you will bypass the amcp queue, reduce the latency of the updates and improve the reliability of your clock.

Re: AMCP Command Queue Overflow

#6
Julusian, that's a great idea! For example: build a clock generator on Arduino (it is the only thing that Arduino will do and it will send clock data to serial port) and then read that serial port directly from template, bypassing the quere of Caspar. Data- & Timekeeping software should only start/stop/reset Arduino timer. Doing this way i become free from small hanging of timer when some operations are performed (like store rider's data, or receiving finish events from transponders)

Re: AMCP Command Queue Overflow

#8
Hi Hrein,

that is one way to do it, sometimes you want to have the time also displayed in the GUi and then it's easier, when you just send updates, so that the two do not run out of sync. Specially in sports like basketball were you start and stop the time all the time or get the time from a scoreboard.

Greetings Didi
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests

Re: AMCP Command Queue Overflow

#9
If all the systems have synchronised time you will have the same time in both the client and any templates (since they are calculating from the timestamp). It also means that you can loose the client and the template continues correctly. You can also restart the template and send it the timestamp and time will start at the right time. And it's easier to set an offset if you need to compensate for latency in output. Templates won't fail if communications between systems drop out.

Starting and stopping time plays especially well with this design. And if you need to modify the time (subtract, add etc) all you have to do is send an updated timestamp.

This design is much more secure and scalable.

Re: AMCP Command Queue Overflow

#11
hreinnbeck wrote:
11 Jan 2018, 19:19
If all the systems have synchronised time
My laptop (linux / ntp) and my Caspar Machine (windows / whatever windows uses) are in sync, but my tablet is always at least two seconds off and it's the most annoying thing. (specifically annoying because Android doesn't allow changing time servers) But other than that specific case, I fully agree.
CasparCG enthusiast and broadcast geek

Re: AMCP Command Queue Overflow

#14
Guys! I've perform the experiment. Create a socket from flash and receive data from time keeping software. 10 times a second. No problem with events when socket is connected, when socket data is available, no any kind of overflow))). And the main goal: there is no delay (0.5 sec approx.) that was before when I update template by overriding SetData void. I guess it was because of parsing an XML data by Caspar. Here is the main question: when this template will be converted to .FT file and will be played out from Caspar's Template Host will it keep the ability for socket operations? Does Caspar support such functionality?

Re: AMCP Command Queue Overflow

#17
OOps! Headache wasn’t disappear(((( I start flash template and tell him IP from which he can receive clock data. On that IP I have an app which listen to specific port for connect. As long as connection established - app starts to send clock data. BUT: a half-second delay is still on. When I do the same simply from Flash - there is no delay. It is so small that I don’t feel it. Why is it so?

Re: AMCP Command Queue Overflow

#19
I'm playing .fla file from Flash Professional, simply pushing "Ctrl+enter". It doesn't matter where delay is appear - the fact is "delay is on". The problem is: no matter which way to go: update clock with SetData or receive it directly in flash template, bypassing SetData: delay is the same. May be you're right, Didi, it's because SDI output. May be Caspar need some time to process and perform this delay? Who knows... but if we look at the Olympic Games (and other major competitions) - broadcast timer clock goes synchronously with clock on the venue (on led video boards). Somehow it is possible!

Re: AMCP Command Queue Overflow

#21
I'm pretty sure you are able to find out how many frames it takes to process the current image in the render pipeline.
Just add it to the time you got and you should be able to compensate it.
There will be a network delay too. Use ping to get the average time spend on the wire. But this should be pretty small in local networks (like < 1ms). But for internet connections, even good ones, this can be 40ms and more, which is another frame.

I guess you have a delay of approx. 3-4 frames. So, in PAL land this is 120ms to 160ms. Add the netwok delay and some processing time of your template and middleware and you end up at 250ms just for processing.

What happens if you take this into account when calculating the final numbers?

And if the timed delay of 0.5secs is stable and reliable, why not using it to compensate, too?

cheers
mcdikki
sublan.tv - Wir teilen Begeisterung