Category Archives: Feldman Project

Phil 6.18.13

7:30 – 1:30 SR

  • Big demo today. Went well.
  • Deployed the new RA with the fix for Version Tracker
  • Found the problem with the AS3 version of VT. Bad namespace…
  • Backups.
  • Looked into the issue with the production server where the first line is the header. Couldn’t make it occur in the dev system, so I’m thinking that the deployment may not be complete. Burned a new version for tomorrow.

1:30 – 3:30 FP

  • Added a fine-grained timer callback to the main app
  • Added an OpenGL window, set to Ortho2, and with pixel-accurate dimensions
  • Connected the timer to the OpenGL, and set the position of what will be the emitter. We won’t see this during the actual test, but it will be good for debugging.
  • I need to track mouse clicks and motion in the GL window. That will come tomorrow, and then I’ll work on integrating the audio library. That’s the basics for running the experiments. After that, I’ll work on reading and writing the input and result files.
  • Pix for today: AppProgress6.18.13

Phil 6.17.13

FA 7:30 – 12:00

  • The version checker is confused between FA and PA. Do we need a better way to determine the program name?
  • Uploading new VSS and FA
  • Need to put in a script that resets the PA milliseconds periodically until the FA fix is in.
  • Got the Flex45 utils detecting if the object is null and putting in the parent application name if that’s the case. Having issues debugging the AS3 version. Maybe namespace issues.

Phil 6.12.13

8:30 – 2:30 SR

  • Deploying new FA. Missing RA.
  • VSS scripting broke: “unable to open jython script manager – ScriptRunner.java:76”. Rolled back to the previous version from April 2013. Fixed! The jython jar file was missing. WTF!?
  • Need to know what script name is in create viz table. Nothing – it’s not used. If it returns true, the the table was created.

2:30 – 4:30 FP

  • Working on getting reacquainted with FLTK, callbacks, etc. Got some of the framework up:

FltkFramework

Phil 6.11.13

8:00 – 11:30 SR

  • Backups
  • Still no CTO_Acoustic charge number
  • Possibly add a search to the top of the “updatable drop down” widget and have the “add new” at the bottom?
  • Security Refresher Briefing

11:30 – 4:30 FP

Alright, so I now have my audio library. Next on the agenda is a test program that tests reactions of users to vibroacoustic input. The test needs to present randomized stimuli to users, so that they can be tested for:

  • Time to respond with a direction
  • Accuracy of direction
  • Efficacy of stimuli

Since this is probably going to be within subjects (multiple stimuli) and also between subjects (same tests on multiple users) we’re going to want to be able to present the same sequence, so we’ll need to seed the random number generator so we get the same sequence.

  • Start with the default random number generator, but maybe run through a wrapper class in case we need something like a Mersenne Twister.
  • Xml file to specify the input and output of the experiment. This library looks reasonable.
    • Input
      • Sounds to use (random distribution of sound use)
      • Test type (Accuracy, Speed, or both)
      • Attempts per test
      • Number of tests (must be even)
      • Random seed
      • min/max delay between test segments
      • output filename
    • Output
      • Test UID
      • Date
      • Time
      • Subject
      • Researcher
      • Free form note field (1024 characters?)
      • Accuracy or Reaction time test
      • Audio configuration
      • Random seed
      • Calibration results
        • Time(s) to click in response to visual cue
        • Time(s) to click in response to audio cue
      • For each played sound
        • Sequence x of total
        • Audio file(s) used (WAV)
        • Audio source position (x, y) in screen coordinates from the origin, where the user’s head is
        • Audio playback matrix (actual speaker relative volume)
        • Time to click after play start
        • Duration of sound
        • Click position (x, y) in screen coordinates from the origin, where the sound is perceived to have come from
  • App
    • Text
      • File navigator for xml file
    • Calibrate
      • Runs a sequence of tests where the user has to click the mouse as quickly as possible in response to the canvas flashing white, and then all(?) speakers in the headpiece playing the calibration sound
      • Calibration cues are have a randomly determined timing between X and Y seconds
      • Test is disabled until calibration is run. Loading a new xml document effectively resets the system, requiring a new calibration sequence
    • Test
      • Shows a label that says either “Accuracy” or “Speed” based on which test is being run. We could change the background of the display as well?
      • The graphics screen shows a circular cursor that resets to the center of the graphics screen at the beginning of each section. Once the audio cue plays, the user can move the mouse away from the center towards the direction of the sound. The circle is clamped in its motion so that the result is always a valid angle, as long as the user moves the cursor far enough away from the center (TBD). Clicking the mouse causes the clock to stop and the cursor to reset.
      • If this is not the last test segment, then a random time period between X and Y seconds elapses before the next test is run.
      • Once the test completes, the system checks to see if that is the last one. If not, a stochastic choice is made to determine if the next test should be speed or accuracy. By the time all tests have run, the number of speed and accuracy runs will be equal.
    • Output file is appended throughout the test (open, write, close? Or read in the DOM, update and write out?)

Started the FLTK wrapper, and probably saved a good deal of time by going back to Erco’s FLTK page and associated videos

Phil 6.10.13

8:00 – 11:00 SR

  • Status report
  • Backups
  • Still have not submitted my time sheet, waiting for CTO_Acoustic to show up in Deltek
  • Paperwork! Resume’s submitted though.

11:00 – 4:00 FP

  • Making sure that the release version of the code runs as well – it does. And a massive 19kb of executable. Of course, it’s not statically linked…
    • C/C++
      • General
        • Additional Include Directories: $(DXSDK_DIR)\Include
      • Language
        • Treat WChar_t as Built in Type: Yes (/Zc:wchar_t)
    • Linker
      • General
        • Additional Library Directories: C:\Program Files %28×86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86
      • Input
        • Additional Dependencies:
          • winmm.lib
          • dxerr.lib
          • X3DAudio.lib (only needed for DLL compilation)
  • Making library
    • Following directions here: http://msdn.microsoft.com/en-us/library/vstudio/ms235627.aspx
    • For a DLL library, you *must* select “export variables” option. Still figuring out how to use this.
    • For my first attempt in accessing the DLL, I’ve created the following method (The #defines are generated, I’ve included them for all to marvel at):
      • #ifdef DXAUDIOINTERFACEDLL_EXPORTS
        #define DXAUDIOINTERFACEDLL_API __declspec(dllexport)
        #else
        #define DXAUDIOINTERFACEDLL_API __declspec(dllimport)
        #endif
        DXAUDIOINTERFACEDLL_API BasicAudio* getBasicAudio(void);
      • I think this produces an exported method that returns a pointer to the BasicAudio class. Not sure though. It may, though now I’m getting the following link errors:
        • 1>DynamicLibConsoleTest.obj : error LNK2019: unresolved external symbol “public: void __thiscall BasicAudio::destroy(void)” (?destroy@BasicAudio@@QAEXXZ) referenced in function _wmain
        • etc…
        • 1>C:\Phil\MSVC Dev\MultichannelOr3dAudio\DxAudioInterfaceLibrary\Debug\DynamicLibConsoleTest.exe : fatal error LNK1120: 6 unresolved externals
      • Which means the public inner methods are not available. Maybe the answer is to make a wrapper class for all the methods? Ugly, but something to try..
      • Building wrapper class DXAUDIOINTERFACEDLL_API CDxAudioInterfaceDLL
      • Done. Compiles and links now, but doesn’t run. Ah. I was declaring a local pointer to the internal BasicAudio class. Not pretty, but it does seem to work…
  • Testing against Static console app – check
  • Testing against Dynamic console app – check
  • Switching to Release build
  • Testing against Static console app – check
  • Testing against Dynamic console app – check
  • Checked everything into Subversion. Calling it a day.

Phil 6.7.13

8:00 – 11:00 SR

  • Ugh.
  • rain
  • Traffic from hell. Took me over an hour to do my 20 minute commute
  • Backups
  • Query fixes.
  • All claimed items are showing up on the project page. There should be only claimed lines for that project. Unclaimed is correct though

11:00 – 4:00 FP

  • Adding comments and velocity accessors to audio code
    • Comments are done
    • Checked in project to Subversion repo, checked out and compiled. All seems to be working fine.
  • Cleaning up #includes
    • I had been getting the following annoying warning once I started including items like <unordered_map>: 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstring(21): warning C4995: ‘strcat’: name was marked as #pragma deprecated. In the cleanup, I finally got around to testing the need for includes and deleted <strsafe.h>, which seems to be the source of my grief. Yay!
  • Ready to make the audio code a library. Monday. Then time to design the experimental interface.

Phil 5.5.13

8:00 – 11:30 SR

  • Backups. Also cleaned out a bunch of Gigabytes since the server’s drive was getting full.
  • More resume stuff.
  • Some email back-and-forth with Shawn

11:30 – 4:00 FP

  • That is, unless I have to pick up part of my vehicle diaspora…
  • I’m going to add the ability to create and store a named sound within BasicAudio. Sounds really don’t need to be created outside of the instance.
  • Lunch meeting with Shawn about R&D. Good meeting with good chili to boot.
  • Got the createSound method working and cleaned up the Console app some more
int _tmain(int argc, _TCHAR* argv[])
{
	BasicAudio *ba = new BasicAudio();
	ba->init();
 
	wprintf( L"\nReady to play mono WAV PCM file(s)...\n" );
 
	WavSampleSound *singleSound = (WavSampleSound *)ba->createSound(L"music", L"Wavs\\MusicMono.wav", 0);
	WavSampleSound *continuousSound = (WavSampleSound *)ba->createSound(L"heli", L"Wavs\\heli.wav", XAUDIO2_LOOP_INFINITE);
 
	int keyIn;
	printf("Type 'x' to quit\nC start continuous\nc stop continuous\nS start single\n");
	bool doit = true;
 
	int channelIndex = -1;
	while(doit){
		if(kbhit()){
			keyIn = getch();
			channelIndex = -1;
 
			printf("key = %c\n", keyIn);
			switch(keyIn){
			case 'x' : doit = false; 
 
				break;
			case 'C' : continuousSound->start();                  // play sound
				break;
			case 'c' : continuousSound->stop();                  // cease sound
				break;
			case 'S' : singleSound->start();						// play sound
				break;
			case 'w' : 
				continuousSound->setEmitterZ(continuousSound->getEmitterZ() + (FLOAT32)0.5);
				break;
			case 's' : 
				continuousSound->setEmitterZ(continuousSound->getEmitterZ() - (FLOAT32)0.5);
				break;
			case 'a' : 
				continuousSound->setEmitterX(continuousSound->getEmitterX() - (FLOAT32)0.5);
				break;
			case 'd' : 
				continuousSound->setEmitterX(continuousSound->getEmitterX() + (FLOAT32)0.5);
				break;
			case 'p':
				ba->printMatrixCoefficients();
				break;
			case '0' : channelIndex = 0; break;
			case '1' : channelIndex = 1; break;
			case '2' : channelIndex = 2; break;
			case '3' : channelIndex = 3; break;
			case '4' : channelIndex = 4; break;
			case '5' : channelIndex = 5; break;
			case '6' : channelIndex = 6; break;
			case '7' : channelIndex = 7; break;
 
			}
			if(channelIndex == -1){
				IXAudio2SourceVoice* voice = continuousSound->getSourceVoice();
				ba->play3DVoice(continuousSound->getEmitter(), voice);
			}else{
				printf("channel = %d\n", channelIndex);
				IXAudio2SourceVoice* voice = continuousSound->getSourceVoice();
				ba->playOnChannelVoice(voice, channelIndex);
			}
		}
 
		ba->run(); // perform periodic sound engine tasks
		Sleep(100);
	}
 
	wprintf( L"\nFinished playing\n" );
 
	// All XAudio2 interfaces are released when the engine is destroyed, but being tidy
 
	ba->destroy();
 
	// printf("hit return to exit");
	// getchar();
	
	return 0;
}

Phil 6.4.13

8:00 – 11:30 SR

  • Backups and disk cleaning
  • Conversation with Lenny about how to handle COGNOS uploads
    • non MIPR/EAO are all manually claimed
    • (MIPRs and EAOs) get automatically mapped, and don’t have to go through the claiming process (budget center and Req ID match the budget line item)
    • All unclaimed should always be shown.
    • If a MIPR line item is incorrectly claimed, it can be unclaimed, at which point it will have to be manually claimed

11:30 – 4:30 FP

  • Making nice clean classes for audio
  • Emitter goes into the SampledSound base class – done. Almost easy, though I had to go and relearn how C++ constructors work. Gawd, it’s been a while…
  • Everything else goes into BasicAudio – done. Had some problems with frequency until I realized that I hadn’t zeroed out the listener velocity.
  • And actually, I need to be able to set velocity for doppler effects. Need to add methods like the position methods tomorrow.

Phil 6.3.13

8:00 – 11:00 SR

  • Backups
  • Got the paperwork to start on getting client sites hooked up to the main system
  • Bugs
    • Lenny did the following and got some kind of NULL sql error. It may have happened to Carla as well
      • Created a project
      • Added service PM on the project tab
      • saved
      • Deleted the PM from the project (first tab)
      • Added a Req on the second tab
      • Added the same (now deleted) service PM to the Req.
      • Clicked ‘update’, which threw the SQL error
      • clicked close
      • Checked the record, and everything appeared to be saved properly
      • Other req updates using the same sequence did not cause the error
    • The goal is thenter one EA line item and then link multiple req’s out of unclaimed to it. Is this possible?
    • Unclaimed needs to roll up and subtotal all lines (just with matching req’s? Not sure what to do about blanks, unless there is a way to find other matching sequences)
    • There are a heck of a lot of “UPDATE budget_center_contracts SET budget_center_id= NULL where uid = xx”. It’s probably a good 70% of the logs.

11:00 – 4:30 FP

  • Well, after two days of not being able to work on this due to Comps prep and trouble with a significant fraction of my vehicles, maybe I can get some 3D audio working today.
  • Added everything from How to: Integrate X3DAudio with XAudio2, and definitely got a result – when the emitter position moved off of center, the sound cut out. Now you might think that’s a bad thing, but my guess is that I have some variable that either being set with zero or junk, which is messing up the sound matrix calculations.
  • Using the XAudio2Sound3D project as a source of code to mine, I pulled over the (much more extensive) emitter setup and now have things working, although not as clearly as I’d like. Next is to clean up and package the code into the SampleSound-derived classes.
  • And by the way, this might be a good hard hat to try the rig on: http://www.amazon.com/ERB-19224-Americana-Full-Ratchet/dp/B001LYB7JW
  • Cleared a lot of nonessential (i.e. listening cone)code out of the emitter
  • Realized that I could probably use voice->SetOutputMatrix() to set the channels directly. I added a method that cleans out the dspSettings.matrixCoefficients and then sets a single value in the matrix. Whadaya know – it worked :-)
  • Need to do some packaging of the code, but I now have enough to do tests for the situational awareness system and to get rid of the MIDI boards for the vibrotactile controller.

Phil 5.31.13

7:30 – 10:30 SR

  • Backups – I wonder if I can have the output go through a script that counts the number of “copied” and “moved” to report if the entire script executed correctly? Have to look into that.
  • Took the projportfolio debug login out of setup.xml
  • Took care of various paperwork, including resume stuff

10:30 – 3:30 TIMEOFF

  • Arranged to get the Porsche towed. Well no, that was an adventure in itself, and basically killed the rest of the day.
  • Scheduled service for motorcycle
  • Handed in tuition paperwork

Phil 5.30.13

7:30 – 10:30 SR

  • Direct Cite/Reimbursable – separate lines
  • Comitted date changes to latest
  • Set date(s) nullable
  • Reports on Committed and Obligated dates (future)
  • Total in Proj Mgmt incorrect
  • Add “Create Project” to sub project line
  • Add “View Financial Data” to sub project line
  • Double clicking should bring up subproject
  • FACTS PE resetting to null?
  • Reset login on logout
  • Verify that “Add” subproject moves a root-level project and that Remove does the same
    • Add -> “link”
    • Remove -> “unlink”
  • Double-clicking on a subproject shouold switch the project view to the subproject
  • Add a check for no budget data so that “view data” does not hang
  • “view data” contract info should come from COGNOS pull.
  • In “Funding Status” have a TOTALS line above the main grid that totals up the columns with numbers
    • Be able to add/remove columns created by the query
    • Be able to have public/private queries

10:30 – 5:30 TIMEOFF

  • Prepping for comps meeting this evening. If I get done early, I’ll go back to XAudio

Phil 5.29.13

8:00 – 1:00 SR

  • Backups
  • There was a demo today! Was invited in towards the end to talk about data security and roles.
  • Had a good idea about how to run the PA/RA code on one of our (Dreamhost? Steadfast?) servers and let the labs input their data directly. We could then ingest the data nightly. Need to research this a bit.

1:00 – 4:00 FP

  • Finished rolling up the SampleSounds(s) into BasicAudio.
  • Starting on 3D audio, using How to: Integrate X3DAudio with XAudio2
    • Adding the 3D calls to the main() in ConsoleSound2, just after the BasicAudio class has been initialized.
    • Had to add x3daudio.lib to the project and <x3daudio.h> to the #includes.
    • This looks to be the meat of the calculation. It looks like X3DCalculate() works on the relative position of an Emitter and the Listener and uses that to populate a DSP. Once that’s done, then the Audio2 source is manipulated appropriately.
    •         X3DAudioCalculate( g_audioState.x3DInstance, &g_audioState.listener, &g_audioState.emitter, dwCalcFlags,
                                 &g_audioState.dspSettings );
      
              IXAudio2SourceVoice* voice = g_audioState.pSourceVoice;
              if( voice )
              {
                  // Apply X3DAudio generated DSP settings to XAudio2
                  voice->SetFrequencyRatio( g_audioState.dspSettings.DopplerFactor );
                  voice->SetOutputMatrix( g_audioState.pMasteringVoice, INPUTCHANNELS, g_audioState.nChannels,
                                          g_audioState.matrixCoefficients );
      
                  voice->SetOutputMatrix(g_audioState.pSubmixVoice, 1, 1, &g_audioState.dspSettings.ReverbLevel);
      
                  XAUDIO2_FILTER_PARAMETERS FilterParametersDirect = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * g_audioState.dspSettings.LPFDirectCoefficient), 1.0f }; // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here
                  voice->SetOutputFilterParameters(g_audioState.pMasteringVoice, &FilterParametersDirect);
                  XAUDIO2_FILTER_PARAMETERS FilterParametersReverb = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * g_audioState.dspSettings.LPFReverbCoefficient), 1.0f }; // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here
                  voice->SetOutputFilterParameters(g_audioState.pSubmixVoice, &FilterParametersReverb);
              }

Phil 5.28.13

8:00 – 10:30 SR

  • Backups

10:30 – 4:00 FP

  • Comments on Ravi’s proposal
  • Working on getting multi buffer support. Done! Also got repeating sound working.
  • Going to put a basic Audio class together to manage SampleSounds.

Phil 5.24.13

7:30 – 11:00 SR

  • Backups. And to make sure that it’s possible to see the results of the db backup script, I added in a “pause.exe” at the end of the batch file.
  • Deployed the new FA and RA
  • RA was taking a *long* time to start up. It turns out that the reason was that there were 17,000 alerts that were going into a DataGrid. The temporary fix was to delete the old alerts, but there needs to be a mechanism for determining/limiting what to show.

11:00 – 4:30FP

  • Building a copy of XAudio2BasicSound, cleverly calling ConsoleSound2.
  • Since it depends on SDKwavefile, I had to pull SAFE_DELETE, SAFE_DELETE_ARRAY, and SAFE_RELEASE from dxut.h. It also requires dxerr.h. but that’s in the regular directx include directory.
  • Extremely empty code right now, but it compiles and links. On a side note, the compiler should accept the environment variable $(DXSDK_DIR), but it doesn’t. And adding macros is an enormous pain, as near as I can tell.
  • The code is ported over and works. It’s all stuck in a main() right now. I need to clean up and build an Audio class. Actually, looking at the way the code is set up, a WavSampleSound class might be better. It probably could extend from a SampleSound class, but I’ll break that out later…
  • Class is mostly done and running!
  •  ConsoleSound2

Phil 5.23.13

7:30 – 10:30 SR

  • Backups, and it turns out that there was a bug with the project_portfolio_enh db, where a view that referenced tables that no longer exist was trying to be serialized. Dropping the view fixed the problem.
  • Deployed the new FA, and changed the db around a bit to accommodate. Which caused all the data to disappear from the client due to a null return of a query. Which caused us to want to restore from the backups. Which brought the backup error to light. Fortunately, it’s a test db, and very little actual work was lost.
  • Looked at the server info in Xacta, which was a new, exciting thing. It looks like our current authority to operate expires 3/25/2014. Need to keep an eye on that.
  • Meeting with the PIT crew from 7:30-8:00, which I missed due to the fact that I was uploading the new FA in preparation for the *scheduled* 8:00 meeting. Dong caught it though. He showed/described FA and RA to the team and they are actually quite happy.

10:30 – 3:30 FP.

  • More Audio3d.
  • Starting to add in the 3dAudio based on this and this and this.
  • Got an audio link error and chased that down, discovering a few things along the way.
  • There is directX help for C++ in (“C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Documentation\DirectX9\directx_sdk.chm”). I don’t know it it’s any good, but I’m going to look though it next. Note that this is DX9, not 11. I’m *hoping* that this is all up to date…
  • Pointed Configuration Properties->Linker->General->Additional Library Directories at (C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86), and added the following files to Configuration Properties->Linker->Input->additional dependencies”
    • d3d11.lib
      d3dx11.lib
      winmm.lib
      xinput.lib
      X3DAudio.lib
    • This is a change from the libraries that the demo book points at, which were dxd9 libs. Recompiled and ran the code with no problems. I did attempt to clean up the xact3dInstance pointer in ~Audio3d(), but delete[] threw an exception
  • Reading through the DX documentation, which, though it is in the DX9 folder, contains information about DX11. Whatever.
  • The documentation is kind of what you’d expect, but it let me find the tutorials and demos, which are quite nice. On my machine, the demos that I’m interested in are located here: (C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\XAudio2). It contains 4 projects:
    • XAudio2BasicSound
    • XAudioBasicStream
    • XAudio2CustomAPO
    • XAudio2Sound3D
  • Each project has source and MSVC2008 and MSVC2010 project files. I’ve just opened up the XAudio2Sound3D MSVC2010 project, and it compiled and ran just fine: XAudio2demo
  • This is almost exactly what I intend to build for the test environment, so that’s pretty cool. And using the buttons or the keyboard, I can drive the sound emitter around my head. Woohoo!
  • Next goal is to build up a copy of XAudio2BasicSound and then add the 3D components (without the graphics) from XAudio2Sound3D.