美文网首页
[转] Inside DuetDisplay and Unatt

[转] Inside DuetDisplay and Unatt

作者: __承_影__ | 来源:发表于2018-08-18 14:30 被阅读10次

转自 http://ich.deanmcnamee.com/re/2014/12/18/DuetDisplay.html

I read about Duet a few days before its release. There were some interesting claims being suggested — “ex-Apple engineer” is able to run a display over the lightning connector, with zero latency. The marketing made it sound like this Apple-insiderness allowed them to do something new, perhaps a hardware level / accelerated connection with the iOS device to run it as a “real” display at 60 FPS. So how does it work?

Overview

The Duet driver creates an additional display, a memory backed framebuffer. The pixel contents of this framebuffer display are captured and compressed (with the help of CocoaSplit) and sent to the iOS device through the iTunes TCP over USB transport mechanism implemented by PeerTalk. So in the end this is quite like a VNC over TCP over UDP, so I find the claims of “zero lag” and 60 FPS to be a bit dishonest. This is not something like a DisplayLink connection.

Open-Source Libraries

Before Duet was released for iOS, the Desktop Duet.app was available to download. Taking a look at the binary revealed code from a few open-source libraries:

Credits?

Credits? I am not a lawyer and generally not a psychopath about software licensing. However, having spent much of my life on open-source software, I feel that when someone gives you something to use, commercially, free of charge, with attribution as the only obligation, that’s a pretty good deal. You really have a responsibility to do the right (and legal) thing. As far as I’ve seen, none of the above libraries are attributed anywhere in Duet. Additionally it seems CocoaSplit is licensed under the GPL. Uh oh.

PeerTalk

PeerTalk uses the iTunes usbmux system to relay TCP connections across the iOS USB connection. I am surprised that Apple has approved this in the AppStore, as it uses a reversed engineered interface to the usbmuxd socket. The good news is that if Apple has approved Duet, it means if all is fair anyone else should be able to use usbmux also.

scheduleReadPacketWithCallback

Disassembly of “DuetUSBChannel” as compared with PTUSBChannel scheduleReadPacketWithCallback. It seems the main difference between PeerTalk and the version in Duet, is the prefix has been renamed from PT to Duet. Why?

CocoaSplit

CocoaSplit is designed for capturing and streaming a display.

420v.fgsh

420v fragement shader included in Duet.app, as compared to the shader in CocoaSplit. Now, this is quite similar to one of the examples from Apple, however notice that the variables are renamed and it matches the whitespace and naming from CocoaSplit identically.

PreviewView

Duet’s PreviewView, as compared with the same from CocoaSplit.

GPUImage

GPUImage is a general purpose library of image processing via OpenGL.

GPUImage

GPUImageFramebuffer as seen in Duet.app.

Driver

I haven’t looked very deeply at the driver, but it is implementing a virtual screen framebuffer, similar to what is done by EWProxyFramebuffer. I’m not suggesting that any of the code from EWProxyFramebuffer was used. However, if you were to try to implement something similar that would be a good starting point.

相关文章

  • [转] Inside DuetDisplay and Unatt

    转自 http://ich.deanmcnamee.com/re/2014/12/18/DuetDisplay.h...

  • Inside

    4:38, 北京天空蒙蒙亮, 空气中悄无声息, 但不知怎么的, 有一种说不出的不和谐 …… 太静了。 阿diang...

  • INSIDE

    我不知道我之前经历了什么,但我知道,我不能被他们抓住,那些大人,恶犬,从天而降的铁丝,都那么令人恐惧,我一路行来,...

  • inside

    2019022315:40~20:03 inside很久没玩类似这种横版剧情解谜向游戏 inside 配色,音效相...

  • PC使用duetdisplay导致其他软件无法正常使用

    在Win10上安装duetdisplay时出现以下问题: Chrome出现白屏 网易云音乐无法显示 vs2010出...

  • 价值投资、ETF、数字黄金,区块链未来的方向在哪里?

    上周,交易所交易基金(Inside Exchange-traded funds, Inside ETF)举行了以“...

  • 零碎小技巧--terminal

    在bash-profile里面记录好 【alias gateway2inside3='gateway2inside...

  • Inside me

    love me hate me kiss me hug me want me fuck me lips minds...

  • Bugs inside

    真实意识到自己的嫉妒之心,仅仅因为很多人帮她点赞我便开始去比较记恨起一些人了。 她们更喜欢她,也更信任她,这也许是...

  • inside me

    昨天室友问我“为什么像我们这样唱歌不好听的人还要拼命去练尤克里里和吉他?” 我不知道她这种想法从...

网友评论

      本文标题:[转] Inside DuetDisplay and Unatt

      本文链接:https://www.haomeiwen.com/subject/bidfiftx.html