The DisplayOut Bible

Discussion in 'General Game Discussion and Questions' started by Menneisyys, Jun 3, 2013.

  1. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    #1 Menneisyys, Jun 3, 2013
    Last edited: Jun 3, 2013
    This article is solely targeted at people that (want to) mirror the image of their iDevice onto an external TV / projector / streaming service and have jailbroken their iDevice. You'll learn a lot of practical tips and tricks never before published by anyone else.

    The article is a cross-post from TA's brother site MacRumors (original at http://forums.macrumors.com/showthread.php?p=17344889 ) and will also be linked to from out "home" HDMI thread here in the same forum ( http://forums.toucharcade.com/showthread.php?p=2752229 ). I have posted it as a separate thread as it may be of interest to not only HDMI folks but also anyone, with any kind of cable / adapter types, interested in mirroring the screen (even that of games!) on external monitors / capture devices. It puts extreme emphasis on mirroring games and can be REALLY useful to even the TA folks here in charge of making review videos (see the TA references in the article, in section "1. Show The Tap Position").


    With the advent of even realtime game video streaming services like Twitch.tv, in addition to the “traditional” ones like YouTube's own YouTube live streaming, outputting / streaming the contents of the iDevice's screen became even more important. In addition to the standard mirroring available on all A5 CPU-based iDevices (and, with some tweaking, on A4-based ones too), Cydia-based (link; $3.99) DisplayOut (DO for short) has always been the most preferred solution. In this tutorial, I directly compare it to the stock mirroring readily available in all new devices announced in 2011 or later.

    First, let me quickly list the pros / cons of DO.

    When to prefer DisplayOut over standard mirroring (if available)?


    You want
    - to show your audience where you've tapped
    - you have an Retina iPad and want to mirror your screen to a TV with higher-than-900p resolution in as good an effective, actual resolution as possible
    - you in no way can get rid of the thick black border around your screen content, that is, the windowboxing of the always-enabled overscan
    - to show the output of an app with buggy native TV out support; for example, that of Keynote
    - to use your old composite or component cables (as opposed to the HDMI and VGA adapters) to mirror the screen of your iDevice
    - to force some video streaming apps' output be displayed on an external source – apps that just show a black screen by default on the external TV to disable mirroring
    - to play back high-resolution videos on the external screen over either the VGA adapter or a connection not supporting
    - to mirror the screen of an A4-based iDevice without hacking their capabilities plist

    When to prefer the built-in mirroring?

    You want
    - to play a game with as high a framerate and as low lag as possible
    Now, let's examine all these bullets in detail!
    1. Show The Tap Position

    By default, there isn't any way of showing on the external TV where the user tapped in generic apps or the SpringBoard. This may be a big problem when, say, you record a software review or have a user interface with tons of widgets and you want to avoid having to tell your audience “now, I've tapped this and this”.

    A recent example is, say, THIS (linked from HERE) TA video. (Many other TA videos could also be cited as examples.) You can only guess where the reviewers tapped in a lot of times. In a review video like this, it would have been MUCH better to constantly see what has been tapped.

    Unfortunately, there doens't seem to be any way of doing this while just using the built-in screen mirroring of iOS using jailbreak tools, let alone the non-jailbroken iOS.

    DO can this too. By default, a circle is displayed at the tap location. You can set the perimeter of the circle and can also enable it for OpenGL surfaces and on-screen keyboards. (This isn't enabled by default.) It does what it's supposed to do.

    Note that the only known major DO bug is related to these circles. In many cases, on all kinds of machines, they just stay on-screen until the next complete device restart. Unfortunately, simply dis/enabling DO doesn't help; neither does “just” respringing the device.

    [​IMG]


    (as with all the images in this article, click for the original)

    2. Actual Resolution

    2.1 iPad 2


    First, in order to have something to compare to, let's start with non-Retina, that is, XGA (1024x768) iPads' mirroring; more specifically, that of the iPad 2. (I don't provide you with Lightning-HDMI captures in this article, their being of significantly worse quality because of the implicit 900p scaling than those of 30-pin ones.)

    Let me show you two resolution charts with my programmatically generated (see THIS for a discussion and source code – it starts at #4; the code is at #8) 1x1 checkerboard. As you may recall, it looks like as follows on the built-in Retina iPad screen:
    [​IMG]

    That is, as the source image (it's HERE for download) is mapped pixel-by-pixel to the screen of equal dimensions, there's absolutely o scaling and every pixel is displayed faithfully to the original image.



    This is how it's rendered on the XGA screen of the iDevice (here, it's shown with about a 5x zoom):

    [​IMG]
    (Note: as with all the two other shots in this section, I've made this in iFile's built-in image viewer and not using the stock Photos app. The reasons for this is simple and you may already know: the stock Photos app has native TV out support. That would rendered the natively mirrored captured frame non-comparable to the other two pictures. I've made sure the header / footer of iFile's image viewer is visible to emphasize all this.)

    As you can see, it's just a solid, homogenous mass. There isn't any sign of even scaling.

    Why? This can be very easily understood. The original image is of Retina iPad resolution, while the screen of the iPad 2 is XGA (1024x768). This means 1x1 checkerboards will become just gray masses as four black and white squares next and below to each other will be combined to one “superpixel” during scaling, averaging their luminoisity value too. Hence the almost fully solid color without any signs of scaling or detail.

    Let's take a look at the effective resolution of this reschart – still on the same iPad 2. Let's elaborate on the horizontal resolution. (Vertical resolution compares in exactly the same way.) This is a crop of the direct screen capture (that is, without any kind of mirroring yet):

    [​IMG]

    As you can see for yourself too, you can no longer get the correct count (nine) of the nine almost-vertical lines below the label 8.

    Let's see how this all is mirrored via the stock TV mirroring support:

    [​IMG]

    (only showing the resolution lines. The 1x1 checkerboard looks exactly the same as in the above screenshot.)

    As you can see, the resolution is a little bit (about 10%, but ot significantly more) worse than on the built-in screen (shown on the last-but-one crop). The explanation for this is very simple: the original screen content is reduced in size in order to apply overscan; hence the lower resolution. As you may well remember, it's not possible to disable overscan while mirroring on the iDevice's side.

    As the stock mirroring delivers essentially (apart from the resolution hit introduced by the, with iOS, obligatory overscan) the same resolution as the built-in screen, I don't provide a shot made with DO. Apart from not having to use overscan, there wouldn't be any resolution increase when using DO instead of the stock mirroring client.

    The situation will be vastly different with the iPad 3.



    (continues below)
     
  2. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    2.2 iPad 3

    Let's compare the last two crops (vertical lines) to that of the iPad3, which is already Retina. Resolution on the built-in screen:

    [​IMG]


    Resolution on the TV using the standard, stock mirroring in the best possible circumstances (30-pin (and not the significantly worse Lightning), first-gen (and not the somewhat-worse second) HDMI adapter):

    [​IMG]


    As you can see, the resolution is
    - somewhat (about 25%) better than with the iPad 2 – here, the vertical lines' number becomes impossible to count between the 10th and 11th line. I'd say the iPad3 screen's mirrored at SXGA (1280x1024) effective resolution – no more, no less. (Note: some people state standard mirroring tops out at the effective resolution of XGA (1024x768) on even Retina (2048x1536) iPads even on external TV's capable of displaying even Full HD (1920x1080). This certainly isn't true, as you can see here if you compare this crop to that of the iPad 2.)
    - much-much worse than in the in-screen screenshot, which you may already guessed, given that I've aleady mentioned the resolution advantage over the iPad2 is around 25% only – while the screen has double the resolution. Where is the remaining 75%?

    Let's also take a look at the 1x1 checkerboard:

    [​IMG]

    Well-well, while, at least, it's definitely different from the homogenous mass of the XGA case - you can easily see based on this crop too that the effective resolution is indeed not XGA.

    2.2.1 How Does DO Compare?

    Definitely much better in the 1080p / High Quality mode. While, physically, it's impossible to deliver the full resolution of the Retina iPad's screen over a Full HD connection (how would you show a 2048x1536 screen on an external TV with a resolution of only 1920x1080?), DO at least makes it possible to realize there has been some fine-lined graphics in that area - unlike with the built-in mirroring.

    Let's see how DO handles the vertical lines:

    [​IMG]


    Yes, it's definitely better than the resolution delivered by stock mirroring. (And it'd be even better after disabling overscan – which is definitely possible with DO!)

    The 1x1 checkerboard also shows the effective resolution of DO's output being definitely better than that of the stock mirroring:

    [​IMG]

    As you can see, while it's not delivering the same checkerboard as the original 2048x1536 screenshot (it couldn't, given that the Full HD resolution is below that of 2048x1536 and, consequently, scaling must take place), it's the most textured one so far.

    All in all, DO does deliver a resolution advantage on Retina-screen iPads; particularly on 30-pin ones (namely, the iPad 3). The difference between DO's and the stock mirroring's output isn't this pronounced on the iPad 4 because of the sub-par Lightning – HDMI adapter only letting video signals through at 900p resolution, introducing another rescaling and recompression layer, visibly reducing image quality.

    3. Configuring DO

    DO has its own configuration dialog in the system-level Settings.

    3.1 Quickly En/Disabling DO

    The uppermost switch allows for quickly en/disabling the tweak very useful when you plan to quickly switch back and forth between the native TV support, including the possible mirroring support, and that of DO:

    [​IMG]


    In the original-sized image, I've also shown in the same image the icon integrating into SBSettings, also allowing for quickly en/disabling DO from anywhere:

    [​IMG]


    No matter which of the two you use for toggling the tweak, both offer a way for very fast switching. I wish all other, major tweaks had the same quick en/disabling. Unfortunately, one of the best other, TV out-related tweaks, ReSupported 4+, which is also recommended by the developer of DO, don't have such a thing. It must always be completely uninstalled to disable it (and reinstalled to be enabled). Which is a pity, as it's an excellent app allowing for, among other things, adding TV out to the AppStore version of the YouTube app. It's only in pre-iOS6 times that it came bundled as a stock app on every iDevice. On iOS6, you must install it yourself. While the AppStore version does have some advantages (for example, support for CC's), it no longer supports TV out. ReSupported 4 can tweak this new client to stream to an external TV but – when the tweak is installed, the high-definition (HD) HDMI and VGA adapters stop working, and only the standard-definition (SD) composite / RGB cables work. (Both official and unofficial.) Unfortunately, I haven't managed to speak to the developer on this matter as he hasn't answered my mails. All in all, for now, should you want to use ReSupported 4, do it only if you only have / can only use SD cables and not HD adapters.
     
  3. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    3.2 Selecting Output Screen Resolution

    Should you want to use a lower resolution than is supported by the iDevice / connection type / external TV, you can do it under the “Max Screen Resolution” list (third item In the list):

    [​IMG]

    You WILL want to do this especially in the following cases:

    - with the highest resolution possible, you encounter out-of-order frames and the LQ mode (see 3.3 below) doesn't help
    - you do know that the content played back wouldn't be making full use of the output resolution
    - you want to feed lower-resolution content to the external receiver. This can be important with, say, video capture units. For example, the Elgato Game Capture HD can only record at 30 fps at 1080p, while at 60p at 720p and below. If you want to capture 60p videos to provide as fluid movement as possible (and your source indeed delivers more than 30 fps – you won't want to waste 60p recording on, say, 24p movie playback!), you will want to use 720p instead of 1080p.

    (Speaking of the Elgato unit, if you're into video capturing in general, you might want to read my latest posts on HDMI capturing, chroma keying etc. HERE)

    3.2.1 CPU Usage Measurements

    A related question is whether you can speed up your iDevice by deliberately reducing DO's output resolution.

    I've made some VERY serious benchmarks on all major iOS platforms and my answer: no, you cannot. There is almost no CPU usage difference between the lowest-resolution and highest-resolution mirroring. That is, unless you encounter graphical glitches (out-of-order frames), you can safely stay with the highest possible resolution.

    3.3 Switching Between High- and Low-Quality Modes

    The “Render Quality” list immediately below “Max Screen Resolution” will also be your close friend:

    [​IMG]

    Basically, keep it always in the default High Quality (HQ), unless you find it indeed gets rid of the graphical glitches with the particular media / game you're trying to mirror. It's only in the latter case that you should switch to Low Quality (LQ) mode. Disabling it won't decrease the load on the CPU either.

    Disabling it results in worse antialisation, as can clearly be seen in the following frame capture:

    [​IMG]


    Compare this to the HQ case:

    [​IMG]


    Note that both shots were made on the iPad 3 under ideal circumstances – that is, with the first-gen HDMI adapter. Also, scaling was applied (see next section, “3.5 Removing Overscan-induced Windowboxes in Every Possible Configuration”) to maximize effective resolution and screen estate usage.

    Let me also provide you with two 16:9 reschart framegrabs without any scaling applied (basically, a pair of grabbed frames of Keynote with 16:9 slides). THIS is a shot of the LQ mode, while THIS is a HQ one. The difference is pretty obvious.

    3.4 Suppressing Flicker

    You'll want to disable the “Suppress Flicker” switch on everything but the composite cable. (An exception: if you only have an iPhone 3G or a first-generation iPod touch, also the RGB cable will be used in interlaced mode. (Not any more on the iPhone 3GS+ and the iPod touch 2G+.) On these very old iDevices you may want to at least try enabling this feature to see whether flickering is indeed reduced.) Note that it'll be enabled by default on, say, the iPhone 3GS, even if you don't ever connect a composite cable to the device.

    Interestingly, I haven't found much difference between the en- and disabled state via the composite cable either. Both modes exhibited strong interlaced flickering – even when Suppress Flicker was enabled. It just didn't seem to help at all.

    3.5 Removing Overscan-induced Windowboxes in Every Possible Configuration

    As has been explained in my overscan-related article, it's not possible to remove the rather thick black borders from above / below the mirrored iDevice screen if you use the HDMI adapter to mirror it. (When using the VGA adapter, no letterboxing will be used.)

    With DO, this is also possible using the second Scale Portrait / Landscape slider in Settings, directly under the main switch / list group explained above. Of the two, I've annotated the latter by a red rectangle below:

    [​IMG]


    By default, it's exactly in the center; the above shot shows the position for 4:3 (that is, iPad aspect ratio) landscape content to completely get rid of the upper and lower black borders.

    (Note that everything I state about the Landscape slider also applies to the Portrait one. Should you want to override mirroring parameters for Portrait screens, (also) change the upper slider. The values will be exactly the same in both plain overscan elimination and 16:9 zoom-in.)

    3.5.1 Using iFile to Reliably Fine-tune Scaling

    Unfortunately, DO
    - doesn't provide a numeric value of the current setting and
    - doesn't provide fine-tuning like that of the positioning (scrubbing) slider in the stock Videos app, making fine-tuning really hard.

    This means you may need to spend quite a lot of time each time you need to re-set this slider to another scaling factor – to, say, switch between mirroring 4:3 and 16:9 content. (The latter requires much higher scaling to entirely fill the external 16:9 screen.)

    You can do this much faster with the excellent generic jailbreak file handler “iFile” I've frequently used in my other tutorials too (see for example the symlink tutorial). All you need to do is editing the file /var/mobile/Library/preferences/com.booleanmagic.displayout.plist and changing the value of DOScaleLandscape (for Portrait mirroring, DOScale).

    By default, it's 1. In order to get rid of overscan, you'll need to increase it to 1.1105 (annotated below):

    [​IMG]


    By the way, the DOApplicationUsedScreens-* keys at the top list apps with native TV output where DO has already displayed the “XXX appears to have built-in support for external displays. You may consider disabling Display Out temporarily” message at starting the program. It's by storing these apps' identifiers here that DO avoids redisplaying the message every time the given app is restarted.

    4. Buggy Native TV Out in Some Apps? Disable it With DO!

    As has already been explained in Section “2.3 How Come Apple Haven't Noticed This?” of my Keynote-specific article, Keynote's native TV out is buggy as, with MS Office-based files, it has the following low-resolution output:

    [​IMG]


    Buggy / not properly tested TV out is, again, pretty common with iOS apps. In addition to Keynote, the games Gameloft's Dungeon Hunter 4, Pangea's Bugdom 2 and Cro-Mag Rally; Sky Gamblers - Rise Of Glory; FIFA 12 etc. all have major TV out bugs.

    By completely disabling the (again, pretty much useless) native TV out feature in all these apps and using DO to do the (mirrored) output, you can easily fix these bugs. Then, you'll be using screen mirroring only, which means you won't be able to
    - display presenter notes / the clock / the “laser” in Keynote
    - use special features like external cameras in Cro-Mag Rally

    Nevertheless, even in these cases, using a much higher-resolution (Keynote) or in other ways non-buggy (the listed games) external TV out may be preferable.

    For example, with Keynote, the same Office-generated file looks with DO as follows:

    [​IMG]


    Note that, while it in no way fills in the entire screen (more on this problem immediately below), it still delivers much better resolution than before.
     
  4. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    4.1 Zoom Into the Center 16:9 Area of the Mirrored Screen

    If you increase scaling to both get rid of the overscan (the 1.1105 factor) and also zoom in (with a factor of 4/3) to the center of the image to display the 16:9 content (slide) in there, you can display originally 16:9 images full screen on the external TV.

    The product of these two numbers is 1.1105 * 4/3 = 1.480666 – this is what you'll need to enter into the plist file. By manually (trying to) set the same in DO's Settings applet, it would look like this:

    [​IMG]


    I got the following DO output:

    [​IMG]


    This works because, as has been explained in my original article, on the built-in screen these MS Office files render just fine, it's only on external TV's that they are rendered low-res.

    Note that, in this framegrab (as opposed to the still non-scaled two in section “4. Buggy Native TV Out in Some Apps? Disable it With DO!”), I displayed the list of slides on the left too so that I can show you how much DO zooms in. If you compare the above full image to the inner 4:3 screenshot, you'll see the entire upper and lower part above and below the 16:9 slide has completely been cropped (annotated in the shot below):

    [​IMG]


    Now, compare these results to the original output of Keynote via its (buggy) native TV output already shown in section “4. Buggy Native TV Out in Some Apps? Disable it With DO!”:

    [​IMG]

    Can you see how immensely better DO's output is? Sure you can.

    5. DRM'ed (Protected) Video Playback Over the VGA Adapter

    Should you want to render a video you've purchased from iTunes Store, you need both a HDCP-compliant receiver and a connector actually able to support HDCP.

    While most monitors with HDMI or DVI-D inputs (remember? You can directly connect a HDMI source to DVI-D monitors without any quality loss) do support HDCP, there are two main cases you will need to find a way of directly outputting your DRM'ed content:

    - you try to route the signal to a receiver not compatible with HDCP; almost all consumer video capture units (for example, the Elgato Game Capture HD) belong to this category
    - you need to drive your display / projector via Apple's VGA adapter, which doesn't support any kind of iTunes Store video playback either. Unfortunately, Apple doesn't mention this fact at all on their product page – actually, they even state “It also outputs video content - movies, TV shows, captured video- to your big screen in up to 1080p HD.” (“movies” and “TV shows” emphasized by me). This is one of the reasons screwed-up customers have posted quite a few bad reviews of the, otherwise, excellent adapter; for example, (currently) two of the three most useful user reviews complain of this. Note that the description of the Lightning version forgets(?) to mention this too – no wonder many burnt customers have posted one- and two-star reviews (of the three most popular ones, one complains of exactly this).

    [​IMG]

    (The non-authorized message you'll ALWAYS get when trying to lay DRM'ed content over the VGA adapter.)

    Note that this applies to all Movies / TV shows / Music Videos you download / purchase from iTunes Store, even(!) freely available ones like Clone Wars: Revival. (iTunes U downloads and video blogs / channels don't.)

    With DO, you can play back these videos on your external monitor as the stock Videos app (the only player on iOS to play back HDCP'ed content) won't detect the internal screen is being mirrored to the external monitor and, consequently, won't stop playback.

    Note: as there's no overscan with the VGA adapter (as opposed to the HDMI one), you'll need to use a somewhat lower scaling value than with HDMI to make 16:9 content fill the entire external screen: 4/3, that is, 1.3333.

    5.1 Major Image Stuttering / Out-Of-Order Problems? Reduce Resolution or Quality!

    As with playing games or running 3D-heavy stuff, you may encounter major image stuttering. In these cases, you'll want to either reduce resolution (for example, on a Retina-screen iPad, from 1080p to SXGA to XGA) or quality (from HQ to LQ). When using a VGA adapter to drive a 16:9 widescreen monitor, you'll generally want the latter to keep the 16:9 output aspect ratio. (With XGA and SXGA, the aspect ratio would be 4:3, which you don't want. The VGA adapter doesn't support the 720p output setting – the one that would offer 16:9.)

    As usual, I've made a demo video demonstrating all this, that is, the typical frame repetition / out-of-order presentation errors in the HQ mode. The video also shows there are no such errors in the LQ mode. It also shows Apple's VGA adapter doesn't support DRM'ed playback.

    http://youtu.be/UO8uFRXw6F0

    The video has been made on an iPad 3 running iOS 6.1.2. I use the movie “Men in Black” I've purchased from iTunes Store and, consequently, having DRM. I've chosen a fast-moving scene starting at around 6:40. The video is slowed down by a factor of two so that you can have an easier time finding whether there have been messed-up output frames.

    At startup, DO is in 1080p (that is, maximal resolution) and low quality mode. As you can see, there aren't hiccups in the mirrored image. There don't seem to be any dropped frames either – after all, the original movie is 24 fps only and DO is capable of mirroring at around 40-50 fps at 1080p (too) on an iPad 3.

    At 1:08, I enter Setup > DisplayOut > switch to HQ mode and resume playback at 1:40. As you can see, there are a lot of messed-up frames.

    Finally, to show you Videos indeed refuses playing back DRM'ed contents over VGA, I switch off DO entirely at 2:45 and resume playback at 3:05. The video plays for about a second on the external screen but, then, stops entirely and, around at 3:10, a dialog is displayed on the internal screen stating it's unable to play back the video on the external screen.

    Note that it was too late when I noticed the Settings screen is pretty much overexposed (the part of the movie I chosen was pretty dark and fixed exposure was used) and it's almost impossible to see anything. Therefore, I've shot another video (it's HERE) where I always decrease the screen brightness before entering Settings and increase again after exiting it. This way, on the internal screen, all the actual settings are visible. Note that, this time, there weren't messed-up frames in HQ mode either. However, the circles of some previous touches remained visible on the external screen. I set the quality from Low to High at 2:00 and, then, disable DO altogether at 04:00.

    5.2 Will you Want to Use This to Record your iTunes Store videos Without DRM?

    While it certainly is possible, I wouldn't bother myself. The already-not-very-good quality of iTunes Store videos are already decreased by the Full HD -> Retina scaling inevitably occurring. This is because Videos doesn't support windowed playback: it'll scale up everything to full screen, meaning stretching in both dimensions. For example, it'll stretch the video's width from 1920 to 2048 pixels. As you know, every scaling operation takes a toll on image quality. So does Videos' fullscreen-only mode. Unfortunately, as DRM'ed videos can only be played back in the stock Videos client, which means you can't even rely on third-party, non-scaling players not using the full screen for playback; for example, that of mine. (Please see THIS article for more info on this.) And that's just the beginning: recompression further decreases the, compared to quality sources (Blu-ray in general) already-weak IQ; the target video will use 30 fps and not, as is the case in most cases, 24 and so on.

    Actually, it's the best not to purchase any movies from iTunes Store at all. Get the Blu-ray version instead, rip it and convert it to be iOS-native. Generally, they're of the same price (or only slightly more expensive); after grabbing and reencoding, have no DRM; their extras are playable on iDevices (unlike with iTunes Store movies); they, generally, have significantly better image and audio quality (see the numerous threads and articles proving this), with, in cases, several audio and subtitle tracks (while iTunes Store movies only have the ugly and non-standard Apple CC track – if at all.) Then, you won't even need to resort to using DO to play back your DRM'ed videos on an external screen either.

    (continues below)
     
  5. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    (continued from above)

    6. Found a Video Streaming App Displaying a Black TV Screen?

    Several streaming apps (for example, HBO GO – see THIS) display just blackness on an external TV screen. As they actively display empty content on an external screen, they effectively disable mirroring. You can, by default, not display on an external TV the content played back on the inner screen from these apps.

    DO is one of the jailbreak ways to fix this. As it disables apps' discovering external TV's, these streaming apps won't detect the external screen and, therefore, won't just send empty content to it. DO will mirror just fine the inner screen of these apps.

    7. Use The Old Composite or Component Cables for Screen Mirroring (pre-Lightning only!)

    There may be cases you may want to use the old composite or component cables for mirroring, for example, you have an

    - old, analogue CRT TV (or capture device) to connect to without HDMI, VGA or DVI input
    - old iDevice not even supporting the 30-pin HDMI / VGA adapters (every device before the A4-based ones; that is, every iPhone up to the 3GS and iPod touch up to the 3G)
    - you have a newer device but don't want / can't purchase a high-res (HDMI / VGA) adapter

    In the first case, you can, of course, go the HDMI / VGA -> active composite / component converter way. It's, however, expensive (dozens of US$, even if you order the cheapest possible Chinese units), requires its own power source and isn't exactly small. In addition, the output quality may be even worse than in the case of directly driving the TV via one of the old cables. That is, even then using DO for mirroring over the old cables is a good idea. (Note that, if you have a Lightning-based device, you can only go the active converter way as, currently, Apple don't offer composite / component cables for the new connector and the old ones cannot be used with Apple's Lightning-30 pin adapters.)

    7.1 Using Mirroring on Really Old iDevices

    If you belong to the second category, I have some good news for you: on third-generation iPhones (3GS) /iPod touches (3G), DO already runs at a speed allowing for pretty good results, good for gaming too. Given that very few games support natively these pre-A4 devices, this is certainly good news. Of course, you shouldn't expect much from the output resolution: the screen resolution on these pre-A4 devices is 480*320, which is significantly lower than even the resolution of these standard-definition cables. It's only in the last case (A4+ iDevice) that you can expect tolerable (SD-resolution) output.

    As always, I've made demo videos showing all this.

    The following is an iPhone 3GS video using the component cable with DisplayOut in HQ mode. As I used the component cable and not the (interlaced) composite one, I didn't need to enable flicker suppression. The video is played back at half speed as it was recorded in 720p60:

    http://youtu.be/4CISi6n_m3I

    First, I show Real Racing 2, then, Sonic & SEGA All-Stars Racing and, finally, Ducati Challenge.

    Note that while Real Racing 2 does have native TV out support, it's only utilized on iDevices with the A5 CPU and later. The 3GS has a CPU that is two generations older; therefore, RR2 doesn't drive the TV directly on that iPhone model.

    The two other games are of the very few ones that do have native TV out support on the 3GS. I've selected these two titles because I wanted to see how mirrored play compares, speed/fluidity-wise, to the direct TV out. (The resolution is, of course, considerably better with non-mirrored modes.) I've also uploaded the direct capture HERE and HERE for Sonic & SEGA All-Stars Racing and Ducati Challenge, respectively. As you can see, these captures are clearly faster but, again, the DO-mirrored versions were also pretty well playable. And, again, there are only some 10-15 games with TV out on the 3GS; for the rest to be shown (in this case, mirrored) on an external TV, you will need DO.

    Also note that I've also recorded the direct TV out of the phone. It's available HERE (another YouTube video. This, as it's direct RGB stream capture, has audio and is played back at normal speed)

    8. So, you Don't Want to Enable Native HDMI / VGA Screen Mirroring On Your A4 Device?

    As I've mentioned in the introduction, you can easily enable the standard, stock(!) mirroring of the screen of all the three A4-based iDevices by simply adding a new entry (display-mirroring) to their respective capabilities plist files:

    - /System/Library/CoreServices/SpringBoard/K48AP.plist for the iPad1
    - /System/Library/CoreServices/SpringBoard/N81AP.plist for the iPt4G and the iPhone 4

    The way this is done is explained for example HERE. Note that there's no way of enabling mirroring over wireless AirPlay, only via these two hardware adapters.

    If you, for some (strange?) reason don't want to enable mirroring or just need the extra features of DO not available in stock mirroring, I have some good news for you: DO works great on A4-based iDevices too.

    8.1 An iPad1 Example Video

    Of course, there still will be some types of content you won't be able to mirror with DO. For example, the mirroring of very fast games like After Burner will most probably be full of misplaced frames. This is perfectly visible in the next video I've shot on the iPad1.

    http://youtu.be/CQ5uY8ta248

    The video is shot at 720p60 and is played back at half the speed. (Sorry for the focus problems. Noticed it far too late.) It shows my 60p counter video and After Burning with screen mirroring via both the built-in HDMI / VGA mirroring and via DO. I always show the relevant setting in Settings so that you can see in which mode the mirroring is in.

    First, I test stock mirroring (after editing the capability plist file, of course), which you can also see in DO's Settings dialog, where, as you can see, it's disabled. At 0:15, I start nPlayer, which has both native TV out support but you can always disable it after starting playback and return to simple mirroring by just tapping the TV icon in the center of the screen. I do this too at 0:20 – after all, what we need to find out is the comparative fluidity, lag and flawlessness of the two ways of mirroring.

    As you can also check by advancing over the individual frames one-by-one, the standard mirroring has pretty much the same framerate as the on-screen video; that is, (again, stock) mirroring works as intended. The on-screen vide playback, unfortunately, isn't really 60fps, not even when the GUI becomes hidden (around 0:32, when the counter reaches 289). The lag is around 3 frames, which equals to 3 * 1/60 = 0.05s. (Note: the A4-based iPad1 is incapable of true 1080p60 playback, unlike A5-based iDevices. Unfortunately, it was too late when I realized this. Nevertheless, this test is still excellent at allowing for testing both the lag and whether frames are dropped on the external TV screen.)

    At 01:00, I enable DO and also configure it to use XGA-resolution mirroring and continue playing the 60p test video. Unfortunately, as with the previous (stock mirroring) case, the video is still played back at a considerably lower framerate than 60 fps. Nevertheless, there aren't dropped frames on the external screen (counter frames that are displayed on the internal screen but not on the external one).

    After this, at 02:11, I start “After Burner”, TV out wise one of the most demanding title. This is an excellent game to directly compare the speed of the first-generation and second-generation 30-pin HDMI adapters (more info HERE). Of course, in these tests, I've used the faster second-generation one.

    Unfortunately, DO does drop some frames while mirroring. Nevertheless, the game itself is also pretty stuttering on the inner screen too; for example, at 05:21, this single frame is kept on the internal screen for no less than 22 frames, resulting in an effective framerate of less than 3 fps (22*1/60=0.366= 2.72fps):

    [​IMG]

    You can easily spot some out-of-order frames in this video too. For example, at 05:56, a frame looks like this:

    [​IMG]

    Here, I've annotated the overtaking airplane on the right on both the internal and TV screen. On the internal, it's already a bit more far away as there is some 40-50ms of lag.

    Now, let's advance by 1/60 sec, to the very next frame:

    [​IMG]

    See? The plane overtaking me on the right has gone backwards on the TV screen, while it continued to get more distant on the internal one.
     
  6. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    After this, while the internal screen is continued to be updated, the external one stays the same for seven frames. After that, it's finally updated, by advancing the overtaking airplane a lot:

    [​IMG]

    You'll see a LOT of such out-of-order frames on all devices particularly with 3D games and benchmarks like this. Should you want to see this all for yourself with a free app, I recommend GFXBench (Universal; free; AppStore link). Its output on the TV will be full of out-of-order frames. (Note that the output will also be very slow – but without frame order problems – using the stock mirroring support too, even with the fastest adapters, that is, not with the 30-pin VGA / first-generation HDMI ones.) Also, while playing back movies, you may encounter them; there, however, you can easily get rid of them by either decreasing the output resolution or switching to LQ mode.

    After this, at 6:19, I disable DO in Settings; that is, I let the stock iOS mirroring do the screen mirroring from then and, then, continue playing After Burner. As you can see, there are absolutely no lag, no dropped frames on the external screen this time (as opposed to the previous, DO case) and no graphical glitches (out-of-order frames) can be spotted.

    At 9:02, I re-enable DO and, at 9:23, I enable tap position showing on OpenGL screens too. Then, I return to playing After Burner. As before, the external TV lags a bit, has some major framedrops and also shows some out-of-order frames – probably even more than in the no-touch-shown case. Nevertheless, the tap position (in the lower left corner) is correctly shown. Finally, at 10:55, I disable touches again but let DO still mirror the screen and continue playing. The TV out signal is still marred by out-of-order frames – but to a lesser extent than with tap positions shown.

    9. An iPad3 Example Video

    I've shot a video featuring the iPad 3 too, also with the same After Burner and 60p counter video. It's at

    http://www.youtube.com/watch?v=GlCV5iE-EvA

    I start with DO disabled (that is, using the stock mirroring support) and with After Burner. As you can expect of the second-generation 30-pin HDMI adapter, mirroring is, speed-wise, pretty much flawless.

    Then, at 3:05, I enable DO (with 1080p output resolution and HQ) and resume After Burner. The TV out footage is almost useless: it's marred by plenty of out-of-order frames, making it much-much worse than the iPad 1 footage (see the previous section).

    Then, as I've also done on the iPad1, I enable touch position display at 4:05 and resume playing. While the touch positions are indeed correctly displayed, the TV out is pretty much a mess.

    Now, at 4:39, I switch back to no-touch-positions-during-OpenGL and, at 4:50, I switch to LQ mode from HQ (while staying at 1080p), after which I resume playing. While there are some glitches now and then, the output seems to be better.

    After this, at 5:23, I switch back to HQ mode and start the 60p counter video playback. As soon as nPlayer's GUI is hidden (the counter being at around 250), the framerate increases to the nominal 60 fps on both the internal and external screen. The lag is steadily between 3 and 4 frames corresponding to around 3.5*1/60=58ms lag. (As you may remember as I've also pointed it out above, with the standard, stock mirroring, there was absolutely no lag.) This is pretty much acceptable and certainly a lot lower than the lag of Apple's own Lightning-based, new adapters.

    Finally, I disable DO again (at 6:18) and resume playing back (in mirrored mode – again, it's very easy to do in nPlayer by a simple tap) the 60p counter video. As you can see, after nPlayer's GUI is hidden, the framerate is a steady 60p on both screens and the lag is around 1 frame; that is, about 1/60s.

    10. Some iPad2 Example Videos

    10.1 RGB


    I've run some tests on the iPad2 + RGB cable combo too. The lower resolution (576p vs. 1080p) and the four times less number of input pixels have resulted in a mirroring without visible out-of-order-frame problems.

    The first half-speed video of Iron Man 3 is at

    http://youtu.be/bP0ANQa2V0Y

    (Shot with enabled High-quality mode of the tweak.)

    As you can see, in this case, even full-screen OpenGL games are properly mirrored, with high speed.

    The second, quarter-speed video is at

    http://youtu.be/WtP3hMLMcTU

    and shows the output framerate and lag when mirroring in both High-Quality (first half of the video) and Low-Quality (second half) modes.

    As you can see, the framerate is very close to 60 fps in both cases and the lag is 2 frames; that is, 2*1/60s = 0.033s. This is roughly one-third of the lag of the new Lightning-HDMI / VGA adapters and one-fifth of the wireless Apple TV. That is, it's excellent for gaming if you, for some reason, must use these old cables to output your image to on newer iDevice models still supporting analogue TV out.

    10.2 Second-generation HDMI

    In the video at

    http://www.youtube.com/watch?v=ucdt4h6D3g0

    I show the iPad2 running Real Racing 2 (using its native TV out), Real Racing 3 (with mirroring as it doesn't have native TV out) and After Burner. First, I do this with simple, stock mirroring; then, I enable DisplayOut at 11:39 with 768p output resolution (set at around 12:30) and HQ mode. (You may remember that the iPad2's screen is XGA (768p) resolution only so there isn't much point in outputting it at 1080p, particularly not with games where it can easily result in out-of-order frames to be shown.)

    Then, I immediately start playing After Burner. As you can see, while the framerate on the external TV isn't as good as with the internal screen, there are only few out-of-order frames – much fewer than in the iPad 3 test above.

    After this, I start GFXBench, still in the same configuration (768p output resolution, HQ mode) to show you some easily-spottable out-of-order frames. I quickly configure it to start right with the bike scene, the rendering of which starts at 18:07. As you can see, the footage is full of such frames.

    Finally, I show you a certainly less demanding game: Real Racing 3. While the framerate isn't as good on the external screen as on the internal one, I haven't spotted out-of-order frames in the footage.
     
  7. Menneisyys

    Menneisyys Well-Known Member

    Dec 12, 2008
    1,594
    0
    36
    #7 Menneisyys, Jun 3, 2013
    Last edited: Jun 6, 2013
    11. What about the iPad 4?

    At the end of Section “2.2.1 How Does DO Compare?”, I've already stated using the iPad 4 in general for high-quality video output isn't as good an idea as doing the same to the iPad 3 if effective mirroring resolution is by far the most important. (As you may recall, currently, the iPad 3 and 4 are the only iPads with Retina screens; that is, where the resolution superiority of DO can pay off, as opposed to the lower-res iPhone 5, iPad mini and iPod touch 5G or anything other small-screened.) However, the significantly higher graphics and CPU performance makes the iPad 4 a better choice for displaying games on an external TV.

    In the following two subsections, I provide you with framegrabs and full videos proving this all.

    11.1 Resolution

    This is how the stock mirroring mirrors the resolution chart:

    [​IMG]



    [​IMG]




    And these is the results of DO:

    [​IMG]



    [​IMG]



    As you can see, the additional, obligatory scaling step introduces a lot of false detail; hence the strong moire on particularly the 1x1 checkerboard.

    11.2 Touches in fast-paced OpenGL games

    As opposed to using DO to enhance the effective resolution (which is, again, not recommended), the iPad 4 is sufficiently fast to output flawless DO output even in 1080p HQ mode, with touches enabled. In the following pair of videos, I couldn't find any out-of-order or, otherwise, messed-up frame while using DO. Nevertheless, the effective framerate of the DO output was definitely lower than that of the direct (stock) mirroring. With the latter, I've very rarely noticed the frame rate dropping under 30 fps; with DO doing the mirroring, frequently. Nevertheless, if you do need touch position display (or, at least, it's more important than the framerate) and you do have an iPad 4, you may want to consider using it with DO for your demo instead of the stock mirroring or other, earlier iPads, even if they're better at outputting truly 1080p (the case with the non-Lightning, that is, non-crippled, Retina iPad3).

    720p60 (that is, double-speed) dual camera recording:

    http://youtu.be/NzSwUdwY2D8

    Direct stream capture at 1080p30:

    http://youtu.be/xDChzIFUPEY

    Note: the cumulative lag (that of the Lightning compression/decompression process and that of DO) is 7...8 1/60s frames; that is, about 7.5/60 = 0.125 sec. This is perfectly visible around 5:05 in the dual video. The lag shown by the direct screen mirroring is around 5 frames, that is, 5/60= 0.083 second (see the dual video around 06:55). The latter perfectly matches my previous Lightning lag measurements.
     
  8. PresidentZer0

    PresidentZer0 Well-Known Member

    Dec 7, 2012
    227
    0
    16
    Thank you so much for this.

    I am on ipad three right now and I kinda want to upgrade because of the better performance of the 4.

    Problem is I don't know if I can handle the lag when I want to play some games in my hd tv.

    For now I have the old hdmi adapter a1388 and there too is kind of an lag. And it bugs me. Is the lightning lag even higher or is it the same?

    Don't know if you can try out the lag with iPad 3 and the old hdmi cable.

    It feels almost like a second.


    Another thing: is it possible that apple can fix the lag with an updated version of a new lightning hdmi? Like they did with the 30 pin hdmi?
     

Share This Page