1

My final goal is to get certain pixel values on a real android device screen very fast which I hope I can use to automate certain apps/games by analyzing the pixel values and performing touch action through adb accordingly.

Using normal screencapture procedures like Using ADB to capture the screen are too slow. Also, I don't need to read and convert all screen pixels, I only need to read values of one or a few pixels.

This should work: How can I get the color of a screen pixel THROUGH ADB but it seems that when i read fb0 from my Galaxy note 10.1, only the top 48 lines of pixels are stored in fb0.

When I do this:

cat /dev/graphics/fb0 > /sdcard/screen.raw

The resulting file is only 245,760 bytes (which equals 1280x800x4x48). When I convert this file with ffmpeg using

ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 1280x48 -i screen -f image2 -vcodec png image.png

The result is this: converted image from fb0

When I insert random values into fb0 using:

cat /dev/urandom > /dev/graphics/fb0

I can see only the top part of the screen is filled with random values.

I did see in /dev/graphics that there is a fb12 file sized 1701000 bytes but I have no idea how to convert this as it isn't a multiple of the 1280 screensize so I can't use the ffmpeg command.

I found this link: https://github.com/meefik/linuxdeploy/wiki/Framebuffer-notes where the person says that fb3 is the right framebuffer for his device, but I tested all fbX in the graphics folder and none of them are correct.

Does anyone know to get the frame buffer from a Galaxy Note 10.1 N8010 ?

Paul
  • 11
  • 4

0 Answers0