kaey / framebuffer

Library for linux framebuffer device.
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

Example Code Fails with "Invalid Argument" #2

Open filtoid opened 4 years ago

filtoid commented 4 years ago

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

kaey commented 4 years ago

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)

maxim0r commented 3 years ago

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.