Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AU/Vista HDMI input through mipi port #17

Open
Duckodope opened this issue Apr 24, 2022 · 36 comments
Open

AU/Vista HDMI input through mipi port #17

Duckodope opened this issue Apr 24, 2022 · 36 comments

Comments

@Duckodope
Copy link

Hi there, i wonder if it will be possible in the future to add a attach a female hdmi port to the vistas mipi input to transmit whatever signal you like. That would be pristine for gimbal operating to get framing perfect. Yes latency would go up but thats not a big problem if it stays below 200ms or smth like that.

Greets

@CorruptName
Copy link

This is already theoretically possible. Runcam makes "unlicensed" cameras using mipi. While I agree that this would be very cool, it is outside the scope of margerine (IMO).
All that is needed is the MIPI pinout and a HDMI->MIPI Adapter (usually a small amount of lag in these adapters). This process would also allow someone to use an Action Camera such as GoPro or any camera with HDMI out to to broadcast over DJI.
Perhaps Margerine can allow us to obtain the MIPI Pinout? Don't know where to look personally..
I asked runcam for the pinout long time ago, they declined calling it their "intellectual property" to which I laughed. If anything, it's DJI's IP.

Cheers, I too look forward to the day when we can broadcast HDMI over DJI. This would especially be nice for Simulators.

PS: I'm In no way saying that we couldn't use custom software to inject display data over USB into an air unit for broadcast, but your question was about MIPI - which I agree is the preferred method.

@CorruptName
Copy link

CorruptName commented May 4, 2022

Hi there, i wonder if it will be possible in the future to add a attach a female hdmi port to the vistas mipi input to transmit whatever signal you like. That would be pristine for gimbal operating to get framing perfect. Yes latency would go up but thats not a big problem if it stays below 200ms or smth like that.

Greets

I looked a bit more and it seems that the pinout has already been discovered..
121822544-8812e600-cc97-11eb-93b2-94345ca27691
.

Not sure but you may need a 4 channel HDMI to MIPI board (most seem to be only 2 channels). If so, they ARE available. Seems the C780B board has 4 channels. GL

@Duckodope
Copy link
Author

I think the hardest part now will be sourcing the socket for those dji mipi connectors

@CorruptName
Copy link

CorruptName commented May 4, 2022 via email

@j005u
Copy link
Contributor

j005u commented May 4, 2022

It should be possible if you manage to source the connectors (I know someone who tried and wait and waited and never got them) and match the MIPI stream config exactly as the RTOS on the Vista/AU is expecting a very specifically configured video stream. I don't know the details but they can probably be reverse engineered from the RTOS binaries/logs.

@a1axx
Copy link

a1axx commented May 7, 2022

I think the hardest part now will be sourcing the socket for those dji mipi connectors

Perhaps just use an existing cable? Solder it to the hdmi adapter

@CorruptName
Copy link

CorruptName commented May 7, 2022 via email

@Duckodope
Copy link
Author

I think the hardest part now will be sourcing the socket for those dji mipi connectors

Perhaps just use an existing cable? Solder it to the hdmi adapter

In my opinion someone would need a socket soldeted to a custom hdmi to mipi converter. I dont think cutting an existing cable and then splicing and soldering the tiny coax cabels to a pcb is a viable or even possible option. Does anyone know what this socket is called? Let alone even knowing the manufacturer would be a huge step forward. I'm sadly not able to figure out what kind of chips it would need to convert the hdmi signal quickly enough into mipi. And how the signal even has to look in the first place.

If anyone needs help in CAD design for a project i would be happy to help in exchange for help with this problem.
:D

@CorruptName
Copy link

CorruptName commented May 7, 2022 via email

@CorruptName
Copy link

CorruptName commented May 7, 2022 via email

@Duckodope
Copy link
Author

Is this method you are talking about already working? Do you think you could use a hdmi to usbc converter to make this possible?

@CorruptName
Copy link

CorruptName commented May 7, 2022 via email

@wyldrlorenz
Copy link

Is there any news about this topic? I am looking for a HDMI Input feature on the air-unit side for a while now. The "splitting cable method" was also my last option.
Here are the mpi-hdmi adapters I would have tried:

https://www.digikey.de/short/vffprdv7
https://www.distec.de/produkte/tft-komponenten/tft-controller/detail/distec/prismamipi-hdmi/

@j005u
Copy link
Contributor

j005u commented Nov 16, 2022

No news that I'm aware of, don't think anyone is actively working on it. A couple of notes:

  • MIPI is not a standard that auto negotiates feed configuration, you are expected to do that on your own. It's more or less just a dumb pipe. For MIPI in to work you have to match the exact video format as expected by RTOS from 60fps cams. These have not been documented.
  • The pinout you posted has not been confirmed to be correct
  • Air side only has USB 2.0 and while theoretically OTG capable, we haven't figured out how to connect any anything to it yet. For one, it's not wired up to power any connected devices.
  • The only way to do it via USB would be to figure out how to enable OTG and then use a USB 2.0 capture card of some kind
  • The above would also entail figuring out how to compile new kernel modules for the appropriate drivers and would need a bunch of custom software to get the data over to ground side. Displaying in real time on the Goggles is also not going to be simple, but it might be possible to use the simulator pipeline for h264 decoding

Both approaches are very hard at best. The MIPI one stands a better chance in my mind for sure, as it doesn't require a ton of very hard custom software. You'd still need to figure out the exact video stream format by reverse engineering the RTOS (or getting Caddx/Runcam to spill the beans) and finding a converter that is able to output that exact format.

I would say the more realistic option is to look at proffesional solutions that can do this, such as the DJI Transmission.

@vr2045
Copy link

vr2045 commented Jul 6, 2023

I started down this path as well a little while back :) I quickly came to the conclusion that messing with the hot metal box transmitter thingie is a non-starter as it requires hacking deep into the guts of the thing. I settled on a man-in-the-middle on the MIPI stream itself as that would allow a more modular and clean solution.

The connector is this one. I confirmed this by building a small board here. The micro-coax cables fit properly.

The pinout referred to above is almost correct: its missing the I2C as well as clock signals that are mis-labelled as ground.
Unfortunately, I am off by one on the power on my board so I had to hack my hack to get the passthrough to work but I seem to have killed my camera in the process :(
Am planning to build another board that will have this issue fixed and allow me to probe the MIPI signals to figure out the data rate and other settings of the MIPI stream.

I looked at the I2C traffic to the camera briefly and its interesting: after initial camera configuration, the metal box sends what is probably auto exposure/gain to the camera using the 1MHz I2C protocol. Simply adding a MIPI source is unlikely to keep the metal box happy: a spoof of the camera is probably required at a minimum so it gets the right responses back from the camera: not too tough to do but work required here. With my little adapter, I should be able to capture the I2C data quite easily for analysis.

Havent put in all this data into the repo yet.

The above work is open source. Happy to collaborate if someone is interested.

On a commercial front, I'm currently building a Lattice FPGA (Crosslink NX 33U) based 1"x1" module (to be released in 3Q'23) that will handle MIPI <-> USB3 conversion. Should be able to hijack the MIPI stream and sniff/inject MIPI.

@bri3d
Copy link
Collaborator

bri3d commented Jul 6, 2023 via email

@vr2045
Copy link

vr2045 commented Jul 6, 2023

CADDX Nebula pro vista

@bri3d
Copy link
Collaborator

bri3d commented Jul 6, 2023

Nice - if you use a 60fps camera you'll find it's quite a bit simpler as they don't rely on I2C in the same way. The 120fps cameras (AP1xxx ISP) rely on parameterization and firmware from the host side over I2C, the other cameras won't be using I2C at all as far as I can tell as they rely on some fixed parameterization installed on the camera and aren't configurable.

@j005u
Copy link
Contributor

j005u commented Jul 7, 2023

The I2C comms are relatively trivial to sniff and reverse engineer from a device / the firmware btw, but yeah if you go for 60fps then I2C shouldn't be required at all.

I think AVB should be handled internally in the AP1302 firmware rather than by the host ARM SoC, but I might be mistaken.

@AlureonTheVirus
Copy link

The pinout referred to above is almost correct: its missing the I2C as well as clock signals that are mis-labelled as ground.

Unfortunately, I am off by one on the power on my board so I had to hack my hack to get the passthrough to work but I seem to have killed my camera in the process :(

Am planning to build another board that will have this issue fixed and allow me to probe the MIPI signals to figure out the data rate and other settings of the MIPI stream.

Wait so does anyone know what the true pinout for the connector is? I'm working on a similar design to adapt digital FPV to the raspberry pi CM4 and I can't find pinout information on any of these things that doesn't contradict itself.

@propw4sh
Copy link

Finally a group of like minded individuals. I’m working on getting hdmi input to my goggles 2. Either via the vista or air unit via mipi adaptor (anyone know the estimated lag?)

or having the input linked directly to the screens on the goggles 2. I’d just power the screens via a switch and have hdmi in from there? Anyone know what model screens are in the goggles 2?

talking about getting hdmi input to the vista or air unit, imagine the range capabilities of having say your vista unit a few yards away and running say hd zero?

im really interested in getting this going as long as the lag isn’t unplayable on a sim for example

@AlureonTheVirus
Copy link

AlureonTheVirus commented Aug 29, 2023

MIPI is not a standard that auto negotiates feed configuration, you are expected to do that on your own. It's more or less just a dumb pipe. For MIPI in to work you have to match the exact video format as expected by RTOS from 60fps cams. These have not been documented.

I've been messing around with a Runcam Wasp digital FPV camera (it's 120fps, so I'm not sure how relevant this is to 60fps cameras) I have on hand. It has an FH8323 video processing chip on board and my guess is that this is used to touch up the image from the sensor before it goes through the MIPI interface back to the transmitter.

There's not a lot of info on the chip besides a short product brief in Chinese and the datasheet isn't readily available after a quick google search. I decided i'd email Fulhan and see if I could get the datasheet on it because it might contain info on the video format over MIPI. It's completely in Chinese, but if anyone wants it here it is.

https://drive.google.com/drive/folders/1E9Nua7Ku6e4FVbhYvsGz-NqtvuZIeDL7

I'm guessing/hoping that the MIPI format should be relatively the same for DJI fpv cameras, so maybe this would let us drive arbitrary video into the air unit or get video out of the cameras. (I.e if you could send video in the same format this chip does, the air unit wouldn't be able to tell the difference)

UPDATE: Managed to run the PDF through google translate. I can't be sure that anything in there is actually correct but i've added the translated datasheet to the drive I posted earlier)

I will put any other information I find on this chip in the drive as well.

@TelefraggerRick
Copy link

Anyone have any updates on this? Ive been looking at it too but seem to be getting bogged down in translation and slow shipping from aliexpress on parts

@AlureonTheVirus
Copy link

Anyone have any updates on this? Ive been looking at it too but seem to be getting bogged down in translation and slow shipping from aliexpress on parts

I'll be honest I'm not really sure it's possible anymore. I've basically given up on the project. If DJI was a little less proprietary about what protocols they use then it would probably be more feasible. Lack of docs and support + the need for custom hardware AND firmware to encode into and out of the various formats just drove this into the ground.

In the meantime though, I'll +1 this too. Hopefully someone smarter and more capable than I has some better insights to figure it out. Would love to be able to get video off of one of these cameras and into a Pi or something.

@TelefraggerRick
Copy link

i was hoping to be able inject analog signal into an old vista unit (via the mipi connector and remove the camera). Use it as a VRX to get analog into goggles 2

@AlureonTheVirus
Copy link

i was hoping to be able inject analog signal into an old vista unit (via the mipi connector and remove the camera). Use it as a VRX to get analog into goggles 2

Yep, I think that's the main problem most people are trying to fix. I'm more invested in the other half for getting video off the cameras. Two halves of the same problem I guess. We figure out the protocol off of a camera we can emulate it and get arbitrary video into an AU (and vice versa).

@bri3d
Copy link
Collaborator

bri3d commented Jan 24, 2024 via email

@TelefraggerRick
Copy link

Very interesting and very promising. I wish I had knowledge of FPGA but unfortunately I don't. In saying that I am obviously willing to help anyway way I can.

All such a shame though that DJI does not allow HDMI input over the USB-C port and obviously the reach of the market for goggles 2 don't warrant enough people trying to root them to allow software changes for this to happen.

@vr2045
Copy link

vr2045 commented Jan 24, 2024 via email

@TelefraggerRick
Copy link

I will repost it here for you. You need to be part of the wtf.os discord to see it.

Auster
Thank you all.

In order to unlock compatibility with normal cameras the last problem must be solved. It is 1080p 24-60fps HDMI input.

During my research only two MIPI CSI modes were found:

  1. Dumb mode - 720p 50/60fps YUV422 8bit. No configuration is required.
  2. AP1302 mode - 1080p 50/60fps or 120fps YUV420 8bit. AP1302 emulation required.

With the first approach, video must be down-scaled to 720p before HDMI-CSI bridge. Also, at least 50 fps must be provided which might be a problem too.
I'm searching for capable ICs, but unsuccessful yet.

In the "AP1302 mode", the challenge is a conversion from RGB888/YUV444/YUV422 to YUV420 8bit.
Here is a couple of ideas.

  1. Use a combination of the CSI-2 Serializers/Deserializers.
    It is possible that some of the deserializers can output YUV420 8bit.

  2. Use FPGA for format conversion. But I have zero knowledge in FPGA.
    If I go this route, it is also possible to implement HDMI-IN directly in FPGA, removing HDMI-CSI bridge completely.
    After fast googling, it looks like Lattice's CrossLink-NX FPGA might be a good solution because it is a specialized solution with MIPI D-PHY implementation.
    Also, Xilinx looks like an option because they have free mipi csi IPs.
    I have no idea even how to choose a development board for tests. And a price range scares me.
    As a downside, FPGA can be pretty expensive and power-hungry.

  3. Use another HDMI-CSI bridge. It is possible that LT6911 can handle conversion to YUV420. I have no docs yet, but i'm in contact with Lontium but they request to sign NDA before even touching the datasheet.
    As I said, I have no confidence in any of those options because of a lack of knowledge but I continue my research.
    Moreover, I ordered a few dozen newer Toshiba chips to the PCB manufacturer's warehouse. They will arrive in a week or two. Before that, I will be drawing the prototype board with all the required components, including the bridge and MCU. For me, it is quite a new experience because of BGA mounting and a lot of other constraints.

PLEASE, if you have any ideas let me know. I'm scared to go into the FPGA approach.
And here is an example of the current state of the "AP1302 mode" (1080p60) and YUV422 to YUV420 conversion issue:
https://www.youtube.com/watch?v=PckXKU-O1IA

@bri3d
Copy link
Collaborator

bri3d commented Jan 24, 2024

Try joining the Discord first: https://discord.gg/RsWEagrxyH ? (sorry, Discord is a pain sometimes).

Your project looks almost ideal, basically what we are trying to do is tinyCamera in reverse. It also just looks cool in general and I would be interested in some for other uses as well :)

@TelefraggerRick
Copy link

Auster has also posted this video of it working, though through RCA-HDMI so latency is quite high

https://www.youtube.com/watch?v=1Hk0527U4kM

@vr2045
Copy link

vr2045 commented Jan 24, 2024 via email

@chr0mcom
Copy link

chr0mcom commented Apr 3, 2024

where to buy? :)

@wyldrlorenz
Copy link

I have red a few month some news on MadsManTec Blog about this adapter (currently sold out):
https://store.cinetronix.co.uk/products/video-input-dev-board-hdmi-compatible
this one might be kind of the same??:
https://de.aliexpress.com/item/1005007329590614.html

Can't wait to test one, what do you think - is it worth to try`?

@mavenius
Copy link
Collaborator

mavenius commented Sep 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests