I believe I have the same camera+camera sensor as you.
You can easily turn on/off LEDs by writing to some specific device files:
echo 0 > /sys/class/leds/led_3/brightness
echo 255 > /sys/class/leds/led_3/brightness
led_3 is the white LED facing forwards, led_0 is the blue LED on the display side, not sure what the other two are.
You can also stop the main /system/bin/sdv process without rebooting the device by first stopping it, and then disabling the watchdog using the following script:
#include <linux/watchdog.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/ioctl.h>
int main() {
int fd = open("/dev/watchdog", O_RDWR);
if (fd < 0) {
perror("Failed to open watchdog");
return 1;
}
int flags = WDIOS_DISABLECARD;
if (ioctl(fd, WDIOC_SETOPTIONS, &flags) < 0) {
perror("Failed to disable watchdog");
return 1;
}
close(fd);
printf("Watchdog disabled\n");
return 0;
}
It appears you can also just use echo 'V' > /dev/watchdog after killing the sdv process.
While sdv is running, I can write stuff to /dev/graphics/fb0, but when you kill sdv it stops updating the screen. I have not managed to update the screen myself yet, but the documentation here should be enough to get it to work: https://linux-sunxi.org/Sunxi_disp_driver_interface
I've taken a look at svd in Ghidra (using 32 bit arm7 little endian), it looks like it communicates with the display using /dev/graphics/fb0 and /dev/disp.
It also appears to use some sort of media recorder built-in to android to record video.
I'm currently trying to figure out how to control the display, and also capture raw images.
I believe I have the same camera+camera sensor as you.
You can easily turn on/off LEDs by writing to some specific device files:
echo 0 > /sys/class/leds/led_3/brightness
echo 255 > /sys/class/leds/led_3/brightness
led_3 is the white LED facing forwards, led_0 is the blue LED on the display side, not sure what the other two are.
You can also stop the main /system/bin/sdv process without rebooting the device by first stopping it, and then disabling the watchdog using the following script:
It appears you can also just use
echo 'V' > /dev/watchdogafter killing the sdv process.While sdv is running, I can write stuff to /dev/graphics/fb0, but when you kill sdv it stops updating the screen. I have not managed to update the screen myself yet, but the documentation here should be enough to get it to work: https://linux-sunxi.org/Sunxi_disp_driver_interface
I've taken a look at svd in Ghidra (using 32 bit arm7 little endian), it looks like it communicates with the display using /dev/graphics/fb0 and /dev/disp.
It also appears to use some sort of media recorder built-in to android to record video.
I'm currently trying to figure out how to control the display, and also capture raw images.