Author: wmb Date: Tue Jun 21 07:24:45 2011 New Revision: 2303 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2303
Log: OLPC - more tweaking of audio analysis parameter passing, hopefully making both XO-1.5 and XO-1.75 builds work.
Modified: cpu/arm/olpc/1.75/sound.fth dev/hdaudio/conexant.fth dev/hdaudio/noiseburst.fth dev/hdaudio/test.fth
Modified: cpu/arm/olpc/1.75/sound.fth ============================================================================== --- cpu/arm/olpc/1.75/sound.fth Tue Jun 21 07:23:51 2011 (r2302) +++ cpu/arm/olpc/1.75/sound.fth Tue Jun 21 07:24:45 2011 (r2303) @@ -530,12 +530,24 @@ d# -1 constant case-test-volume d# -13 constant fixture-test-volume d# -22 constant loopback-test-volume -: configure-platform ( -- ) - board-revision h# 1a28 >= if " configure-xo1.75" $call-analyzer exit then -; + +create analysis-parameters +d# -23 , \ 0 Sample delay +d# 40 , \ 1 #fixture +d# 50 , \ 2 fixture-threshold +d# 60 , \ 3 case-start-left +d# 83 , \ 4 case-start-right +d# 400 , \ 5 case-start-quiet +d# 60 , \ 6 #case-left +d# 30 , \ 7 #case-right +d# 25 , \ 8 case-threshold-left +d# 25 , \ 9 case-threshold-right +d# 20 , \ 10 #loopback +d# 70 , \ 11 loopback-threshold
fload ${BP}/dev/hdaudio/test.fth
+ end-package
\ LICENSE_BEGIN
Modified: dev/hdaudio/conexant.fth ============================================================================== --- dev/hdaudio/conexant.fth Tue Jun 21 07:23:51 2011 (r2302) +++ dev/hdaudio/conexant.fth Tue Jun 21 07:24:45 2011 (r2303) @@ -153,7 +153,20 @@ d# -9 constant case-test-volume d# -23 constant fixture-test-volume d# -33 constant loopback-test-volume -: configure-platform ( -- ) ; + +create analysis-parameters +d# 0 , \ 0 Sample delay +d# 100 , \ 1 #fixture +d# 25 , \ 2 fixture-threshold +d# 60 , \ 3 case-start-left +d# 60 , \ 4 case-start-right +d# 400 , \ 5 case-start-quiet +d# 60 , \ 6 #case-left +d# 190 , \ 7 #case-right +d# 25 , \ 8 case-threshold-left +d# 14 , \ 9 case-threshold-right +d# 20 , \ 10 #loopback +d# 70 , \ 11 loopback-threshold
\ LICENSE_BEGIN \ Copyright (c) 2009 Luke Gorrie luke@bup.co.nz
Modified: dev/hdaudio/noiseburst.fth ============================================================================== --- dev/hdaudio/noiseburst.fth Tue Jun 21 07:23:51 2011 (r2302) +++ dev/hdaudio/noiseburst.fth Tue Jun 21 07:24:45 2011 (r2303) @@ -342,10 +342,25 @@ 3drop ( ) ;
+0 value analysis-parameters +: set-analysis-parameters ( adr -- ) to analysis-parameters ; +: param@ ( offset -- value ) analysis-parameters swap na+ @ ; +: sample-delay ( -- value ) d# 0 param@ ; +: #fixture ( -- value ) d# 1 param@ ; +: fixture-threshold ( -- value ) d# 2 param@ ; +: case-start-left ( -- value ) d# 3 param@ ; +: case-start-right ( -- value ) d# 4 param@ ; +: case-start-quiet ( -- value ) d# 5 param@ ; +: #case-left ( -- value ) d# 6 param@ ; +: #case-right ( -- value ) d# 7 param@ ; +: case-threshold-left ( -- value ) d# 8 param@ ; +: case-threshold-right ( -- value ) d# 9 param@ ; +: #loopback ( -- value ) d# 10 param@ ; +: loopback-threshold ( -- value ) d# 11 param@ ; + \ sample-delay accounts for the different timing between adc-on and dac-on \ for different combinations of codec and controller.
-d# 0 value sample-delay : +sample-delay ( start #samples -- end' start' ) swap sample-delay + swap bounds ; @@ -469,8 +484,6 @@ debug? if dup .d cr then ;
-d# 100 value #fixture -d# 25 value fixture-threshold : fixture-ratio-left ( -- error? ) left-range d# 60 #fixture sm-covar-abs-sum nip ( sum1 ) left-range d# 300 #fixture sm-covar-abs-sum nip ( sum1 sum2 ) @@ -484,14 +497,6 @@ fixture-threshold < ;
-d# 60 value case-start-left -d# 60 value case-start-right -d# 400 value case-start-quiet -d# 60 value #case-left -d# 190 value #case-right -d# 25 value case-threshold-left -d# 14 value case-threshold-right - \ This compares the total energy within the impulse response band to the \ total energy in a similar-length band : case-ratio-left ( -- error? ) @@ -507,8 +512,6 @@ case-threshold-right < ;
-d# 20 value #loopback -d# 70 value loopback-threshold \ This compares the total energy within the impulse response band to the \ total energy in a similar-length band : loopback-ratio-left ( -- error? ) @@ -524,17 +527,6 @@ loopback-threshold < ;
-\ Ideally we would not put platform-specific information in this module. -\ If we add many more platforms, this should be redesigned. -: configure-xo1.75 ( -- ) - d# -23 to sample-delay - d# 50 to fixture-threshold - d# 40 to #fixture - d# 83 to case-start-right - d# 30 to #case-right - d# 25 to case-threshold-right -; - d# 1200 constant #impulse-response #impulse-response /w* buffer: impulse-response
Modified: dev/hdaudio/test.fth ============================================================================== --- dev/hdaudio/test.fth Tue Jun 21 07:23:51 2011 (r2302) +++ dev/hdaudio/test.fth Tue Jun 21 07:24:45 2011 (r2303) @@ -185,7 +185,7 @@ ; \ Returns failure by throwing : automatic-test ( -- ) - configure-platform + analysis-parameters " set-analysis-parameters" $call-analyzer disconnect-loopback \ Not for 1.5; it can test internal while loopback is connected " smt-test?" evaluate if test-with-fixture throw
openfirmware@openfirmware.info