Lags
Unlike Windows or Linux, Apple does not provide access to Wi-Fi Direct (P2P) functionality which is the basis for any realtime display casting. Thus, Screen instead uses streaming capability of smart TVs. While Wi-Fi Direct has clearly defined maximal transfer latencies and is available over local networks only, the streaming is meant to be generally over the Internet. Since you can't have high expectations with regard to transfer delays over the Internet, TVs have built in certain minimal buffer (compensating for transfer delays) that can't be shortened. Screen allows you however to shorten the default value to certain constant during session initiation.
We defined two types of profiles: "for presentations" & "for movies". You can see more details in
Profiles section and also in
UHD section.
Generally, the presentation profiles have shorter default lag than movie ones.
|  | How to reduce the lag |
Each profile has preset some "safe" default value. You can reduce it with intention to find out a minimal value for your TV model. It is practical to do it in an iterrative process.
Session initiation works like this:
- You click Play;
- Screen initiates session and starts casting data to TV;
- TV starts buffering - a progress indicator is shown on the TV; Screen starts a stopwatch that measures the buffering time;
- Once the TV buffer saturation reaches certain value, TV starts playing;
- Screen detects that and stops the stopwatch; If the measured buffering lag is lower than requested, it initiates lag reduction process and during that, it shows "Reducing Lag" message on the display;
Let's presume that minimal TV lag is 2.6sec and the current lag is set to 6 sec. Iterative process can look like this:
- Decrease current lag by 0.5 sec, save the value;
- Initiate session, watch the TV progress indicator;
- If you are still within safe bounds, after the end of the reduction, you shall not experience another buffering; If so, end the session and try again the first step. In our case, you can iterate untill you reach 2.5 sec.
- If you see the second buffering, you know that the lag is too low and you need to return by 1 step backwards, i.e. to 3 sec.
Note that you still need to leave certain value for keyframes, practically - once you find the minimal value, add at least 0.5~0.75 sec.
It is recommended to do these changes only for presentation profiles.