June 15, 2006

EZFB/LaserBoy 以及美妙的 Linux 多媒體

介紹 [EZFB Linux Framebuffer API] 與 [LaserBoy] 之前,說些故事。

Linux 的世界總是充滿驚喜,讓我印象深刻的例子頗多,比方說,幾年前有人說:「既然我把 Linux 當作 networking server 應用,Video RAM 對我來說沒什麼意義,是不是可以把 Video RAM 拿來當作 swapping / buffer 來用呢?」,理論上可行,不過實務上似乎很少看到,但是沒多久,某位仁兄就在 LKML 上面張貼 patch,而且還能運作。隨著電子裝置的進步,Linux 應用的觸角也逐漸伸展到傳統自動控制領域中,因為案例很多,這裡就不贅述了。

Linux kernel 2.2 之後,引入 Graphical Framebuffer 的機制,也實做了 fbcon (2.6 後有新的設計),同一個時期,3D Acceleration 的機制初步在 Linux 上實現 (最早於 3dfx 於 user-space 的實驗性機制),多媒體的應用可以說是爆炸性成長,現在連 SONY PlayStation 系列都採用 Linux 了。在 Linux 上面開發應用程式,或者對 kernel 作延伸修改,的確不是很容易的事情,捫心自問:多少夜晚都在浸淫於 hacking 的快感與苦楚中度過?不過,正因為這種痛苦,往往將深度帶給我們,很多時候,Linux 平台上總是會激發出許多不可思議...

看到某公司的 Projector Phone 正確無誤地打出影像,近來的系統甚至可播放影片與多媒體資訊,心頭總是有種說不出來的感動,只能說,Linux 能做的事情太多了,然而,有時候不免會懷疑:多媒體的建設與規格都發展成熟,無論是行動裝置、數位廣播,還是數位家庭等,還會有什麼新花樣呢?我的想像力很有限,不過,如果您的手機除了通訊外,在需要作簡報展示或打發時間之際,稍微動一下就可以拿來當投影機,絢麗地呈現,難道不是很有趣的感受嗎?[LaserBoy] 是另一個特別的計畫,這個計畫的簡介是:
    Linux Laser Projector
使用 Linux 的雷射投影機?乍聽之下,不免心生詫異,但是既然技術上都可行,那麼,"Why not?",以下引用網頁介紹:
    LaserBoy is a Linux console / frame buffer application that can open, manipulate and save DXF, ILDA and WAVE. ... LaserBoy also includes a working implementation of 24 bit color tables.

    LaserBoy can translate laser vector art into standard, 48KHz, 16 bit, multi channel Microsoft RIFF WAVE file format and play those files with independent sample shifts between the channels for proper time alignment between the scanners and the color modulation devices (per color).

    Waves made with LaserBoy can be played from any surround sound card in any OS. LaserBoy can open its own generated wave files and convert them back into vector art.

    LaserBoy provides a full set of points optimization routines including distance spanning, corner dwelling and the ability to minimize total points distance by rearranging the order and direction of lit segments within a frame.

    With a DC modified 8 channel sound card and some outboard electronics, LaserBoy is currently outputting full motion, 16bit X, Y position, 24 bit RGB color projections at 48 thousand points per second. Creating waves of any integer sample rate is possible. 48KHz is only a limitation of the sound card that I am currently using.
簡單來說,James Lehman 的 [LaserBoy] 計畫就是建立一個機制,讓向量雷射圖樣得以透過 Microsoft RIFF WAVE 格式作為保存與交換,也可以作圖樣的呈現,在控制取樣率與相關的視訊參數前提下,令人感動的美妙畫面就呈現了,例如網頁提到以下的效果: (click to enlarge)

Linux 的吉祥物 Tux 的畫面看起來有交錯的感覺,就是因為光學成像的控制,可參考 [實際運作的錄影] (MPEG-2 格式),[LaserBoy] 網頁有更多美妙的展示,而,要建構這樣的圖樣,就需要一個 Graphical Toolkit,Linux Framebuffer 提供了最基礎的驅動與邏輯上的畫布,[EZFB Linux Framebuffer API] 則是作者為了簡化開發,提出一套易用的 API,其 [概念介紹] 提到為何需要重新設計這樣一個 Toolkit 的原因:
    EZFB provides control of multiple video cards within the same system.

    EZFB offers exceptional control of colors, including palette cycling, the ability to display all or portions of bitmap files anywhere on the screen, with automatic color depth conversion, the ability to capture all or portions of the screen to bitmap files, an 8x8 bitmaped font to print to the screen, routines to draw points, lines, outlined and filled rectangles and much more!
實在是很有意思,[EZFB Linux Framebuffer API] 用以控制多張 video card,然後因為針對雷射投影作量身打造,提供許多基本與進階的圖樣處理機制。因為這個計畫實在太吸引我了,剛剛用了不少時間作測試與評估,發現建立的 matrix 與 transform 運算量頗大,所以反應速度沒有想像中的好,但是效果的確驚人。

Linux 未來的多媒體應用會如何呢?自己動手來決定吧 :-)
由 jserv 發表於 June 15, 2006 11:02 PM
迴響

jserv 你好
我有一個戶外燈光的設計案,能否給于雷射打光方面的協助?
不知如何合作?

謝榮雅 發表於 June 22, 2006 12:10 PM
發表迴響









記住我的資訊?