This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLPDLCR2000EVM: Create diffraction patterns with the DLP2000

Part Number: DLPDLCR2000EVM
Other Parts Discussed in Thread: BEAGLEBONE, TEST, DLP2000, , DLPC2607

I was wondering what the easiest way is to create diffraction grating patterns on the DLP LightCrafter Display 2000. Is there a way to manually rotate the DMD pixels, or is there an easier way? I saw something about some sample pattern files, but am unclear how to implement them in the linux terminal. I am using the BeagleBone Black host processor to control the DMD.

  • To be more clear, I want to create my own diffraction patterns and display them. I was able to use the structured_light folder and the corresponding Makefile to display the default solid-color patterns using pattern_disp, and now I want to make my own. 

  • Russell,

    I believe that the pattern display software you are referring to loads custom bitmap files in order to construct the display patterns. Have you tried this feature yet?

    Regards,

    Philippe Dollo

  • Thank you for the reply!

    The only software I know so far that contains custom images is what is given in the structured_light folder. Using the programmer's guide, I was able to implement the i2c commands to display these images. I have tried it, along with the ./pattern_disp command, and they both work fine. Now, I would like to code and display my own diffraction pattern if possible. Are you saying that I am able to create my own bitmap files and run them in the same folder to produce my own pattern? If so, is there some sort of guide to help me in the process of creating these bitmap files (as I did not see anything about this so far in documentation)? Thank you.

  • Russell,

    You can use any standard bitmap image editor (such as MS Paint) to modify and generate bitmap (BMP) files. Afterwards, you can refer to the "open_bmp" library in the structured light codebase for opening them in your code.

    I hope this helps.

    Regards,

    Philippe Dollo

  • Hi Russell,

    I tried to use the structured_light folder and the corresponding Makefile as well but it seems nothing happened to my beaglebone desktop. Is there something wrong with my steps? i thought maybe that commands should be used during my video playing but i can not do anything during the period of running time.

    Many thanks

    Zhou

  • Zhou,

    Can you share your terminal output log?

    Regards,

    Philippe Dollo

  • Hi sir,

    Script started on Thu 07 Nov 2019 12:08:01 PM UTC
    debian@beaglebone:~$ cd /opt/scripts/device/bone/capes/DLPDLCR2000/structured_lig^Mght ^H^[[K/
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light$ m ^Make all
    gcc -o pattern_disp open_bmp.c display_core.c display_app.c -O3  -std=gnu89
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light$ ./^M/pattern_disp
    Usage: pattern_disp [options] framerate repetitions

    Options:
     -test (-t)     run through built in test patterns
     -in (-i)       use the trigger in (GPIO115) to advance to next pattern instead$
     -persist (-p)  the last pattern will stay on the screen at the end of the sequ$
     -kill (-k)     stop running the X-server (sometimes gets better results and hi$
     -video (-v)    don't disable any of the video processing algoirthms on the EVM$
     -restart (-r)  stop running the X-server and restart the X-server when done
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light$ $
    Floating point exception
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light$ cd^Md /opt/scripts/device/bone/capes/DLPDLCR2000/
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000$ tar -xvf dlp_lightc^Mcrafter-1.0.19.tar.gz
    dlp_lightcrafter-1.0.19/
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/datalog.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/dpp2607.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/enum.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/i2c.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/linuxi2c.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/version.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter/__init__.py
    dlp_lightcrafter-1.0.19/dlp_lightcrafter.egg-info/
    dlp_lightcrafter-1.0.19/dlp_lightcrafter.egg-info/dependency_links.txt
    dlp_lightcrafter-1.0.19/dlp_lightcrafter.egg-info/PKG-INFO
    dlp_lightcrafter-1.0.19/dlp_lightcrafter.egg-info/SOURCES.txt
    dlp_lightcrafter-1.0.19/dlp_lightcrafter.egg-info/top_level.txt
    dlp_lightcrafter-1.0.19/PKG-INFO
    dlp_lightcrafter-1.0.19/README.txt
    dlp_lightcrafter-1.0.19/setup.cfg
    dlp_lightcrafter-1.0.19/setup.py
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000$ cd dlp_lightcrafter^Mr-1.0.19
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/dlp_lightcrafter-1.0^M0.19$ sudo python setup.py install
    [sudo] password for debian:
    running install
    Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
    /usr/bin/python -E -c pass
    TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
    running bdist_egg
    running egg_info
    writing dlp_lightcrafter.egg-info/PKG-INFO
    writing top-level names to dlp_lightcrafter.egg-info/top_level.txt
    writing dependency_links to dlp_lightcrafter.egg-info/dependency_links.txt
    reading manifest file 'dlp_lightcrafter.egg-info/SOURCES.txt'
    writing manifest file 'dlp_lightcrafter.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-armv7l/egg
    running install_lib
    running build_py
    creating build/bdist.linux-armv7l/egg
    creating build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/__init__.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/i2c.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/linuxi2c.py -> build/bdist..linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/enum.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/datalog.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/dpp2607.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    copying build/lib.linux-armv7l-2.7/dlp_lightcrafter/version.py -> build/bdist.linux-armv7l/egg/dlp_lightcrafter
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/__init__.py to __init__.pyc
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/i2c.py to i2c.pyc
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/linuxi2c.py to lin$
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/enum.py to enum.pyc
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/datalog.py to data$
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/dpp2607.py to dpp2$
    byte-compiling build/bdist.linux-armv7l/egg/dlp_lightcrafter/version.py to vers$

    creating build/bdist.linux-armv7l/egg/EGG-INFO
    copying dlp_lightcrafter.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-$
    copying dlp_lightcrafter.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/E$
    copying dlp_lightcrafter.egg-info/dependency_links.txt -> build/bdist.linux-arm$
    copying dlp_lightcrafter.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg$
    zip_safe flag not set; analyzing archive contents...
    creating 'dist/dlp_lightcrafter-1.0.19-py2.7.egg' and adding 'build/bdist.linux$
    removing 'build/bdist.linux-armv7l/egg' (and everything under it)
    Processing dlp_lightcrafter-1.0.19-py2.7.egg
    removing '/usr/local/lib/python2.7/dist-packages/dlp_lightcrafter-1.0.19-py2.7.$

    Extracting dlp_lightcrafter-1.0.19-py2.7.egg to /usr/local/lib/python2.7/dist-p$
    dlp-lightcrafter 1.0.19 is already the active version in easy-install.pth

    Installed /usr/local/lib/python2.7/dist-packages/dlp_lightcrafter-1.0.19-py2.7.$
    Processing dependencies for dlp-lightcrafter==1.0.19
    Finished processing dependencies for dlp-lightcrafter==1.0.19
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/dlp_lightcrafter-1$
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/dlp_lightcrafter-1$
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000$ Processing^H^[[K^$

    Make sure the display port is set. For example export DISPLAY=:0

    1
    SourceSel.EXTERNAL_VIDEO_PARALLEL_I_F_
    2
    Resolution.NHD_LANDSCAPE
    ##################################################################
    play video
    nhd_test.mp4
    ^[[0mPlaying: nhd_test.mp4
    ^[[0m^[[0m (+) Video --vid=1 (*) (h264)
    ^[[0mlibEGL warning: DRI2: failed to authenticate
    ^[[0;33m[vo/opengl] Suspected software renderer or indirect context.
    ^[[0m^[[0;33m[vo/opengl] Suspected software renderer or indirect context.
    ^[[0mFailed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object$
    ^[[0;31m[vo/vdpau] Error when calling vdp_device_create_x11: 1
    ^[[0m^[[0;31m[vo/xv] No Xvideo support found.
    ^[[0m^[[0m[vo/sdl] Using opengl
    ^[[0m^[[0mVO: [sdl] 640x360 yuv420p
    ^[[0m^[[0m[osd/libass] PlayResX undefined, setting to 960
    ^[[0m^M^[[K^[[0mV: 00:00:00 / 00:00:22 (0%)^M^[[0m^M^[[K^[[0mV: 00:00:00 / 00:0$
    ^[[0m
    ^[[0m^[[0m
    ^[[0m^[[0mExiting... (Quit)
    ^[[0mNone
    Does the video play on the screen? (Pass/Fail/Stop) (Pass/Fail/Stop) and commen$
    debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000$ cd
    debian@beaglebone:~$ exiu^H^[[Kt
    exit


    Here is my step below:

    1. Navigate to /opt/scripts and do a “git pull”.
    2. Within the /opt/scripts/device/bone/capes/DLPDLCR2000/structured_light directory
    3. View the code and run the make file (“make all”).
    4. Enter “./pattern_disp” to run the program and view its options.
    5. Running “./pattern_disp –t” will run a couple test patterns to confirm correct operation.

    Play fishbowl video:
    6. cd /opt/scripts/device/bone/capes/DLPDLCR2000/
    7. tar -xvf dlp_lightcrafter-1.0.19.tar.gz
    8. cd dlp_lightcrafter-1.0.19
    9. sudo python setup.py install
    10. export DISPLAY=:0
    11. cd /opt/scripts/device/bone/capes/DLPDLCR2000/
    12. python MplayerTest.py


    Thank you!

    Zhou

  • Zhou,

    What distribution are you using? the log above shows that your X11 driver is failing and the system is resorting to OpenGL. The video scripts included with the DLP2000 assume you are using X11 to display to the BeagleBone desktop.

    Verify that your X11 setup is good before proceeding.

    Regards,

    Philippe Dollo

  • Hi,

    Sorry, how to verify that my X11 setup is good? Does 'Debian 9.9 2019-08-03 4GB SD LXQT' should be ok?

    I use Putty on PC and show BeagleBone desktop by DLP2000.

    For now, I sent some .bmp files into the current file (/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light directory). There's still nothing changed on my Beaglebone desktop. Should somthing else be changed in any .c files?

    -rw-r--r-- 1 debian debian 10352 Aug 4 02:37 display_app.c
    -rw-r--r-- 1 debian debian 2141 Aug 4 02:37 display_app.h
    -rw-r--r-- 1 debian debian 12527 Aug 4 02:37 display_core.c
    -rw-r--r-- 1 debian debian 2861 Aug 4 02:37 display_core.h
    -rw-r--r-- 1 debian debian 1682130 Nov 18 20:18 holdthis.bmp
    -rw-r--r-- 1 debian debian 2037 Nov 7 00:15 Makefile
    -rw-r--r-- 1 debian debian 485814 Nov 18 20:27 next.bmp
    -rw-r--r-- 1 debian debian 5526 Aug 4 02:37 open_bmp.c
    -rw-r--r-- 1 debian debian 2050 Aug 4 02:37 open_bmp.h
    -rwxr-xr-x 1 debian debian 18656 Nov 18 20:25 pattern_disp
    -rw-r--r-- 1 debian debian 1085 Nov 7 12:01 README.md

    Thank you!

    Zhou

  • Zhou,

    To ensure your setup is good, you may want to consider calling mplayer and forcing it to use the specific video driver of your choice. The error log will hopefully provide some clues.

    Alternatively, you can just install the Debian distribution that is a known good compatible with the DLPDLCR2000EVM:

    https://debian.beagleboard.org/images/rcn-ee.net/rootfs/bb.org/testing/2017-08-01/lxqt-4gb/

    Look for "BBB-blank-debian-8.9-lxqt-4gb-armhf-2017-08-01-4gb.img"

    I hope this helps.

    Regards,

    Philippe Dollo

  • Hi

    Thank you for helping!! It works once I update my board again. 

    Then I tried to put my .bmp files into current program directory. However, it shows an error with the image width:

    [debian@beaglebone:/opt/scripts/device/bone/capes/DLPDLCR2000/structured_light$ ./pattern_disp -p
    Incorrect width
    Unable to proceed]

    Size of .bmp file I used is 360*640 according to open_bmp.file.

    Another quick question, How to connect to SSH by root?  I find an instruction but it still doesn't work...

    The reason why i do so is that i want to connect BBB with MATLAB.

    Here is the instrcution:

    as of 2017-02-19, BeagleBoard images now longer enable these insecure options by default, you are free to recreate them as you wish.

    remove root password

    root_password=$(cat /etc/shadow | grep root | awk -F ':' '{print $2}')
    sed -i -e 's:'$root_password'::g' /etc/shadow
    

    ssh root@beaglebone.local

    sed -i -e 's:PermitEmptyPasswords no:PermitEmptyPasswords yes:g' /etc/ssh/sshd_config
    sed -i -e 's:UsePAM yes:UsePAM no:g' /etc/ssh/sshd_config
    sed -i -e 's:PermitRootLogin without-password:PermitRootLogin yes:g' /etc/ssh/sshd_config
    

    sudo no password required

    echo "debian  ALL=NOPASSWD: ALL" >>/etc/sudoers


    Sincerely
    Zhou
  • Zhou,

    Native resolution for the EVM as a display is 640x360, not the other way around. You may need to rotate your image.

    As for BeagleBone root access, you may want to consult the BeagleBoard community forums about this:

    https://beagleboard.org/discuss

    Regards,

    Philippe Dollo

  • Hi

    Thank you very much!

    1. According to the User manual of DLPC2607, It is easy to use i2c to project SELECTED test patterns and implement other commands. 

    I guess there should be some ways to change the built-in test patterns, like finding them in somewhere in host perhaps.

    2. Although I can use i2c as expected, I can see 0x00 values in all registers. And there are no changes in value when I use commands.

    debian@beaglebone:~$ i2cdetect -l
    i2c-2 i2c OMAP I2C adapter I2C adapter
    i2c-0 i2c OMAP I2C adapter I2C adapter


    debian@beaglebone:~$ i2cdetect -r 2
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-2 using read byte commands.
    I will probe address range 0x03-0x77.
    Continue? [Y/n] y
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    debian@beaglebone:~$ i2cdump 2 0x1b
    No size specified (using byte-data access)
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-2, address 0x1b, mode byte
    Continue? [Y/n] y
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    Regards,

    Zhou

  • Zhou,

    If you are using internal test patterns, you actually don't even need the BeagleBone Black necessarily. As long as you have an I2C communication channel you can use the internal test pattern feature (although it should work fine with the BeagleBone too).

    If you are trying to select test patterns you need to first configure the system for internal pattern mode. First, let me bring the DLPC2607 programmer's guide to your attention: http://www.ti.com/lit/ug/dlpu013a/dlpu013a.pdf

    This programmer's guide explains how to send I2C commands correctly to the system.  For internal TPG mode, you need to change the source selection register (0x0B) to TPG and the resolution setting (0x0C) to match the selected test pattern. Alternatively, there are sample scripts which implement I2C functionality on the BeagleBone Black in Python which you can refer to here:

    https://github.com/RobertCNelson/boot-scripts/tree/master/device/bone/capes/DLPDLCR2000

    I hope this helps.

    Regards,

    Philippe Dollo

  • Hi,

    Thank you for replying to me.

    I can follow that GUIDE to project the ready-made test patterns. However, I am looking for a solution to direct replace them not simply changing the projection sequence of them.

    And any clue on why there are all zero values in registers? 

    Regards

    Zhou

  • Zhou,

    The internal test patterns in the DLPC2607 are fixed (outside of some basic settings you can modify such as checkerboard size, etc.). You cannot replace the test patterns entirely.

    As for your dump result, it is likely that the read command was not issued properly, so the system did not return what you were expecting. Please ensure you are following the "read" protocol defined in the DLPC2607 programmer's guide.

    Regards,

    Philippe Dollo