LaserBoy laser show creator and controller


11 posts
by JamesLehman » Mon Apr 15, 2013 1:01 am
Hi everyone!

The number one reason I got a Pi was to use it to build and run LaserBoy!

http://laserboy.org/forum/index.php?topic=559.0

LaserBoy is a full featured laser projection workstation. It allows users to create original full color 3D vector art and apply effects to create animations. The resulting art can then be rendered as a multi-channel wave file that, when played through a modified sound card (LaserBoy DAC) it produces the signals necessary to control a full color (RGB) ILDA standard laser projector.

The LaserBoy application requires a standard (US English) keyboard (no mouse!)

I just got the code to compile and look perfect in 16 bit packed pixel video. Now I need to see about getting the USB SND8 (C-Media 6206) sound device to play 6 or 8 channel waves from the Pi.

I hope you like it!

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by Arjan » Mon Apr 15, 2013 4:26 pm
Hi James,

Great!

I am working on a cheap ILDA output board for the RPi.
It is based on the SPI DAC MCP 4922.

Maybe we can get LaserBoy connected .... not sure about timing issues.

Regards, Arjan
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
User avatar
Posts: 199
Joined: Sat Sep 08, 2012 1:59 pm
by JamesLehman » Tue Apr 16, 2013 5:05 pm
Hi Arjan.

Thank you for your interest in LaserBoy!

I'm glad to see that there are already people on this forum who are experimenting with laser display.

The main idea of LaserBoy is that it makes waves! Waves are totally generic and are common to any and all modern operating systems. The file format is well documented and about as simple and straight forward as it could be. Plus it was written specifically to be extended without breaking it.

I added quite a bit of information to the header of the wave file and, since the color channels are actually dirived from 8 bit RGB values, I was able to use the least significant bits (16 bit) of the color channels to mark the ends of frames and mark repeated frames. That makes LaserBoy waves a perfectly suitable storage medium for laser signals. LaserBoy can open its own waves and convert them back into properly framed full color vector art.

LaserBoy reads and writes all formats of the ILDA file type. It also reads and writes DXF CAD drawings and its own format of plain ASCII text tables. So getting vector art in and out of the application is about as easy as it could be.

5.1 and 7.1 sound cards are very common and inexpensive. So for very little money one can have a 6 or 8 channel DAC that does 16 bits at 48K. The drivers are already done and any wave player can open waves and stream them to the DAC. What more could you ask for?

(Please don't say mouse support! :shock: )

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by JamesLehman » Tue Apr 16, 2013 6:35 pm
Oops! Just found a bug in the previouse version. This should fix it.

http://laserboy.org/code/LaserBoy_2013_04_16.zip

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by JamesLehman » Wed Apr 17, 2013 12:52 am
When you say ... "not sure about timing issues" ... are you curious about how to deal with the response delay of the scanners and the way the color control signals need to be delayed to match the time lag of the scanners?

In LaserBoy this is corrected by shifting the samples in the wave file back in time on the color signals. This is something that can be controlled within the application and there is a chunk of data stored in the header of the wave that indicates the number of samples shifted for each channel, so it can be un-shifted when opening the wave back into LaserBoy to re-frame it as color vector art and re-shifted for another laser projector with different timing characteristics.

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by Arjan » Wed Apr 17, 2013 11:15 am
Hi James,

I know LaserBoy for many years already ;)

I bought the RPi basically for building a cheap ILDA player. As soon as I have finished my prototype, I will publish it as Open ILDA.

5.1 and 7.1 sound cards are very common and inexpensive. So for very little money one can have a 6 or 8 channel DAC that does 16 bits at 48K. The drivers are already done and any wave player can open waves and stream them to the DAC. What more could you ask for?


I am not sure if a modified sound card is less expensive then a full compatible ILDA DAC board based on SPI DAC´s. For example, the MCP4922 (X,Y) is just € 2.06. The MCP4902 (R,G,B,I) is just 2* € 1.05. And the opamp TL084 is just 6 * 0.47. And then some resistors to finish it. I have got a prototype single layer PCB. Also not that expensive :D

not sure about timing issues

Linux is not the best OS for real-time applications like an ILDA player. Therefore it is almost impossible to work in user space. Maybe a proper SPI DAC device driver will do the trick. However, I am not a Linux kernel programmer.
So I am going for the bare-metal option 8-) The DAC output will be timer interrupt driven.

Regards, Arjan
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
User avatar
Posts: 199
Joined: Sat Sep 08, 2012 1:59 pm
by JamesLehman » Wed Apr 17, 2013 8:54 pm
I bet you know a lot more about building your own DAC that I do!

I guess the part I know well is how to deal with stuff in software.

I'm sure it would be very simple and straight forward to write an application that clocks a bit-trimmed version of the data found in a LaserBoy wave.

I'd really like to see what you come up with!

I am considering writing a bunch of system specific code to make the Pi or similar into a whole working system in a box..... for not so much money!

I didn't get much traction at all when I first released LaserBoy for Linux only. But that's because most people don't dedicate a machine to Linux.

With these new tiny computers, I have a known, fixed platform for special development.

James.
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by JamesLehman » Thu Apr 18, 2013 11:03 pm
Update:

I plugged in my LaserBoy DAC, aka C-Media 6206 based USB sound device modified for DC coupled output.

At first, I didn't think it was working correctly, but then I realized that the channel assignment is different from Windows. Channels 5 & 6 are swapped for channels 7 & 8. So when I played a standard 6 channel LaserBoy wave, I had no blue or monochrome signals. But then I switched the wires coming from the sound card, going into the correction amp and now I have everything right where it should be!

Now the only problem is that I see quite a bit of clipping on the galvo signals. When I play a wave of a circle that fills the display area, it's quite out-of-shape. I tried backing down the levels of the front left and right audio channels using alsamixer, but that doesn't fix it. It just makes the distorted circle smaller. If I crank the levels up beyond a certain threshold, it gets much more clipped into a big square.

If I display regular graphics that don't take up the whole display area they look fine!

So at least I have that.

I also notice that moving the mouse in X causes glitches in the display.

I think I need to look into shutting down every service that is not absolutely necessary.

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by Arjan » Fri Apr 19, 2013 4:32 am
Hi James,

Maybe the following article is of your interest : Raspberry Pi and real-time, low-latency audio
The Raspberry Pi can be set up to handle real-time, low-latency audio but it requires quite some tweaking. Hence this Wiki article in which some common bottlenecks as well as some possible optimizations will be described. Last but not least this article will explain how to get JACK aka jackd running on your RPi.


Arjan
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
User avatar
Posts: 199
Joined: Sat Sep 08, 2012 1:59 pm
by JamesLehman » Fri May 03, 2013 1:27 am
LaserBoy just got updated again!

http://laserboy.org/code/LaserBoy_2013_05_01.zip

This one has been tested to run from the console of the RPi.

It runs in all bits-per-pixel modes.

It also still runs well in X!

James. :)
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA
by JamesLehman » Thu Mar 24, 2016 7:40 pm
There is a new version of LaserBoy that now reads and writes CTN files.

There are some really inexpensive laser projectors on the market that have SD card readers in them. These SD cards take a file format called CTN. It is a variation of the ILDA file format, but none the less it is slightly different.

So, I added some functionality to LaserBoy to be able to read and write them. When writing them, you have the option to allow LaserBoy to optimize them for really good looking display.

If you DL LB, you get all the source code in C++. You get a Windows executable, but you have to build the code for Linux or Mac OSX.

http://laserboy.org/code/LaserBoy_2016_03_15.zip
( latest version: http://laserboy.org/forum/index.php?topic=10.0 )

To build you need libSDL 1.2 and Boost C++.

Code: Select all
apt-get install gcc build-essential libsdl1.2-dev
apt-get install libboost-all-dev

Once it is built, you can run it in X or you can run it in the console!

You need to know the size in pixels of your console frame buffer.

like this:
./LaserBoy 1280 1024

I fixed lots of bugs and figured out a few new tricks since the last time I posted anything about it.

BTW the C-Media 6206 based USB SND8 sound device works very well on a Pi!

And I sell LaserBoy Correction Amp kits.

So you can build a very nice DAC for your laser projector for very little money.

I hope you like it!

James.
Posts: 35
Joined: Mon Apr 15, 2013 12:10 am
Location: Akron, Ohio USA