[Libdlo] Synchronous vs. asynchronous USB

Phil Endecott spam_from_libdlo at chezphil.org
Tue May 26 10:39:59 PDT 2009


Steve (Endurance) wrote:
> On 25 May, Phil Endecott <spam_from_libdlo at chezphil.org> wrote:
>> I'm not sure what libdlo should do about this.  Perhaps a useful first 
>> step is to make it possible for users to get at the format conversion 
>> stuff separately from the USB transport.  I.e. (pseudo-code) 
>> re-implement things like dlo_copy_host_bmp as follows:
>>
>> dlo_copy_host_bmp(...) {
>>    buffer buf;
>>    dlo_make_copy_host_bmp_cmds(....,buf);
>>    usb_bulk_write(buf);
>> }
>
> Interesting suggestion. Reason libdlo is currently structured in this way
> because of its original use in embedded systems, where memory for large
> buffers is at a premium.

Right, so the issue is that if you send a large image you don't want to 
keep all of the converted data hanging around in a buffer.  One 
solution is for the user to break it up into sub-images themselves.  If 
you're sending something like a JPEG you don't want to have even one 
copy of the decompressed data.  You would get libjpeg to decompress 
line by line (or a small chunk of lines), and send that data without 
buffering it.  Ideally, the kernel would be sending one chunk while 
libjpeg is decoding the next chunk.

> It was also specified to be single threaded.

That's important.  Can you explain some more?  I would hope that, for 
example, a program could talk to two devices using two threads, one per 
device, if it wanted to.  Adding some notes about thread-safety to the 
documentation would be a really good idea...


Regards,  Phil


> This e-mail and any attachments may contain informtion which is confidential,
> proprietary, privileged or otherwise protected by law. The information is
> solely intended for the named addressee (or a person responsible for
> delivering it to the addressee). If you are not the intended recipient of
> this message, you are not authorized to read, print, retain, copy or
> disseminate this message or any part of it. If you have received this e-mail
> in error, please notify the sender immediately by return e-mail and delete it
> from your computer. 

Noted.





More information about the Libdlo mailing list