<html>
<head>
</head>
<body>
If you are using actual sound, the normal approach is to use DMA due to the
large number of bytes to transmit. The CPU stops while the DMA is happening
and you don't get the overhead involved with using an ISR (except when the
transfer has completed)<br>
<br>
Joel Sherrill wrote:<br>
<blockquote type="cite" cite="mid:3CB5D70C.FE446BC5@OARcorp.com">
  <pre wrap=""><br>Pattara Kiatisevi wrote:<br></pre>
  <blockquote type="cite">
    <pre wrap="">Hi,<br><br>I have a conceptual problem while writing a device driver for sound.<br>The idea is that the write() function to this device should block until<br>all the music sent has been played. I plan to:<br><br>-have the audio core sent the interrupt when it finishes playing the music<br>to processor.<br>-in the device driver code:<br>        -write() function blocks at rtems_semaphore_obtain(x) after<br>sending all data to hardware<br>        -an interrupt service routine will call rtems_semaphore_release(x)<br>which will wake up the write() to finish<br><br>Is this scheme ok? Or RTEMS guys are usually doing something else..<br></pre>
    </blockquote>
    <pre wrap=""><!----><br>It should be OK.  Some people also use event send/receive for <br>interaction between ISRs and tasks.  The choice depends on what you<br>are controlling and what works more naturally.  <br><br>Out of curiousity, how much code, data, and bss is your application<br>taking?  I am curious how light/heavy your application is.<br><br>How much memory is required for effective buffering?  Where are your<br>sound source files stored?<br><br>So many questions.. ;)<br><br></pre>
    <blockquote type="cite">
      <pre wrap="">Thanks much,<br>Pattara<br><br>--<br>Please avoid sending me Word or PowerPoint attachments.<br>See <a class="moz-txt-link-freetext" href="http://www.fsf.org/philosophy/no-word-attachments.html">http://www.fsf.org/philosophy/no-word-attachments.html</a><br>----------------------------------------------------------------------<br>Ott Pattara Kiatisevi                              T L W G<br>M.Sc. INFOTECH Student, Stuttgart, Germany      <a class="moz-txt-link-freetext" href="http://linux.thai.net/">http://linux.thai.net/</a><br>----------------------------------------------------------------------<br></pre>
      </blockquote>
      <pre wrap=""><!----><br></pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="$mailwrapcol">-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)</pre>
      <br>
      </body>
      </html>