>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Features

Author Thread: DMA-variables?
davin.church
DMA-variables?
Posted: Monday, April 05, 2004 5:53 PM (EST)

Ok, I've got a wild and wacky idea.....


Background:  A friend of mine is designing an application that watches real-time video feeds.  However, the sheer amount of data coming in is daunting.  In fact, the video capture cards all seem to have on-board DMA memory containing the video feed, probably because it is too CPU-intensive to transfer it all to the CPU's memory in real time and still get any work done.  He would like to use APL to manipulate this data stream, but I'm having a hard time trying to figure out how to get it into a variable to work with.  This sounds like an opportunity for enhancement!


What I think might help is the ability to tie an APL variable directly to a fixed memory address (outside the workspace).  Accessing the variable would use raw data directly from that memory location without first transferring it into the workspace.  Modifying the variable (especially only parts of it) could also write directly to that space (though that isn't needed for this application).  Syntactically, this could look similar to any of the methods used in various APLs for accessing files-as-variables.


Of course something like this would require substantial changes to the interpreter.  You'd need a new internal datatype that contained a pointer similar to a nested scalar, except that the pointer would be to an outside address instead of a workspace mentry.  You might also want to keep a second datatype to indicate whether the external memory was to be returned as characters, integer bytes, words, etc.


Any comments, or official certifications that I'm insane?


Comments:

Author Thread:
mrvn
DMA-variables?
Posted: Tuesday, April 06, 2004 2:17 PM (EST)
Why is #WCALL 'W_Mem' not sufficient?

     

Jairo.Lopez
DMA-variables?
Posted: Tuesday, April 06, 2004 6:05 PM (EST)

Would []wcall work for accessing memory on a device that required a driver?

     

davin.church
DMA-variables?
Posted: Thursday, April 08, 2004 3:35 AM (EST)

Because I'd like to process large portions of the data using APL (i.e. using arrays, not looping through one byte at a time), but without taking the extra time to copy it into an actual variable first.

 

For instance, say I wanted to compare two sequential (separate) buffers to see what has changed.  Then I could just do A{equiv}B or similar comparisons.

     

mrvn
DMA-variables?
Posted: Tuesday, April 13, 2004 8:49 PM (EST)
Okay, I understand what you are trying to do. This is certainly feasible, but would require many changes throughout the interpreter; practically every primitive would need to be changed. I don't foresee this getting to the top of the enhancement list any time soon; I would like to see objects and, using objects, some sort of namespace encapsulation implemented first.

     

davin.church
DMA-variables?
Posted: Thursday, April 22, 2004 3:01 AM (EST)

Well, I said it was a crazy idea.  It probably isn't even practical to use, even if it were implemented.  It may be that the DMA-processing I need to do would end up swamping the amount of time it would take to copy it into the workspace anyway.

 

C'est la vie

     

fredmw
DMA-variables?
Posted: Thursday, April 22, 2004 11:30 PM (EST)

I have not extensively used the hardware access objects of DirectX, but they may be a good solution for your friend's problem.

 

Microsoft has put a lot of time and effort into making the DirectX libraries as fast as possible at directly accessing video and audio hardware.  This is especially true for the latest version, DirectX 9, as Microsoft has worked closly with video card manufacturers such as ATI and NVidia to produce cards which are custom tailored for the DirectX technologies.

As far as I know, all major video processing software packages which use standard computer hardware default to DirectX for capture and display.

 

Microsoft also has extensive SDK's available for download from the official DirectX web site:

http://msdn.microsoft.com/DirectX

 

The objects which deal with hardware access are known as DirectMedia and DirectShow. They use to be known under the name of DirectDraw, but were reorganized with the release DirectX 8.

 

I hope this helps.

     

davin.church
DMA-variables?
Posted: Sunday, April 25, 2004 2:36 PM (EST)
That's a good idea - I'll have to check into that when he starts writing code for this.  One difference though is that he's doing video input rather than video output, so the hardware (and perhaps the methodologies involved) will be somewhat different.

     



APL2000 Official Web Site

People rarely succeed unless they have fun in what they are doing.
--- Dale Carnegie

APLDN Home   |    |  Events   |  Trainings   |  APL Books   |  APLDN Links   |    |  Discussion Groups   |    |  Downloads   |  Articles   |  Library   |  Learning Tools   |  APLDN User IO   |  APL2000.com   |