Skip to content

Instantly share code, notes, and snippets.

@KaairaGupta
Last active June 15, 2020 09:35
Show Gist options
  • Save KaairaGupta/848ac3b0988010e6903eba3a56648199 to your computer and use it in GitHub Desktop.
Save KaairaGupta/848ac3b0988010e6903eba3a56648199 to your computer and use it in GitHub Desktop.
Steps to set up libcamera for dev (with latest media_master) using virtme
  • Follow https://libcamera.org/getting-started.html to install libcamera on your native machine.

  • Clone latest media_tree using:

    git clone git://linuxtv.org/media_tree.git
    
  • Install virtme:

    pip3 install --user git+https://github.com/ezequielgarcia/virtme.git
    
  • Compile Kernel with Virtme:

    • cd media_tree
      virtme-configkernel --defconfig
      
    • Enable vimc/vivid/ etc as per requirement
    • Enable CONFIG_DRM_VIRTIO_GPU=y in kernel config
    • make -j8
  • Run virtme (on native machine)

    • Use a variable to pass memory and CPUs to be used by QEMU to prevent Out of Memory error. Adjust the values accordingly.
      export MEM_CPU="-m 2G -smp 2"
      
    • Run virtme
       virtme-run --graphics --kdir $KDIR --kopt="console=ttyS0" --qemu-opts $MEM_CPU -vga virtio -serial mon:stdio
      
      where $KDIR is kernel directory's path
  • To run qcam (in virtme):

    QT_QPA_PLATFORM=linuxfb /usr/local/bin/qcam 
    
@kbingham
Copy link

virtme-run --graphics --kdir $KDIR --kopt="console=ttyS0" --qemu-opts $MEM_CPU -vga virtio -serial mon:stdio

You reference two variables here, KDIR and MEM_CPU ... how do you define those? What should they be?

Aha - sorry - you defined KDIR, but I can't see MEM_CPU

@KaairaGupta
Copy link
Author

virtme-run --graphics --kdir $KDIR --kopt="console=ttyS0" --qemu-opts $MEM_CPU -vga virtio -serial mon:stdio

You reference two variables here, KDIR and MEM_CPU ... how do you define those? What should they be?

Aha - sorry - you defined KDIR, but I can't see MEM_CPU

Sorry I missed that, it defines the resources one uses for virtme. I'll edit it right away.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment