Skip to content

Memory Alignment and stride issues #4

@sylpe

Description

@sylpe

Hello,

Not really a bug, but I don't know how to correctly handle the situation.

Some sensors have exotic resolutions. ST vd56g3 for example : https://patchwork.linuxtv.org/project/linux-media/cover/20240904145238.21099-1-sylvain.petinot@foss.st.com/ has a 1124x1364 native pixel array.

With such exotic resolution, we can face stride issues with pyv4l2 (assertion will fail in videodev.py : https://github.com/tomba/pyv4l2/blob/7f1f80045ff949ba040f658bad1d948ecda618fd/v4l2/videodev.py#L328)

I generally observe that most receivers align in memory on multiples of 16 bytes. Thus the following commit sylpe@c9f0357 prevents most of the stride issues.
However this is nothing standardized: 16-byte alignment works well on RPI5 and Qcom RB5 but at the same time RPI4 align memory on 32 bytes...

Because this is platform-dependent I don't know what is the best option to handle this.
I would suggest to first change the default value of align parameter to "common" values like 16 or 32. That being done, there is still a need to adjust this alignment on certain platforms and maybe it would be good to have a dedicated parameter in the init().

What are your thoughts ?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions