OpenLase: open realtime laser graphics

Update: see this post for hardware info and also a new GL laser simulator for those without hardware.

First of all, as I’m sure everyone knows by now, I’ve been working on hacking the Kinect and writing open drivers for it. There’s a website for the community and a Git repo with the code, and it’s working fairly nicely by now.

With that out of the way, here’s a project that I’ve been working on on-and-off for the past year or so. I’ve been interested in laser scanning and DIY laser projectors, but I couldn’t find any good open source software to drive them. Specifically, I was interested in the realtime aspect: rendering and showing dynamically generated images and responding to events, not just making and preprocessing laser shows. So I set out to write my own set of software to do real-time rendering. This was the result:



DIY laser projectors commonly use sound cards as DACs. This shifts most of the processing over to the PC, but also lets us get very fine control over the realtime aspects of projection, which is what I want. Thus, my laser projector is based on a bog-standard USB soundcard, modified to pass DC. I’ll probably write a detailed article on the hardware later, but suffice it to say that it’s a galvo kit, a hacked chinese laser pointer, my own laser driver and monitoring circuitry, and some other minor parts. Total cost is about €200, if you play your cards right.

Since we’re converting laser images to audio data, why not just treat the laser data as audio in the first place? After all, laser samples are audio-rate data, and 16-bit multichannel 48kHz fits the requirements for laser projection very well. So that is what I did. OpenLase isn’t really a monolithic framework. Instead, it’s a series of stand-alone applications and chunks built on the excellent JACK audio connection kit, which serves to pipe realtime laser data around the different bits.

On a typical setup, you’d have two processes running on top of JACK. On one hand, there’s the output processor, which is responsible for formatting the idealized laser data to suit the peculiarities of the hardware. This includes things like brightness scaling, the obvious X/Y inversion settings, the final output perspective transform (to fit the screen), and minor filters to try to compensate for hardware imperfections. It also generates a 1kHz square wave on one channel – this is a peculiar safety feature of my laser hardware. I have a microcontroller monitoring this signal, such that if the software hangs or crashes for some reason, the laser shuts down immediately (to avoid having a static dot which would be a serious eye hazard). The OpenLase output processor has a simple Qt GUI that lets you tweak these settings on the fly.

On the other hand, you have whatever picture source you want to use. You can have bare JACK applications, such as two examples: ‘circlescope‘, a circular oscilloscope that takes realtime audio data from a media player, and ‘playilda‘, a bare-bones ILDA file player (ILDA / .ild is the standard file format for laser graphics). The circlescope is particularly good for showing off the real-time aspect (note that the input can come from the laser DAC’s line-in with only the small JACK buffering delay):

However, the other big part of OpenLase is libol, a realtime rendering library loosely modeled on OpenGL which lets you produce 2D and 3D graphics on the fly. This is what I used for the LASE demo above. The demo itself isn’t currently open source (and the code is utterly horrid – I wrote half of it at Euskal Encounter and finished it mere minutes before the deadline), but if there’s demand I might open source it too, just please don’t expect pretty code! However, keep in mind that most features used by the demo (text rendering, 3D, “shaders”, ILDA file loading, etc.) were implemented as part of libol, so you aren’t missing out on much. There are two libol-based examples: some rotating cubes, and Pong.

There’s one part of the demo made it into the OpenLase distribution as a separate example: tools/trace.c. This used to be some tracing code that I used for the metaballs and fire effects (I kind of cheated there, as those are rendered as bitmaps and then traced in realtime into laser vectors). It’s a terribly naive algorithm (check the source out for details), but it worked surprisingly well for certain kinds of video, so I hacked it and tacked on more heuristics in order to attempt to make it work better. It now lives next to tools/playvid.c, which is a simple video player using libavcodec. Here’s what it looks like (improved version (mkv), original YouTube video). More complex videos are hit and miss, but some things turn out surprisingly well for such a silly algorithm.

You can also add filters between the output and the image generator. This is what I did for my Kinect + OpenCV + OpenLase demo, which projects anything projectable by OpenLase onto a moving screen, with a dynamic perspective transform (in this case the perspective transform happens in the filter, not in the output processor). That code currently doesn’t even build with current libfreenect, but again, if someone is interested, drop me a line and I’ll make it work again and publish it.

OpenLase doesn’t have any facilities to patch together these JACK apps. Instead, you should just use existing JACK tools, such as QJackCtl, to connect all the input and output ports together. QJackCtl has a patchbay feature that automagically connects the ports when applications start up, so it’s quite seamless.

Right now there is pretty much no documentation, but I’d like to know if people are interested. If you have (or want to build) this kind of DIY hardware, you run Linux or some other UNIX that can run JACK, and you’re interested in hacking on the code or using it for something, please let me know! Here’s the git repo.

Update: Three more videos, musically themed. A laser visualization of MIDI data (MIDI to laser):

And the other way around, a laser harp (laser to MIDI):

59 Responses to “OpenLase: open realtime laser graphics”

  1. doragasu Says:

    Pretty cool stuff. Looking forward to see the hardware you used to build your laser projector ^_^

  2. GizmoTheGreen Says:

    So, I understand you watch anime? do you perhaps have an animelist?
    Here is mine http://myanimelist.net/animelist/GizmoTheGreen

    I just finished filling it in two days ago.

    I also look forward to your hardware documentation, I plan to make one myself based on that!

  3. mercluke Says:

    wow, that’s amazing. must’ve taken ages :O

  4. xorloser Says:

    very cool, do you ever find time for sleep? :)

  5. Mistawes Says:

    Woah, amazing stuff Marcan! Ya have me tripping looking at that video..

    Would love to see something like this at a huge concert or projected on a floor in a club etc.. Since it’s laser it could be miles away for a HUGE display! :D

    Another hardware junky waiting to see the guts of this device!

  6. Jael Says:

    watching the video has an optical illusion-like effect on me, in fact i am quite dizzy at the moment. :)

  7. masterdark Says:

    Hola amigo eres como un Dios para mi, estudio electónica en Chiapas y leo mucho sobre blogs de tecnologia entre otras cosas, no se como contactarte y supongo que este es tu blog y que leeras mi comentario, asi que tengo una duda que me gustaria me ayudaras a resolver, mi duda es como implementar kinect en un robot recolector de pet, si podria conectarlo a la computadora y de la computadora a un pic, pero que necesito para hacer eso? he buscado pero hasta ahora no he encontrado, agradeceria mucho tu respuesta por aqui o a mi correo…bueno disculpa las molestias, saludos desde Tuxtla Gutierrez, Chiapas. México.

  8. jeez Says:

    Please, release some docs on the hardware! I’m seriously willing to help you with the code, but I need to build my own hardware first.

    awesome job, by the way ;)

  9. Giorgos Lazaridis Says:

    I really like this harp that you made. And it looks like that you got some training, didn’t you? ;)
    I will feature this project in my site today.

  10. GargamelCZ Says:

    Looking forward for the HW blogpost, I want to build it aaaaall…. ^_^

  11. mutantkeyboard Says:

    Great…. it seems to have great potential… musicians like me will surely appreciate it …

  12. masterpj55 Says:

    Hey im masterpj from the PL forums (laser forum) ^^

    I was just randomly browsing and I guess you like anime?

    haha me too and I’m also doing laserstuff.
    I work more on the 3D / graphics side

  13. anarchytoday Says:

    I am looking forward to hardware schematics for doing digital graffiti… it looks like a good way to do some ad busting/culture jamming.

  14. Andrew Says:

    Set this up at our Burning Man camp, puhlease!!!

  15. psuedonymous Says:

    I love that Bad Apple has become a de-facto standard test for home built laser projectors. Where did you pick up your galvos?

  16. h Says:

    you are awesome

  17. tariq Says:

    this has amazing potential to be used by anyone.

    what id like to see in the future are changes to the color of the lazer.

    i dont know if thats even possible seeing as the green is what comes out of all of them anyways. im talking out of my ass. i dont know.

  18. smashingblumpkin Says:

    well what if you had 3 different color laser diodes 1 red 1 green and 1 blue
    and 3 controlers 1 for each ,would you be able to use the software to control three setups and, to make them work together ,like to make a video image,like the mitsubishi laser vision rear projection tvs,could you make your own laservision frontal projection system for a fraction of the cost?

  19. smashingblumpkin Says:

    also i used to have this mp3 program called sonique ,that had some really cool visualizer plugins ,1 in particular ,think it was called tripvis,still have it
    but wont run on my 64bit win,but its awesome a bunch of little cubes of dif colors 2 planes of em ,if you could port it over to work with your laser projector it would rock

  20. rgo Says:

    WOW! simply amazing! could you post more on the actual laser and the hardware used? I would love to attempt a project like this myself!!!

  21. Jeff G Says:

    Nice Job! I used to love working with lasers in my younger years. Too bad I can’t post a picture of the hardware I designed back in the day (early 90′s). Nice to see others with the same enthusiasm for lasers.

  22. Aurelio Ramos Says:

    It isn’t clear from your description how does openlase turn the laser diode on and off. You are using a sound card for x and y, and you mention a dead man switch type system to prevent a stationary dot, but what about turning the laser off when it jumps from one trace to the next? are you embedding a signal in the audio for this purpose? if so, what hardware decodes this signal? Thanks!

  23. Ivan P. Says:

    Hello Marcan :) First of all amzing work completely utterly amazing you have no idea how impressive it is. Well sorry had to release that out of my chest.. Marcan can you please publish a DIY on everything or at least please reference me to some books so i can accomplih something like this. I would love to build my own Laser projector and use openlase to present and imprtant roject at my school. So please!! Can you make a tutorial for us nobs :) i know i can do it i just a need a little push.. Thanks again Marcan fo this amazing eye-candy truly coming from a fan of lasers and light shows THANK YOU!!!! Youve made my day :D

  24. baslisks Says:

    we are looking to get this going. Can you give a more indepth build of this thing?

  25. Hinged Newt Says:

    Very nice job.
    - The Hinged Newt

  26. David Says:

    I’m having trouble finding clear plans/part list/instructions on how to build these. Could you provide a link to the kit you build also or more information on the actual projector?

  27. Late night coder Says:

    I’m about to build a basic laser demo using a pair of servos – probably more appropriate in my case ’cause the laser can be replaced with other implements. However, I’ve wanted to build a laser projector since my first rave, so like others above, I would appreciate some hardware specs :)

    Love the old school demo artefacts – when are Future Crew going to open Tech-schools so that I’ve got somewhere decent to send my kids? More creative engineers, less consumers ..

  28. Dennis Says:

    Hello,

    the PS3-stuff was already awesome, but this is even better, specially since it got lasers! :)

    I’m curious, is there any lowcost-interface compatible to ILDA and to your software for this? I got a green laser with ILDA but the interfaces and show-software is unpayable.

    And any idea how many points per second the laser must do for a fluid animation?

    cheers!

  29. Leo Says:

    Hello.

    Big compliments. Really impressive. I would like to collaborate in electronics, mechanichal & SW.

    Please answer to me.

    Cheers

    Leo

  30. dep Says:

    Awesome! Please, do another post about the hardware side – very interested to see what you’ve used and how.

    To Dennis, there is one affordable USB-ILDA interface that I know of, the MiniLumax: http://www.lumax.de/
    As for PPS, low-end show lasers seem to range from 20k up, but I don’t know what the minimum usable rate would be (obviously depends on the content, as well).

  31. Andrew O'Malley Says:

    Amazing project! I’d def. love to learn more about this, especially the DIY projector aspect.

    Cheers from Canada,
    ao.

  32. chris Says:

    Another request for information on the hardware, please. Pretty please?

  33. Ernesto Says:

    Very good development for the laserists out there. i (and many others) will appreciate a release of your hardware schematics and a buildup of the projector.

    thanks!

  34. minipimmer Says:

    Man, this is great. I can’t wait to have time to start working on this by my own. I’d like to somehow interface a Vectrex emulator to a laser projector, it should be very easy to do and great fun. Can’t wait to play vectrex on some building’s facade neither.

  35. Says:

    Awesome, I always wanted to make a laser harp.

  36. Ravestapler Says:

    Very cool! Please release the hardware specs so we can build this.

    Cheers

  37. alxlo Says:

    I second that. I saw the lightning talk at 27c3 and it was one of the best presentations I’ve seen for a long time. (Believe me, I have to endure a lot of PPTs at work.) Simply awsesome. And I’m just _craving_ for the hardware specs.

    So pretty please, with sugar on top, publish the fucking specs ;-)

  38. William Says:

    Please, please please do a hardware post! I’d love to contribute to the code, but I have to build it first! Also, I’d love to be able to build one of these for a concert within a few months.

  39. djoog Says:

    Please provide the description of the hardware !

  40. Laust Says:

    Very cool project and as most other comments here I am also very interested in seeing the hardware – I think you have invented a whole knew DIY category.

    I was thinking that if documenting the hardware build is a big job, maybe you could involve some people in the process and get them to create the documentation while building their own projector – I think it could be some very interesting blogs and wiki? This would leave you to explain the big picture and only answer questions for a smaller group?

    I for one would like to sign up for the project.

  41. Mike Says:

    I agree with Laust, as I am also very interested in this project! I have a homemade RGB laser projector that works with DMX and ILDA via USB, but I don’t know how I’ll use it with OpenLase yet because no more info has been published! :(

  42. marcan Says:

    @djoog, William, Laust, Ravestapler, chris, dep, et al.
    I published the hardware info two days ago, check it out here :)

    @Mike
    OpenLase currenty supports soundcard-based DACs, so if you’re using a vendor-specific DAC that will require support to be added. I figured most people with homemade projectors would be using a good old soundcard based DAC (from what I’ve seen, paradoxically, “dumb” soundcard DACs actually end up being more flexible than expensive frame-based DACs).

    If you have more info on your hardware and how to talk to it feel free to shoot me an e-mail and I’ll look into how to best add support for it.

  43. Abishek Says:

    woa thats some hefty hardware! , i wondering if the same thing can be pulled off with an Arduino , and i think it also has an audio driver shield .

  44. David Says:

    I love the fact that no protections being passed when using the Kinect with Open Source drivers. Without that I’m sure Microsoft would crush something thats truly amazing with the Kineect.

    Its not everyday that a mainstream product becomes popular with a subculture like the Kinect is. I really think though that the most popular aspect about the Kinect will be the commercial applications though. As seen through the Roomba team and its new robot powered by two Kinects.

    Onward and upwards and I hope the OpenKinect community keeps driving this forward!

  45. Ernesto Says:

    Hello

    where did the OpenLase stuff went? Can you post a step by step tutorial to run the demos on Windows PC?

  46. Vadim Says:

    Hello !
    Which version of the libav you use? When I try to compile the project, I have an error in ./tools/qplayvid/qplayvid.c Undefined reference to ‘av_get_bits_per_sample_fmt’

  47. Juno Says:

    Is this Dead Protocol Society Shenanigans at it again?

  48. vacd Says:

    Hello, has anyone already compiled exe files for win32?

  49. Sascha2612 Says:

    Hi!
    really cool Stuff and nice work!
    I like your simple and cheap Laserharp project.
    I would like to start a german discussion about your work in my new Laserboard http://www.laserlikers.net if its ok for you?

    greeting from Germany
    Sascha2612

  50. James Says:

    There is a project called LaserBoy that started in early 2004. That’s really where the idea of using a modified sound card came from. All of the kits that make the sound card correction amp are derived from the original LaserBoy Correction amp design.

    We have a forum! http://laserboy.org/forum/

    There you will find a lot of information about how to build a modified sound card, aka LaserBoy DAC.

    You will also find several applications that use this DAC model, including LaserBoy, that will compile and run in Windows, Linux and Mac OSX. It comes with a prebuilt Windows executable.

  51. marcan Says:

    It’s worth pointing out that my projector isn’t based on the LaserBoy design (in fact it doesn’t require any correction on the DAC outputs – the built-in input scale adjust on my galvos is sufficient to get a good scan angle with the +/-2.5V DAC output levels). The LaserBoy correction amp is cool and I recommend it for anyone who wants to interface with standard ILDA scanners, but I think suggesting that “the idea of using a modified sound card came from LaserBoy” and “all sound card correction amps are based on the original LaserBoy Correction Amp design” is a bit naive.

    As for OpenLase – sorry for not documenting it properly! It’s definitely on my TODO list but it’s hard to find some time to spend on it :( .

    @Sascha2612 Absolutely, feel free!

  52. James Says:

    Not naive. Just history. Of the two most popular kits for the amp, I did the layout for one and tech supported the design of the other. They are both based on the design that has been posted since early 2005.

  53. marcan Says:

    Sound cards have been used for laser display on Amiga computers way earlier: http://web.archive.org/web/20001025063833/http://www.midwest-laser.com/html/computer_controlled_laser_show.html

    The LaserBoy amp is cool, but it wasn’t the first to come up with the idea of using a sound card as a DAC, nor is it the only possible design, nor are all designs based on it (though many certainly are). For example, as far as I know, the LaserBoy Correction Amp doesn’t do any monitoring like mine does (i.e. if the software crashes and the sound card device is closed, some sound cards will hold their outputs at their previous level, potentially leaving the laser static at full power resulting in a hazardous situation).

    I did try LaserBoy (the software) early on before starting to work on OpenLase, but I wanted to do realtime rendering and I also wanted an SVG converter for non-realtime use, which were things that it couldn’t do. That’s why I started working on my own software.

  54. James Says:

    Inexpensive 6 and 8 channel sound devices, designed to reproduce Dolby 5.1 and 7.1 didn’t even exist until the early to mid 2000s. I remember I had to do a lot of research to find PCI cards that could be modified. I had already started on the development of my code before I ever had a real hardware device that could play 6 channels. 8 channels came after that.

    LaserBoy is the first application ever that can produce all of the signal information needed to display a full color laser show with stereo audio, using a single, inexpensive, modified sound device. It was specifically created to be an enhancement to the idea of using an ADAT machine; but to do it entirely in the software domain.

    With the development and deployment of LaserBoy and its related technology came a set of standards for both hardware and software. There is the correlation of signals to track numbers and an extensive and feature rich set of extensions to the RIFF WAVE file format, making it a complete answer for both display-ready information and a laser art storage format with end-of-frame, unique-frame, color-to-scanner time offsets and many other features.

    There is also at least one driver that makes a LaserBoy DAC a live display device that many laser show applications can now use just like any other proprietary laser display device.

    A number of these applications can save their output streams as wave with the LaserBoy extensions, that can be opened in LaserBoy and converted back into the original, framed color vector art from which they came. Some of the free apps out there can only save their output as LaserBoy formatted waves.

    All of this came from LaserBoy and the proof it provided that these things could be done.

  55. Luke Says:

    Hi there

    I’m a artist who works on laser, your work is amazing! I have been interested in laser scanning for a year but couldn’t find any solutions.
    Since im not a c language use, may I know is it possible to purchase your technology or knowledge please?

    please feel free to mail back me

    Best

    Luke

  56. Luke Says:

    I think we talked before, I have tried many ways around, I think I want to use Openlase now, thanks, but is it purchasable? I mean, can I just buy a pack from you with everything, a turn key solution.

    Thanks

    Luke

  57. marcan Says:

    Hi Luke,

    Unfortunately, this is a DIY project and not a turn key solution. If you’re interested you’ll have to build the hardware yourself and work it out on your own.

  58. Eric Says:

    hi when will openlase be released, this would be a cool project thanks

  59. Free WoW BEST Gold Generator Hack 2013 [BILLIONS OF GOLD PER DAY !] REALLY WORK !!! Says:

    It’s ideal time for you to make some plans for any years to come and it’s really time and energy to be very glad. I’ve learn this informative article of course, if I’ll simply I would like to give you advice quite a few interesting concerns or even ideas. You could possibly could possibly publish subsequent reports in regards to this report. I actually wish to study a lot more difficulties regarding this!

Leave a Reply