changeset 36:2a525e937d86

still debuging.
author Robert McIntyre <rlm@mit.edu>
date Mon, 31 Oct 2011 01:21:30 -0700
parents c969b04fa0dc
children 094a92b556a2
files divergence/results.txt divergence/with-supportEFX divergence/without-supportEFX src/com/aurellem/capture/audio/AudioSendRenderer.java src/com/aurellem/capture/examples/AdvancedAudio.java
diffstat 5 files changed, 292 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/divergence/results.txt	Mon Oct 31 00:14:46 2011 -0700
     1.2 +++ b/divergence/results.txt	Mon Oct 31 01:21:30 2011 -0700
     1.3 @@ -17,5 +17,17 @@
     1.4  same through divergence.
     1.5  
     1.6  
     1.7 +surprisingly, supporfEFX doesn't affect anything.
     1.8  
     1.9  
    1.10 +When things are off, they only appear to be off by one byte.  main
    1.11 +will be at x and aux will be at x+1 or x-1.
    1.12 +
    1.13 +Setting audioNode paramaters changes the severity of the difference
    1.14 +but not its onset.
    1.15 +
    1.16 +
    1.17 +Non-positional sound has no problems.
    1.18 +
    1.19 +
    1.20 +Divergence gets worse the longer things run.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/divergence/with-supportEFX	Mon Oct 31 01:21:30 2011 -0700
     2.3 @@ -0,0 +1,129 @@
     2.4 +OPENAL-AURELLEM: alc_init_config!!
     2.5 +creating new context via naddListener
     2.6 +--------
     2.7 +main
     2.8 +0.0
     2.9 +aux
    2.10 +0.0
    2.11 +0
    2.12 +channel -1
    2.13 +I'm playing! <3
    2.14 +--------
    2.15 +main
    2.16 +6.408789E-4
    2.17 +aux
    2.18 +6.408789E-4
    2.19 +1
    2.20 +channel 0
    2.21 +--------
    2.22 +main
    2.23 +0.0012512398
    2.24 +aux
    2.25 +0.0012512398
    2.26 +2
    2.27 +channel 0
    2.28 +--------
    2.29 +main
    2.30 +0.0018921187
    2.31 +aux
    2.32 +0.0018921187
    2.33 +3
    2.34 +channel 0
    2.35 +--------
    2.36 +main
    2.37 +0.0024719615
    2.38 +aux
    2.39 +0.0024719615
    2.40 +4
    2.41 +channel 0
    2.42 +--------
    2.43 +main
    2.44 +0.0030212863
    2.45 +aux
    2.46 +0.0030212863
    2.47 +5
    2.48 +channel 0
    2.49 +--------
    2.50 +main
    2.51 +0.003540093
    2.52 +aux
    2.53 +0.003540093
    2.54 +6
    2.55 +channel 0
    2.56 +--------
    2.57 +main
    2.58 +0.004089418
    2.59 +aux
    2.60 +0.004089418
    2.61 +7
    2.62 +channel 0
    2.63 +--------
    2.64 +main
    2.65 +0.0045471885
    2.66 +aux
    2.67 +0.0045471885
    2.68 +8
    2.69 +channel 0
    2.70 +--------
    2.71 +main
    2.72 +0.004943923
    2.73 +aux
    2.74 +0.004913405
    2.75 +inconsistency detected @ sample 16
    2.76 +main : -60
    2.77 +aux : -61
    2.78 +9
    2.79 +channel 0
    2.80 +--------
    2.81 +main
    2.82 +0.004943923
    2.83 +aux
    2.84 +0.004882887
    2.85 +inconsistency detected @ sample 0
    2.86 +main : -96
    2.87 +aux : -97
    2.88 +10
    2.89 +channel 0
    2.90 +--------
    2.91 +main
    2.92 +0.004791333
    2.93 +aux
    2.94 +0.004760815
    2.95 +inconsistency detected @ sample 0
    2.96 +main : -59
    2.97 +aux : -58
    2.98 +11
    2.99 +channel 0
   2.100 +--------
   2.101 +main
   2.102 +0.0046082246
   2.103 +aux
   2.104 +0.0045777066
   2.105 +inconsistency detected @ sample 0
   2.106 +main : -96
   2.107 +aux : -95
   2.108 +12
   2.109 +channel 0
   2.110 +--------
   2.111 +main
   2.112 +0.0046082246
   2.113 +aux
   2.114 +0.0045777066
   2.115 +inconsistency detected @ sample 0
   2.116 +main : -107
   2.117 +aux : -108
   2.118 +13
   2.119 +channel 0
   2.120 +--------
   2.121 +main
   2.122 +0.0044556344
   2.123 +aux
   2.124 +0.0044251163
   2.125 +inconsistency detected @ sample 0
   2.126 +main : -55
   2.127 +aux : -54
   2.128 +14
   2.129 +channel 0
   2.130 +AL lib: ALc.c:2463: alcCloseDevice(): destroying 1 Context(s)
   2.131 +AL lib: ALc.c:2069: alcDestroyContext(): deleting 64 Source(s)
   2.132 +AL lib: ALc.c:2471: alcCloseDevice(): deleting 1 Buffer(s)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/divergence/without-supportEFX	Mon Oct 31 01:21:30 2011 -0700
     3.3 @@ -0,0 +1,129 @@
     3.4 +OPENAL-AURELLEM: alc_init_config!!
     3.5 +creating new context via naddListener
     3.6 +--------
     3.7 +main
     3.8 +0.0
     3.9 +aux
    3.10 +0.0
    3.11 +0
    3.12 +channel -1
    3.13 +I'm playing! <3
    3.14 +--------
    3.15 +main
    3.16 +6.408789E-4
    3.17 +aux
    3.18 +6.408789E-4
    3.19 +1
    3.20 +channel 0
    3.21 +--------
    3.22 +main
    3.23 +0.0012512398
    3.24 +aux
    3.25 +0.0012512398
    3.26 +2
    3.27 +channel 0
    3.28 +--------
    3.29 +main
    3.30 +0.0018921187
    3.31 +aux
    3.32 +0.0018921187
    3.33 +3
    3.34 +channel 0
    3.35 +--------
    3.36 +main
    3.37 +0.0024719615
    3.38 +aux
    3.39 +0.0024719615
    3.40 +4
    3.41 +channel 0
    3.42 +--------
    3.43 +main
    3.44 +0.0030212863
    3.45 +aux
    3.46 +0.0030212863
    3.47 +5
    3.48 +channel 0
    3.49 +--------
    3.50 +main
    3.51 +0.003540093
    3.52 +aux
    3.53 +0.003540093
    3.54 +6
    3.55 +channel 0
    3.56 +--------
    3.57 +main
    3.58 +0.004089418
    3.59 +aux
    3.60 +0.004089418
    3.61 +7
    3.62 +channel 0
    3.63 +--------
    3.64 +main
    3.65 +0.0045471885
    3.66 +aux
    3.67 +0.0045471885
    3.68 +8
    3.69 +channel 0
    3.70 +--------
    3.71 +main
    3.72 +0.004943923
    3.73 +aux
    3.74 +0.004913405
    3.75 +inconsistency detected @ sample 16
    3.76 +main : -60
    3.77 +aux : -61
    3.78 +9
    3.79 +channel 0
    3.80 +--------
    3.81 +main
    3.82 +0.004943923
    3.83 +aux
    3.84 +0.004882887
    3.85 +inconsistency detected @ sample 0
    3.86 +main : -96
    3.87 +aux : -97
    3.88 +10
    3.89 +channel 0
    3.90 +--------
    3.91 +main
    3.92 +0.004791333
    3.93 +aux
    3.94 +0.004760815
    3.95 +inconsistency detected @ sample 0
    3.96 +main : -59
    3.97 +aux : -58
    3.98 +11
    3.99 +channel 0
   3.100 +--------
   3.101 +main
   3.102 +0.0046082246
   3.103 +aux
   3.104 +0.0045777066
   3.105 +inconsistency detected @ sample 0
   3.106 +main : -96
   3.107 +aux : -95
   3.108 +12
   3.109 +channel 0
   3.110 +--------
   3.111 +main
   3.112 +0.0046082246
   3.113 +aux
   3.114 +0.0045777066
   3.115 +inconsistency detected @ sample 0
   3.116 +main : -107
   3.117 +aux : -108
   3.118 +13
   3.119 +channel 0
   3.120 +--------
   3.121 +main
   3.122 +0.0044556344
   3.123 +aux
   3.124 +0.0044251163
   3.125 +inconsistency detected @ sample 0
   3.126 +main : -55
   3.127 +aux : -54
   3.128 +14
   3.129 +channel 0
   3.130 +AL lib: ALc.c:2463: alcCloseDevice(): destroying 1 Context(s)
   3.131 +AL lib: ALc.c:2069: alcDestroyContext(): deleting 64 Source(s)
   3.132 +AL lib: ALc.c:2471: alcCloseDevice(): deleting 1 Buffer(s)
     4.1 --- a/src/com/aurellem/capture/audio/AudioSendRenderer.java	Mon Oct 31 00:14:46 2011 -0700
     4.2 +++ b/src/com/aurellem/capture/audio/AudioSendRenderer.java	Mon Oct 31 01:21:30 2011 -0700
     4.3 @@ -173,7 +173,12 @@
     4.4  	//public final static int BYTES_PER_SAMPLE = 4;
     4.5  	private ByteBuffer buffer = BufferUtils.createByteBuffer(4096); 
     4.6  	
     4.7 +	private byte[] debug0 = new byte[4096];
     4.8 +	private byte[] debug1 = new byte[4096];
     4.9 +	
    4.10 +	
    4.11  	public void dispatchAudio(float tpf){
    4.12 +		
    4.13  		int samplesToGet = (int) (tpf * outFormat.getSampleRate());
    4.14  		try {latch.await();} 
    4.15  		catch (InterruptedException e) {e.printStackTrace();}
    4.16 @@ -183,11 +188,24 @@
    4.17  		for (int i = 0; i < this.listeners.size(); i++){		
    4.18  			buffer.clear();
    4.19  			audioSend.getSamples(buffer, samplesToGet, i);
    4.20 +			if (i == 0 ) buffer.get(debug0);
    4.21 +			if (i == 1 ) buffer.get(debug1);
    4.22  			SoundProcessor sp = 
    4.23  			this.soundProcessorMap.get(this.listeners.get(i));
    4.24  			if (null != sp){sp.process(buffer, samplesToGet*outFormat.getFrameSize(), outFormat);}
    4.25  		}
    4.26  		
    4.27 +		for (int i = 0; i < samplesToGet; i++){
    4.28 +			if (debug1[i] != debug0[i]){
    4.29 +				System.out.println("inconsistency detected @ sample " + i);
    4.30 +				System.out.println("main : " + debug0[i]);
    4.31 +				System.out.println("aux : " + debug1[i]);
    4.32 +				
    4.33 +				break;
    4.34 +			}
    4.35 +			
    4.36 +		}
    4.37 +		
    4.38  	}
    4.39  		
    4.40  	public void update(float tpf){
     5.1 --- a/src/com/aurellem/capture/examples/AdvancedAudio.java	Mon Oct 31 00:14:46 2011 -0700
     5.2 +++ b/src/com/aurellem/capture/examples/AdvancedAudio.java	Mon Oct 31 01:21:30 2011 -0700
     5.3 @@ -207,16 +207,14 @@
     5.4  	music = new AudioNode(assetManager, "Sound/Environment/pure.wav", false);
     5.5  	
     5.6      rootNode.attachChild(music);
     5.7 -    //audioRenderer.playSource(music);
     5.8 -    music.setPositional(true);
     5.9 +    audioRenderer.playSource(music);
    5.10 +    music.setPositional(false);
    5.11      music.setVolume(1f);
    5.12      music.setReverbEnabled(false);
    5.13      music.setMaxDistance(200.0f);
    5.14      music.setRefDistance(1f);
    5.15      music.setRolloffFactor(5f);
    5.16 -    
    5.17 -    
    5.18 -    //audioRenderer.pauseSource(music); 
    5.19 +    audioRenderer.pauseSource(music); 
    5.20      
    5.21    }
    5.22  
    5.23 @@ -350,7 +348,7 @@
    5.24      //listener.setLocation(loc);
    5.25      //listener.setRotation(rot);
    5.26      System.out.println(countdown);
    5.27 -    if (countdown++ == 14) { this.requestClose(false);}
    5.28 +    if (countdown++ == 400) { this.requestClose(false);}
    5.29      
    5.30      System.out.println("channel "+ music.getChannel());
    5.31      //listener.setLocation(cam.getLocation());