NixOS / nixos-hardware

A collection of NixOS modules covering hardware quirks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Surface Pro 6 Front Camera Not Working (Green) and Back Camera Upside Down

balintbarna opened this issue Β· comments

Hi everyone

I have a Surface Pro 6 running NixOS, including the microsoft/surface/surface-pro-intel nixos-hardware config.
When I open the gnome camera app I can switch between the back and the front camera. The front camera image is fully completely green, the back camera image works but is upside down and not amazing quality-wise.

Is there anything I can try to get that front camera working and maybe even rotate the back camera the right side up?
@damianoognissanti @mexisme @Mic92

🀷

Did you use the Gnome camera app when trying your camera? I had that issue too after just installing the kernel with patches. What you need to do is:

  1. Install a custom libcamera that follows the instruction on the linux-surface page:
    This one works for me: https://github.com/damianoognissanti/libcamera-surface
    You can install it by putting the file in your configuration.nix-folder and import it with "./libcamera.nix" (don't forget to git add the file if you use git and flakes) right under the import of hardware-configuration.nix, that is:
  imports =
    [ 
      # Include the results of the hardware scan.
      ./hardware-configuration.nix
      # Add libcamera (necessary for Surface Book camera to work)
      ./libcamera.nix
    ];
  1. Install kernel modules for v4l2loopback, check this:
    #523 (comment)
    You will probably need to change the command a bit, for example my front camera is named _SB_.PCI0.I2C2.CAMF. The name is found by running cam -l after installing libcamera.

  2. Run the gst-launch-1.0 command found in step 2 to launch the camera (after a reboot). You also need to install gstreamer plugins for this. I installed

gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good

While the command is running the camera should work.

Btw, this worked for Cheese, but the new Gnome camera app doesn't seem to find that camera, but Zoom does, so you need some camera software where you can select the video device (i.e. /dev/video0 or what you chose when running the command in step 2).

@damianoognissanti Thank you for the reply. It still doesn't work. What happens now and also before, is that when I open the camera app, it activates the white led by the front camera, but the image is just a green blob. If I switch cameras, it activates the little white led by the back camera and I can actually see some image from that camera, but it is upside down and very dark.

My setup:

let
  nixos_hardware = fetchGit {
    name = "nixos-hardware-2024-03-03";
    url = "https://github.com/NixOS/nixos-hardware/";
    rev = "59e37017b9ed31dee303dbbd4531c594df95cfbc";
    submodules = true;
  };
  libcamera_surface = fetchGit {
    name = "libcamera-surface-0.2.0";
    url = "https://github.com/damianoognissanti/libcamera-surface/";
    rev = "7268e5ed4389d8b2390321dd4f47da200bd75fde";
    submodules = true;
  };
  ...
in {
  imports = [
    /etc/nixos/hardware-configuration.nix
    "${nixos_hardware}/microsoft/surface/surface-pro-intel/"
    "${libcamera_surface}/libcamera.nix"
    ...
  ];
  ...
}

Do any of these show something useful?

$ cam -l
[0:35:11.528759281] [12121]  INFO IPAManager ipa_manager.cpp:143 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
[0:35:11.534521505] [12121]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
[0:35:11.577528953] [12124] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov8865.yaml' not found for IPA module 'ipu3'
[0:35:11.577839762] [12124]  INFO IPU3 ipu3.cpp:1141 Registered Camera[0] "\_SB_.PCI0.I2C3.CAMR" connected to CSI-2 receiver 0
[0:35:11.579105282] [12124] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov5693.yaml' not found for IPA module 'ipu3'
[0:35:11.579287291] [12124]  INFO IPU3 ipu3.cpp:1141 Registered Camera[1] "\_SB_.PCI0.I2C2.CAMF" connected to CSI-2 receiver 1
[nix-shell:~]$ gst-launch-1.0 _SB_.PCI0.I2C2.CAMF
ERROR: pipeline could not be constructed: unexpected reference "_SB_" - ignoring.

[nix-shell:~]$ gst-launch-1.0 _SB_.PCI0.I2C3.CAMR
ERROR: pipeline could not be constructed: unexpected reference "_SB_" - ignoring.
$ dmesg | grep ov5693
[    7.604542] ov5693 i2c-INT33BE:00: supply avdd not found, using dummy regulator
[    7.604590] ov5693 i2c-INT33BE:00: supply dovdd not found, using dummy regulator
[    7.604610] ov5693 i2c-INT33BE:00: supply dvdd not found, using dummy regulator
$ LIBCAMERA_LOG_LEVELS=*:0 cam --list
[0:46:41.863450278] [16515]  INFO IPAManager ipa_manager.cpp:143 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
[0:46:41.863588405] [16515] DEBUG IPAModule ipa_module.cpp:334 ipa_ipu3.so: IPA module /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so is signed
[0:46:41.863632677] [16515] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so'
[0:46:41.863664470] [16515] DEBUG IPAModule ipa_module.cpp:334 ipa_vimc.so: IPA module /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_vimc.so is signed
[0:46:41.863693520] [16515] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module '/nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_vimc.so'
[0:46:41.863729242] [16515]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
[0:46:41.863898382] [16518] DEBUG Camera camera_manager.cpp:69 Starting camera manager
[0:46:41.872100825] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "ipu3-imgu" created from /dev/media1
[0:46:41.872148693] [16518] DEBUG DeviceEnumerator device_enumerator_udev.cpp:96 Defer media device /dev/media1 due to 12 missing dependencies
[0:46:41.873898936] [16518] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media1 found
[0:46:41.873907984] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media1: ipu3-imgu
[0:46:41.874075933] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "ipu3-cio2" created from /dev/media0
[0:46:41.874087525] [16518] DEBUG DeviceEnumerator device_enumerator_udev.cpp:96 Defer media device /dev/media0 due to 12 missing dependencies
[0:46:41.876157537] [16518] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media0 found
[0:46:41.876165342] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media0: ipu3-cio2
[0:46:41.876344024] [16518] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'PipelineHandlerUVC'
[0:46:41.876356444] [16518] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'PipelineHandlerVimc'
[0:46:41.876362286] [16518] DEBUG Camera camera_manager.cpp:113 Found registered pipeline handler 'PipelineHandlerIPU3'
[0:46:41.876368994] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "ipu3-cio2"
[0:46:41.876378614] [16518] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "ipu3-imgu"
[0:46:41.876388860] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media0[ipu3-cio2]: ov5693 8-0036[0] -> ipu3-csi2 1[0]: 0
[0:46:41.876395351] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media0[ipu3-cio2]: ov8865 9-0010[0] -> ipu3-csi2 0[0]: 0
[0:46:41.876418432] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media0[ipu3-cio2]: ov7251 9-0060[0] -> ipu3-csi2 2[0]: 0
[0:46:41.876424744] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 0[3] -> ipu3-imgu 0 viewfinder[0]: 0
[0:46:41.876429816] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 0[4] -> ipu3-imgu 0 3a stat[0]: 0
[0:46:41.876435209] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 0 input[0] -> ipu3-imgu 0[0]: 0
[0:46:41.876439966] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 0 parameters[0] -> ipu3-imgu 0[1]: 0
[0:46:41.876446053] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 1[3] -> ipu3-imgu 1 viewfinder[0]: 0
[0:46:41.876451454] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 1[4] -> ipu3-imgu 1 3a stat[0]: 0
[0:46:41.876456393] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 1 input[0] -> ipu3-imgu 1[0]: 0
[0:46:41.876461871] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media1[ipu3-imgu]: ipu3-imgu 1 parameters[0] -> ipu3-imgu 1[1]: 0
[0:46:41.876480923] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ipu3-imgu 0': Control: IPU3 Pipe Mode (0x009819c1)
[0:46:41.876509423] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video4[15:out]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876532979] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video6[16:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876580756] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video7[17:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876596453] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video5[18:out]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876612316] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video8[19:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876628586] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ipu3-imgu 1': Control: IPU3 Pipe Mode (0x009819c1)
[0:46:41.876647439] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video9[21:out]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876666970] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video11[22:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876694974] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video12[23:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876727723] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video10[24:out]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876742711] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video13[25:cap]: Opened device PCI:0000:00:05.0: ipu3-imgu: ipu3-imgu
[0:46:41.876791623] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Red Balance (0x0098090e)
[0:46:41.876813030] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Blue Balance (0x0098090f)
[0:46:41.876819149] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Exposure (0x00980911)
[0:46:41.876842877] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Horizontal Flip (0x00980914)
[0:46:41.876849172] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Vertical Flip (0x00980915)
[0:46:41.876856571] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Camera Orientation (0x009a0922)
[0:46:41.876867193] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Camera Sensor Rotation (0x009a0923)
[0:46:41.876874778] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Vertical Blanking (0x009e0901)
[0:46:41.876880956] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Horizontal Blanking (0x009e0902)
[0:46:41.876887531] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Analogue Gain (0x009e0903)
[0:46:41.876894922] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Link Frequency (0x009f0901)
[0:46:41.876902408] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Pixel Rate (0x009f0902)
[0:46:41.876908815] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov8865 9-0010': Control: Test Pattern (0x009f0903)
[0:46:41.877136609] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov8865 9-0010': Test pattern mode 1 ignored
[0:46:41.877144471] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov8865 9-0010': Test pattern mode 3 ignored
[0:46:41.877148543] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov8865 9-0010': Test pattern mode 4 ignored
[0:46:41.877152230] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov8865 9-0010': Test pattern mode 5 ignored
[0:46:41.877185394] [16518] DEBUG V4L2 v4l2_device.cpp:636 'dw9719 9-000c': Control: Focus, Absolute (0x009a090a)
[0:46:41.877264902] [16518] DEBUG CameraSensor camera_sensor.cpp:678 'ov8865 9-0010': Apply test pattern mode 0
[0:46:41.877275508] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media0[ipu3-cio2]: ov8865 9-0010[0] -> ipu3-csi2 0[0]: 1
[0:46:41.877327164] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video0[29:cap]: Opened device PCI:0000:00:14.3: ipu3-cio2: Intel IPU3 CIO2
[0:46:41.878205590] [16518] DEBUG IPAManager ipa_manager.cpp:316 IPA module /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so signature is valid
[0:46:41.878234651] [16518] DEBUG IPAProxy ipu3_ipa_proxy.cpp:45 initializing ipu3 proxy: loading IPA from /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so
[0:46:41.878663769] [16518] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov8865.yaml' not found for IPA module 'ipu3'
[0:46:41.878797692] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Af'
[0:46:41.878804953] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Agc'
[0:46:41.878809273] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Awb'
[0:46:41.878812441] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'BlackLevelCorrection'
[0:46:41.878833715] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'ToneMapping'
[0:46:41.878897471] [16518] DEBUG DelayedControls delayed_controls.cpp:99 Set a delay of 2 and priority write flag 0 for Exposure
[0:46:41.878903633] [16518] DEBUG DelayedControls delayed_controls.cpp:99 Set a delay of 1 and priority write flag 0 for Analogue Gain
[0:46:41.878916699] [16518]  INFO IPU3 ipu3.cpp:1141 Registered Camera[0] "\_SB_.PCI0.I2C3.CAMR" connected to CSI-2 receiver 0
[0:46:41.878936244] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Exposure (0x00980911)
[0:46:41.878945158] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Horizontal Flip (0x00980914)
[0:46:41.878951627] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Vertical Flip (0x00980915)
[0:46:41.878958867] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Camera Orientation (0x009a0922)
[0:46:41.878969063] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Camera Sensor Rotation (0x009a0923)
[0:46:41.878976719] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Vertical Blanking (0x009e0901)
[0:46:41.878982728] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Horizontal Blanking (0x009e0902)
[0:46:41.878988515] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Analogue Gain (0x009e0903)
[0:46:41.878995796] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Link Frequency (0x009f0901)
[0:46:41.879033464] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Pixel Rate (0x009f0902)
[0:46:41.879040803] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Test Pattern (0x009f0903)
[0:46:41.879051648] [16518] DEBUG V4L2 v4l2_device.cpp:636 'ov5693 8-0036': Control: Digital Gain (0x009f0905)
[0:46:41.879210840] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov5693 8-0036': Test pattern mode 1 ignored
[0:46:41.879218560] [16518] DEBUG CameraSensor camera_sensor.cpp:415 'ov5693 8-0036': Test pattern mode 3 ignored
[0:46:41.879224028] [16518] DEBUG CameraSensor camera_sensor.cpp:678 'ov5693 8-0036': Apply test pattern mode 0
[0:46:41.879234093] [16518] DEBUG MediaDevice media_device.cpp:830 /dev/media0[ipu3-cio2]: ov5693 8-0036[0] -> ipu3-csi2 1[0]: 1
[0:46:41.879256528] [16518] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video1[32:cap]: Opened device PCI:0000:00:14.3: ipu3-cio2: Intel IPU3 CIO2
[0:46:41.879957944] [16518] DEBUG IPAManager ipa_manager.cpp:316 IPA module /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so signature is valid
[0:46:41.879997432] [16518] DEBUG IPAProxy ipu3_ipa_proxy.cpp:45 initializing ipu3 proxy: loading IPA from /nix/store/1adx0amavy8ms0pl0ddg1vbwgvzz4kjz-libcamera-0.2.0/lib/libcamera/ipa_ipu3.so
[0:46:41.880158632] [16518] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov5693.yaml' not found for IPA module 'ipu3'
[0:46:41.880243628] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Af'
[0:46:41.880249953] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Agc'
[0:46:41.880254550] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'Awb'
[0:46:41.880258191] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'BlackLevelCorrection'
[0:46:41.880262089] [16518] DEBUG IPAModuleAlgo module.h:91 ipu3: Instantiated algorithm 'ToneMapping'
[0:46:41.880315706] [16518] DEBUG DelayedControls delayed_controls.cpp:99 Set a delay of 2 and priority write flag 0 for Exposure
[0:46:41.880322260] [16518] DEBUG DelayedControls delayed_controls.cpp:99 Set a delay of 1 and priority write flag 0 for Analogue Gain
[0:46:41.880334408] [16518]  INFO IPU3 ipu3.cpp:1141 Registered Camera[1] "\_SB_.PCI0.I2C2.CAMF" connected to CSI-2 receiver 1
[0:46:41.880339713] [16518] DEBUG Camera camera_manager.cpp:125 Pipeline handler "PipelineHandlerIPU3" matched
Available cameras:
1: Internal back camera (\_SB_.PCI0.I2C3.CAMR)
2: Internal front camera (\_SB_.PCI0.I2C2.CAMF)
$ v4l2-ctl --list-devices
ipu3-imgu (PCI:0000:00:05.0):
	/dev/video4
	/dev/video5
	/dev/video6
	/dev/video7
	/dev/video8
	/dev/video9
	/dev/video10
	/dev/video11
	/dev/video12
	/dev/video13
	/dev/media1

Intel IPU3 CIO2 (PCI:0000:00:14.3):
	/dev/video0
	/dev/video1
	/dev/video2
	/dev/video3
	/dev/media0
$ ffplay /dev/video0
...
[video4linux2,v4l2 @ 0x7f5d2c000c80] Not a video capture device.
/dev/video0: No such device

As a side note, the camera is not the only issue, the power and volume buttons worked a few times but most of the time they just don't. And about 1/3 of the times when shutting down iptsd gets stuck and I have to long-press the power button to power it down. sudo modprobe -r soc_button_array; sudo modprobe soc_button_array fixes the buttons.

gst-launch-1.0 _SB_.PCI0.I2C2.CAMF

This might be the problem, you don't run the command I told you about. You must have a backslash in the camera name (the name is "\_SB_.PCI0.I2C2.CAMF" as you can see from the cam -l command), and you must escape both the backslash as well as the underscore. What happens when you run the following?

gst-launch-1.0 libcamerasrc camera-name='\\\_SB_.PCI0.I2C2.CAMF' ! videoconvert ! v4l2sink device=/dev/video0

Thank you, that works, sort of. The image is (not) mirrored, so when I move left my image moves right which is pretty disorienting. Do you know if there's a flag or a simple way to mirror it? In addition the quality is pretty low, seems like the white balance is off and either the resolution is low or it looks out of focus. Anything to do about that? And is there a way to avoid having to manually run the terminal command each time? I guess I could create a service but then the camera will be always on...

I have a script called startcamera that runs the above command. That command can either be run before you start some camera application by changing the .desktop file, or can be bound to a keybinding. I start it in a terminal though, since I don't use the camera that frequently and it feels like I'm "in control" that way (but that's just a feeling).

If I google gstreamer flip video the very first search result is:
https://gstreamer.freedesktop.org/documentation/videofilter/videoflip.html
which can flip the image in whatever way you want

Video-flip-method
The different flip methods.
Members
none (0) – Identity (no rotation)
clockwise (1) – Rotate clockwise 90 degrees
rotate-180 (2) – Rotate 180 degrees
counterclockwise (3) – Rotate counter-clockwise 90 degrees
horizontal-flip (4) – Flip horizontally
vertical-flip (5) – Flip vertically
upper-left-diagonal (6) – Flip across upper left/lower right diagonal
upper-right-diagonal (7) – Flip across upper right/lower left diagonal
automatic (8) – Select flip method based on image-orientation tag

Try to check the manual for the other things you wonder too.

Thank you, that's very helpful. Of course it would be nice if we could make it work "out of the box" using the nix configuration, but this will work for now.