tvl-depot/users/flokli/ipu6-softisp/config.nix
Florian Klink c641fce62a feat(users/flokli/ipu6-softisp): expose qcam to $PATH
This allows testing the camera connection without pipewire in between:

```
LIBCAMERA_LOG_LEVELS=*:DEBUG qcam
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[0:26:31.326112005] [51496]  INFO IPAManager ipa_manager.cpp:143 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
[0:26:31.326354338] [51496] DEBUG IPAModule ipa_module.cpp:334 ipa_ipu3.so: IPA module /nix/store/da6s46p3dk9x7fhh0qj0wrxrqrq7y8av-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so is signed
[0:26:31.326417399] [51496] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/nix/store/da6s46p3dk9x7fhh0qj0wrxrqrq7y8av-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so'
[0:26:31.326484670] [51496] DEBUG IPAModule ipa_module.cpp:334 ipa_soft_simple.so: IPA module /nix/store/da6s46p3dk9x7fhh0qj0wrxrqrq7y8av-libcamera-0.2.0/lib/libcamera/ipa_soft_simple.so is signed
[0:26:31.326518633] [51496] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/nix/store/da6s46p3dk9x7fhh0qj0wrxrqrq7y8av-libcamera-0.2.0/lib/libcamera/ipa_soft_simple.so'
[0:26:31.326559430] [51496]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
[0:26:31.326728389] [51505] DEBUG Camera camera_manager.cpp:69 Starting camera manager
[0:26:31.345213320] [51505] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "intel-ipu6" created from /dev/media1
[0:26:31.345249850] [51505] DEBUG DeviceEnumerator device_enumerator_udev.cpp:96 Defer media device /dev/media1 due to 36 missing dependencies
[0:26:31.350335759] [51505] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media1 found
[0:26:31.350365700] [51505] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media1: intel-ipu6
[0:26:31.350738881] [51505] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'SimplePipelineHandler'
[0:26:31.350765332] [51505] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'PipelineHandlerIPU3'
[0:26:31.350779457] [51505] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'PipelineHandlerUVC'
```

Change-Id: I30b4ede89f90e2455bf1313b3c7c4d638089e5db
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11180
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-03-19 06:59:57 +00:00

74 lines
2.9 KiB
Nix

{ pkgs, lib, ... }:
let
libcamera = pkgs.libcamera.overrideAttrs (old: {
mesonFlags = old.mesonFlags or [ ] ++ [
"-Dpipelines=simple,ipu3,uvcvideo"
"-Dipas=simple,ipu3"
];
# This is
# https://copr-dist-git.fedorainfracloud.org/cgit/jwrdegoede/ipu6-softisp/libcamera.git/plain/libcamera-0.2.0-softisp.patch?h=f39&id=60e6b3d5e366a360a75942073dc0d642e4900982,
# but manually piped to git and back, as some renames were not processed properly.
# It was later refreshed with https://patchwork.libcamera.org/cover/19663/
patches = old.patches or [ ] ++ [
./libcamera/0001-libcamera-pipeline-simple-fix-size-adjustment-in-val.patch
./libcamera/0002-libcamera-internal-Move-dma_heaps.-h-cpp-to-common-d.patch
./libcamera/0003-libcamera-dma_heaps-extend-DmaHeap-class-to-support-.patch
./libcamera/0004-libcamera-internal-Move-SharedMemObject-class-to-a-c.patch
./libcamera/0005-libcamera-shared_mem_object-reorganize-the-code-and-.patch
./libcamera/0006-libcamera-software_isp-Add-SwStatsCpu-class.patch
./libcamera/0007-libcamera-software_isp-Add-Debayer-base-class.patch
./libcamera/0008-libcamera-software_isp-Add-DebayerCpu-class.patch
./libcamera/0009-libcamera-ipa-add-Soft-IPA.patch
./libcamera/0010-libcamera-introduce-SoftwareIsp.patch
./libcamera/0011-libcamera-pipeline-simple-rename-converterBuffers_-a.patch
./libcamera/0012-libcamera-pipeline-simple-enable-use-of-Soft-ISP-and.patch
./libcamera/0013-libcamera-swstats_cpu-Add-support-for-8-10-and-12-bp.patch
./libcamera/0014-libcamera-debayer_cpu-Add-support-for-8-10-and-12-bp.patch
./libcamera/0015-libcamera-debayer_cpu-Add-BGR888-output-support.patch
./libcamera/0016-libcamera-Add-support-for-IGIG_GBGR_IGIG_GRGB-bayer-.patch
./libcamera/0017-libcamera-Add-Software-ISP-benchmarking-documentatio.patch
./libcamera/0018-libcamera-software_isp-Apply-black-level-compensatio.patch
./libcamera/0019-libcamera-Soft-IPA-use-CameraSensorHelper-for-analog.patch
./libcamera/0020-ov01a1s-HACK.patch
./libcamera/0021-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
];
});
# use patched libcamera
pipewire' = (pkgs.pipewire.override {
inherit libcamera;
});
wireplumber' = (pkgs.wireplumber.override {
pipewire = pipewire';
});
in
{
boot.kernelPatches = [{
name = "linux-kernel-test.patch";
patch = ./kernel/softisp.patch;
extraStructuredConfig = {
# needed for /dev/dma_heap
DMABUF_HEAPS_CMA = lib.kernel.yes;
DMABUF_HEAPS_SYSTEM = lib.kernel.yes;
DMABUF_HEAPS = lib.kernel.yes;
};
}];
services.udev.extraRules = ''
KERNEL=="system", SUBSYSTEM=="dma_heap", TAG+="uaccess"
'';
# provide qcam in $PATH.
environment.systemPackages = [
(libcamera.override {
withQcam = true;
})
];
services.pipewire.package = pipewire';
services.pipewire.wireplumber.package = wireplumber';
}