Skip to content

Some improvements#3

Open
rtwruck wants to merge 11 commits intoMAkcanca:mainfrom
rtwruck:develop
Open

Some improvements#3
rtwruck wants to merge 11 commits intoMAkcanca:mainfrom
rtwruck:develop

Conversation

@rtwruck
Copy link

@rtwruck rtwruck commented Jul 7, 2025

Hi,
thanks for starting this. I recently got a "supercamera" and wanted to use it with my laptop instead of my phone...
Here are some things I added in the process.

  • First of all, the header format, at least for my camera, looks like this:
    unsigned short magic;  // 0xbbaa
    unsigned char type;  // 0x07 = JPEG images
    unsigned short length;  // length of payload (i.e. packet size minus 5)
    unsigned char index;  // image index, starts over after 0xff
    unsigned char data1;  // alternates between 00 and 01
    unsigned char data2;  // always 00
    unsigned int data3;  // cycles 4 constant values that don't change between reconnects
  • I wasn't able to load the compiled module into my securely booted kernel, so I used DKMS to sign it for me.

  • Added a very simple X11 viewer application that fetches and displays JPEG images from /dev/supercamera at a configurable frame rate.

  • For testing purposes, /dev/supercamera is now readable by anyone (didn't want to write udev rules yet).

  • Since a new JPEG image is signalled by a new index value, the driver is now able to check for presence of SOI and EOI markers and discards incomplete images on its own. Complete images are made available immediately instead of waiting for a 64k buffer to be filled.

  • Slow clients are detected and handled gracefully, skipping images.

  • Instead of streaming data as soon as the camera is plugged in, streaming is started and stopped when the device file is opened/closed.

Since this now more or less does what I need, I probably won't spend more time on it - unless I find out how to switch resolutions ;-)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments