Add udev rules for dma heaps
DMA heaps are currently not usable for normal users as their permissions are 600
, however we want libcamera (and thus Pipewire) to be able to use them for the libcamera softwareISP, in order to create buffers that can efficiently be shared with the GPU.
Inspired by https://github.com/graysky2/kodi-standalone-service/blob/master/arm/udev/99-kodi.rules this is what I use for my Librem5 and Pipephone (OG) for now:
cat /etc/udev/rules.d/90-libcamera.rules
SUBSYSTEM=="dma_heap",KERNEL=="linux*",GROUP="video",MODE="0660"
SUBSYSTEM=="dma_heap",KERNEL=="reserved",GROUP="video",MODE="0660"
SUBSYSTEM=="dma_heap",KERNEL=="system",GROUP="video",MODE="0660"
as giving members of the video
group access seems like exactly what we'd want here. I just don't know what would be the best place to ship this - and haven't checked how systemd-based distros plan to move forward with this (on pmOS the default user is part of video
while on other distros like Fedora they're not).
As an intermediate solution, would it make sense to ship this as part of libcamera
?
See also