framebuffer icon indicating copy to clipboard operation
framebuffer copied to clipboard

Example Code Fails with "Invalid Argument"

Open filtoid opened this issue 5 years ago • 2 comments

When running the code on a Raspberry Pi the code errors with an error string of "Invalid Argument".

From a bit of Googling and looking at the code it seems that mmap may no longer be supported. Here was the clearest explanation I found: https://stackoverflow.com/questions/22915778/mmap-dev-fb0-fails-with-invalid-argument

filtoid avatar Oct 23 '19 08:10 filtoid

Linux does not remove apis, maybe your kernel is configured differently though. Try to regenerate defs.go on your rpi first go tool cgo -godefs _defs_source.go | gofmt > defs.go. If that doesn't help you're on your own. I had no idea what I was doing when I wrote this, I still have no idea how drm/fbdev/virtual console all interact with each other and I never used this lib myself. You may also have better luck with drm (https://github.com/NeowayLabs/drm for example)

kaey avatar Oct 23 '19 11:10 kaey

I have the same problem. This is because the type uintptr for fixedScreenInfo.Smem_start has different lengths on amd64 and armv7, 8 vs 4 bytes. But the type is specified exactly as uint64.

maxim0r avatar Dec 05 '20 09:12 maxim0r