Discussion:
[linux-uvc-devel] UVC userpointer streaming
Pranaya Myneni
2014-02-01 02:18:56 UTC
Permalink
Dear List,

My media subsystem is writing my h.264 frames into a circular buffer
located in DDR memory. The circular buffer's starting address is a fixed
location in DDR memory. The circular buffer's starting address in DDR is
accessible to my CPU. I am running Linux OS on my CPU. My user application
running on my CPU likes to use the H.264 circular buffer in DDR as a User
Pointer and enqueue the same to UVC Class driver for Video Output.

My H.264 Circular buffer starting address (physical address) is not paged
aligned (PAGE_SIZE). The circular buffer is of 4 frames length. All the
frames are fixed length frames. The H.264 encoder keeps on updating
circular buffer with new video frame data.

Please suggest me how can I use my DDR Circular buffer address as User
Pointer in my linux user space application and enqueue the same to UVC
Class driver.


Thanks in advance.

best regards,

Pranaya.
Laurent Pinchart
2014-02-02 09:20:58 UTC
Permalink
Hi Pranaya,
Post by Pranaya Myneni
Dear List,
My media subsystem is writing my h.264 frames into a circular buffer
located in DDR memory. The circular buffer's starting address is a fixed
location in DDR memory. The circular buffer's starting address in DDR is
accessible to my CPU. I am running Linux OS on my CPU. My user application
running on my CPU likes to use the H.264 circular buffer in DDR as a User
Pointer and enqueue the same to UVC Class driver for Video Output.
My H.264 Circular buffer starting address (physical address) is not paged
aligned (PAGE_SIZE). The circular buffer is of 4 frames length. All the
frames are fixed length frames. The H.264 encoder keeps on updating
circular buffer with new video frame data.
Please suggest me how can I use my DDR Circular buffer address as User
Pointer in my linux user space application and enqueue the same to UVC
Class driver.
The above seems like a common use case. Have you tried it ? What are your
problems exactly ? Assuming you can mmap the circular buffer to userspace
(which falls outside of the UVC driver's responsibility), you can just use the
USERPTR buffer type with the UVC driver and enqueue buffers with the userspace
memory pointer.
--
Regards,

Laurent Pinchart
Pranaya Myneni
2014-02-02 16:05:25 UTC
Permalink
Hi Mr. Laurent,

Many thanks for your quick response. As I have described in my earlier
email, my circular buffer starting physical address and starting physical
address of each frame in my DDR memory is not guaranteed to be page aligned
(PAGE_SIZE).

In one of the Linux user applications I have noticed that UVC User Pointer
is allocated with memalign call.

Now I have the following query in this regard:

Is it mandatory that each frame's Starting Physical Address in DDR memory
be Page Aligned of page size PAGE_SIZE macro ? My Physical Addresses are
nor Page Aligned.

I am planning to mmap each frame starting physical address and use the
returned virtual address as one User Pointer in my linux user application
and en-queue to UVC class driver for Video Output.


Thanks in advance.

best regards,
Pranaya.










On Sun, Feb 2, 2014 at 2:50 PM, Laurent Pinchart <
Post by Laurent Pinchart
Hi Pranaya,
Post by Pranaya Myneni
Dear List,
My media subsystem is writing my h.264 frames into a circular buffer
located in DDR memory. The circular buffer's starting address is a fixed
location in DDR memory. The circular buffer's starting address in DDR is
accessible to my CPU. I am running Linux OS on my CPU. My user
application
Post by Pranaya Myneni
running on my CPU likes to use the H.264 circular buffer in DDR as a User
Pointer and enqueue the same to UVC Class driver for Video Output.
My H.264 Circular buffer starting address (physical address) is not paged
aligned (PAGE_SIZE). The circular buffer is of 4 frames length. All the
frames are fixed length frames. The H.264 encoder keeps on updating
circular buffer with new video frame data.
Please suggest me how can I use my DDR Circular buffer address as User
Pointer in my linux user space application and enqueue the same to UVC
Class driver.
The above seems like a common use case. Have you tried it ? What are your
problems exactly ? Assuming you can mmap the circular buffer to userspace
(which falls outside of the UVC driver's responsibility), you can just use the
USERPTR buffer type with the UVC driver and enqueue buffers with the userspace
memory pointer.
--
Regards,
Laurent Pinchart
Laurent Pinchart
2014-02-04 22:29:55 UTC
Permalink
Hi Pranaya,
Post by Pranaya Myneni
Hi Mr. Laurent,
Many thanks for your quick response. As I have described in my earlier
email, my circular buffer starting physical address and starting physical
address of each frame in my DDR memory is not guaranteed to be page aligned
(PAGE_SIZE).
In one of the Linux user applications I have noticed that UVC User Pointer
is allocated with memalign call.
Is it mandatory that each frame's Starting Physical Address in DDR memory be
Page Aligned of page size PAGE_SIZE macro ? My Physical Addresses are nor
Page Aligned.
As far as I can tell the uvcvideo driver doesn't not mandate USERPTR buffers
to be aligned on a page size boundary. Please don't take my word for it
though, but test it instead. That shouldn't be difficult to do, just allocate
a larger buffer aligned to a page size boundary with memalign and pass the
start address of the buffer plus an offset not multiple of the page size as
the user pointer.
Post by Pranaya Myneni
I am planning to mmap each frame starting physical address and use the
returned virtual address as one User Pointer in my linux user application
and en-queue to UVC class driver for Video Output.
Post by Laurent Pinchart
Post by Pranaya Myneni
Dear List,
My media subsystem is writing my h.264 frames into a circular buffer
located in DDR memory. The circular buffer's starting address is a fixed
location in DDR memory. The circular buffer's starting address in DDR is
accessible to my CPU. I am running Linux OS on my CPU. My user
application running on my CPU likes to use the H.264 circular buffer in
DDR as a User Pointer and enqueue the same to UVC Class driver for Video
Output.
My H.264 Circular buffer starting address (physical address) is not
paged aligned (PAGE_SIZE). The circular buffer is of 4 frames length.
All the frames are fixed length frames. The H.264 encoder keeps on
updating circular buffer with new video frame data.
Please suggest me how can I use my DDR Circular buffer address as User
Pointer in my linux user space application and enqueue the same to UVC
Class driver.
The above seems like a common use case. Have you tried it ? What are your
problems exactly ? Assuming you can mmap the circular buffer to userspace
(which falls outside of the UVC driver's responsibility), you can just use
the USERPTR buffer type with the UVC driver and enqueue buffers with the
userspace memory pointer.
--
Regards,

Laurent Pinchart
Loading...