kr15h / ofxPiMapper

Projection mapping addon for openFrameworks that works on the Raspberry Pi
http://ofxpimapper.com
Other
465 stars 93 forks source link

example_fbo-sources slideshow not working #164

Closed magdesign closed 5 years ago

magdesign commented 5 years ago

I compiled example_fbo-sources on my RPI. When I run the mapper and select Slide Show Source as source, the surface stays black.

Its quite a while since we contributed the slideshow code and I am quite rusty in digging in the code. Anyone knows how to fix the Slide Show Source to get it running as expected on RPI ?!

Seeing this in the terminal:

./example_fbo-sources -f
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1920x1080
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1024x768
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[notice ] ofAppEGLWindow: createSurface(): surface created correctly
[notice ] ofAppEGLWindow: createSurface(): API bound correctly
[notice ] ofAppEGLWindow: createSurface(): -----EGL-----
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MAJOR = 1
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MINOR = 4
[notice ] ofAppEGLWindow: createSurface(): EGL_CLIENT_APIS = OpenGL_ES OpenVG
[notice ] ofAppEGLWindow: createSurface(): EGL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION = 1.4
[notice ] ofAppEGLWindow: createSurface(): EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface 
[notice ] ofAppEGLWindow: createSurface(): GL_RENDERER = VideoCore IV HW
[notice ] ofAppEGLWindow: createSurface(): GL_VERSION  = OpenGL ES-CM 1.1
[notice ] ofAppEGLWindow: createSurface(): GL_VENDOR   = Broadcom
[notice ] ofAppEGLWindow: createSurface(): -------------
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): mouse_fd=5 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.2:1.0-event-mouse
[notice ] ofAppEGLWindow: setupMouse(): mouse device name = Logitech USB Optical Mouse
[ error ] ofAppEGLWindow: ioctl GABS failed
[ error ] ofAppEGLWindow: ioctl GABS failed
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard_fd=6 devicePath=/dev/input/by-path/platform-3f980000.usb-usb-0:1.1.3:1.0-event-kbd
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard device name = NOVATEK USB Keyboard
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[ error ] ofDirectory: listDir:() source directory does not exist: ""/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/videos/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/videos/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/boot/ofxpimapper/sources/images/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/boot/ofxpimapper/sources/images/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb0/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb0/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb1/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb1/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb2/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb2/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb3/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb3/""
[warning] ofFile: copyTo(): destination file ""data/sources/images/image1.jpg"" already exists, set bool overwrite to true if you want to overwrite it
[ error ] ofFile: copyTo(): unable to copy ""data/sources/images/image1.jpg"":boost::filesystem::copy_file: File exists: "/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image1.jpg", "data/sources/images/image1.jpg"
[warning] ofFile: copyTo(): destination file ""data/sources/images/image2.jpg"" already exists, set bool overwrite to true if you want to overwrite it
[ error ] ofFile: copyTo(): unable to copy ""data/sources/images/image2.jpg"":boost::filesystem::copy_file: File exists: "/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image2.jpg", "data/sources/images/image2.jpg"
[warning] ofFile: copyTo(): destination file ""data/sources/images/image3.jpg"" already exists, set bool overwrite to true if you want to overwrite it
[ error ] ofFile: copyTo(): unable to copy ""data/sources/images/image3.jpg"":boost::filesystem::copy_file: File exists: "/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image3.jpg", "data/sources/images/image3.jpg"
[warning] ofFile: copyTo(): destination file ""data/sources/images/image4.jpg"" already exists, set bool overwrite to true if you want to overwrite it
[ error ] ofFile: copyTo(): unable to copy ""data/sources/images/image4.jpg"":boost::filesystem::copy_file: File exists: "/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image4.jpg", "data/sources/images/image4.jpg"
[warning] ofFile: copyTo(): destination file ""data/sources/images/image5.jpg"" already exists, set bool overwrite to true if you want to overwrite it
[ error ] ofFile: copyTo(): unable to copy ""data/sources/images/image5.jpg"":boost::filesystem::copy_file: File exists: "/home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image5.jpg", "data/sources/images/image5.jpg"
[ error ] ofDirectory: listDir:() source directory does not exist: ""/boot/ofxpimapper/sources/images/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/boot/ofxpimapper/sources/images/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb0/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb0/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb1/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb1/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb2/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb2/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb3/""
[ error ] ofDirectory: listDir:() source directory does not exist: ""/media/usb3/""
[ error ] ofImage: loadImage(): couldn't load image from ""image1.jpg""
[ error ] ofImage: loadImage(): couldn't load image from ""image2.jpg""
[ error ] ofImage: loadImage(): couldn't load image from ""image3.jpg""
[ error ] ofImage: loadImage(): couldn't load image from ""image4.jpg""
[ error ] ofImage: loadImage(): couldn't load image from ""image5.jpg""
[ error ] magSlideShowSource::initialize: Failed to create slide show from folder sources/images
[notice ] MediaServer: Attempting to add FBO source with name FBO Source
[notice ] MediaServer: Source new, adding
[notice ] MediaServer: Attempting to add FBO source with name Slide Show Source
[notice ] MediaServer: Source new, adding
numPresets: 1
[notice ] MediaServer: Initialized reference count of /home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image4.jpg to 1
[notice ] MediaServer: Initialized reference count of /home/pvj/openFrameworks/addons/ofxPiMapper/example_fbo-sources/bin/data/sources/images/image1.jpg to 1
[notice ] MediaServer: Attempting to load FBO source with name Slide Show Source
[notice ] MediaServer: Current Slide Show Source reference count: 1
[notice ] StartDragSurfaceCmd: exec
num items after enable: 5
num items after enable: 2
[notice ] RadioList: Item with value Slide Show Source not found
[notice ] SetSourceCmd: exec
[notice ] MediaServer: Attempt to unload FBO source Slide Show Source
[notice ] MediaServer: Current Slide Show Sourcereference count: 0
[notice ] MediaServer: Slide Show Source reference count <= 0, removing from loaded sources
[notice ] MediaServer: Source count after FBO source removal: 2

[notice ] MediaServer: Attempting to load FBO source with name Scanline Source
[notice ] MediaServer: Current Scanline Source reference count: 1
[notice ] Application::saveProject: Saving project...
magdesign commented 5 years ago

I uncommented in src/MediaServer/MediaServer.h all following lines:

#define PI_IMAGES_DIR "/boot/ofxpimapper/sources/images/"
#define PI_VIDEOS_DIR "/boot/ofxpimapper/sources/videos/"

/* 
 * These you can get when you apt-get install usbmount
 */
#define USB0_IMAGES_DIR "/media/usb0/"
#define USB1_IMAGES_DIR "/media/usb1/"
#define USB2_IMAGES_DIR "/media/usb2/"
#define USB3_IMAGES_DIR "/media/usb3/"

#define USB0_VIDEOS_DIR "/media/usb0/"
#define USB1_VIDEOS_DIR "/media/usb1/"
#define USB2_VIDEOS_DIR "/media/usb2/"
#define USB3_VIDEOS_DIR "/media/usb3/"

and compiled again, then made a symlink in ofxPiMapper/example_fbo-sources/bin/data/sources pointing to an images and a videos folder. All media is selectable and shows on a surface.

But when selecting Slide_Show_Source, it stays black. Terminal tells me:

[notice ] SetSourceCmd: exec
[notice ] MediaServer: Unload image, current reference count: 1
[notice ] MediaServer: New reference count: 0
[notice ] MediaServer: Removing image /media/internal/images/PVJ_with_box_hd.jpg
[notice ] MediaServer: Source count BEFORE image removal: 1

[notice ] MediaServer: Source count AFTER image removal: 0

[notice ] MediaServer: Attempting to load FBO source with name Slide Show Source
[notice ] MediaServer: Current Slide Show Source reference count: 1

Any help very welcome. Will donate to the one who fixes it.

https://github.com/kr15h/ofxPiMapper/issues/138 changing this in line 182 gives a compile error....

magdesign commented 5 years ago

Thanks to: Cristobal Mendoza for the fix!

(my fork is too old publish the code change there...)

magdesign commented 5 years ago

https://pocketvj.com/downloads/SlideShowSource.zip