[openfirmware] r1582 - dev/hdaudio

svn at openfirmware.info svn at openfirmware.info
Fri Dec 11 15:34:46 CET 2009


Author: wmb
Date: 2009-12-11 15:34:46 +0100 (Fri, 11 Dec 2009)
New Revision: 1582

Modified:
   dev/hdaudio/core.fth
Log:
OLPC trac 9870 - Startup sound repeats when interrupts are disabled.


Modified: dev/hdaudio/core.fth
===================================================================
--- dev/hdaudio/core.fth	2009-12-11 13:54:04 UTC (rev 1581)
+++ dev/hdaudio/core.fth	2009-12-11 14:34:46 UTC (rev 1582)
@@ -460,6 +460,11 @@
    4 to sd#  audio-out  install-playback-alarm  true to playing?
 ;
 
+: ?end-sound  ( -- )
+   4 to #sd
+   stream-done?  if  (write-done)  false to playing?  then
+;
+
 false value stop-lock
 : stop-sound  ( -- )
    true to stop-lock
@@ -470,16 +475,16 @@
 \ Alarm handle to stop the stream when the content has been played.
 : playback-completed-alarm  ( -- )
    stop-lock  if  exit  then
-   playing?  if
-      sd#  4 to sd#                                          ( sd# )
-      stream-done?  if  (write-done)  false to playing?  then  ( sd# )
-      to sd#                                                 ( )
-   then
+   playing?  if  sd#  ?end-sound  to sd#  then
 ;
 
 ' playback-completed-alarm is playback-alarm
 
-: wait-sound  ( -- )  begin  playing?  0= until  ;
+: wait-sound  ( -- )
+   true to stop-lock
+   begin  playing?  while   d# 10 ms  ?end-sound  repeat
+   false to stop-lock
+;
 
 false value left-mute?
 false value right-mute?




More information about the openfirmware mailing list