@veye_xumm Sorry for the late reply. Thank you for the new code! It seems to work partially in the rpi5 standard OS. I was able to compile the read and write files, and some commands work while others don't. The new mgain is stuck at zero, so if i use new exp mode i can set the shutter speed with new mshutter, but not the new mgain, despite changing it returns zero when i probe with the -r parameter. so using the new exp mode i only get a black image. the old mshutter works and i was able go get up to 1 second exposure per frame in streaming mode but the capture mode and capture command don't seem to work. Also i would like to have it work in the rpi archlinux OS that i use for astronomy. The veyecam2m driver works and i get video in the archlinux OS, but i wasn't able to compile the i2c read and write in that system.