Closed xfangfang closed 3 years ago
It doesn't seem perfect. The video is offset by 12 pixels to - X. (under 960*544)
Wow, I can't believe this was what was causing issues on macOS!
Can you try with UVC_PAYLOAD_HEADER_SIZE 8
?
Doesn't work, the offset changed to 8. I also test with UVC_PAYLOAD_HEADER_SIZE 2
, and it doesn't work.
This happens not only on MacOS, but also on my Android phone, so it may also happen on the other systems.(after change UVC_PAYLOAD_HEADER_SIZE)
I've checked the UVC 1.1 spec (USB_Video_Payload_Uncompressed_1.1.pdf
) and the header is indeed 12 bytes:
You can also see "12 bytes" mentioned explicitly in: https://dri.freedesktop.org/docs/drm/media/uapi/v4l/pixfmt-meta-uvc.html
I think the problem with 12 is that the HW's colorspace converter (ksceIftuCsc
) can't write to 12-bytes aligned address.
Also checking USB_Video_FAQ_1.1.pdf
:
So setting UVC_PAYLOAD_HEADER_SIZE
to 2 for MacOS is the easiest way to handle it? Only two columns of pixels have problems.
I think the problem is that ksceIftuCsc
expects the output address to be aligned to 16 or so.
Well, it doesn't seem to be very easy to fix this problem. I'll close this PR first and see if there is any solution on MacOS.
@xfangfang I've updated master with a new commit, can you test if it works properly on macOS?
I have tried for a long time and failed. It seems that I need to learn more about C.😀
It is a bit tricky, you can check the details here: https://github.com/xerpi/vita-udcd-uvc/commit/c4a9e38a5284eb61f122c2fc5f22890f31fdfec5
Thank you. When I saw the code, I understood. I didn't think uvc_frame_req_submit_phycont
can be used in this way before.
I'm actually curious about how the header files used by this plug-in were created, such as:psp2kern/lowio/iftu.h
There's no documentation, right?
@xfangfang Correct, there's no official documentation for that, not even for official PSVita developers since IFTU is kernel space. I managed to understand the usage and parameters of functions by reverse engineering SceLowio. I also documented the registers here: https://wiki.henkaku.xyz/vita/IFTU_Registers
Thank you very much. I'll take a look at this document. I hope I can be as good as you one day.
You can find more info here: https://wiki.henkaku.xyz/vita/SceLowio
👌
I got this error message from Console.app:
So I changed the UVC_PAYLOAD_HEADER_SIZE from 16 to 12, and it seems everything is working perfectly.
Only test for MacOS 10.15.