AllTestsActivity
JavaScript is disabled on your browser.
br.usp.ime.dspbenchmarking.activities
Class AllTestsActivity
- java.lang.Object
-
- Activity
-
- br.usp.ime.dspbenchmarking.activities.AllTestsActivity
-
public class AllTestsActivity extends Activity
An activity that performs all tests in a device. Tests are divided in 2 phases: Phase 1: measurement of time taken to perform common tasks (loopback, FFT, IIR filtering, etc). Phase 2: stress tests (convolution, additive synthesis, etc). During this phase, each algorithm is run with increasing complexity until the device limit is reached (i.e. until the computation period becomes bigger than the theoretical DSP period). Then, a binary search is performed to find the maximum parameter feasible for that algorithm. All tests use one DSP thread, which is subsequently suspended and resumed between tests execution. One DSP control thread is started that keeps watching the DSP thread and controls tests execution and results gathering.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description protected class
AllTestsActivity.TestControlThread
This is the thread that actually runs and controls tests.
-
Constructor Summary
Constructors Constructor and Description AllTestsActivity()
-
Method Summary
Methods Modifier and Type Method and Description private void
configLayout()
private void
finishTests(long totalTime)
Finish tests.protected java.lang.String
getDspThreadInfo()
Generates a byte array with statistics from the DSP threadprivate java.lang.String
getResultsHeader()
protected void
launchTest(DspThread.AlgorithmEnum algorithm, int blockSize, int maxDspCycles, int stressParameter)
Launch a new test by configuring and resuming the DSP thread.void
onBackPressed()
Do that ---^void
onCreate(Bundle savedInstanceState)
Executes upon creation of activity: - configure screen.protected void
releaseDspThread()
Stops and releases the DSP thread.protected void
releaseTest()
Releases a test by suspending the DSP thread.private void
sendResults(java.lang.String title)
Send tests results to email.protected void
setupTests()
Sets up everything needed to start tests: - open an input stream.protected void
startControlThread()
Start the test control thread.private void
storeResults(int algInt, int stressParam, long totalTime)
Store results from a test.protected void
updateScreenInfo(DspThread.AlgorithmEnum algorithm, int blockSize)
Update screen with test information.
-
-
-
Field Detail
-
context
Context context
-
toggleTestsButton
protected ToggleButton toggleTestsButton
-
workingBar
protected ProgressBar workingBar
-
progressBar
protected ProgressBar progressBar
-
algorithmName
protected TextView algorithmName
-
blockSizeView
protected TextView blockSizeView
-
START_BLOCK_SIZE
private final int START_BLOCK_SIZE
-
END_BLOCK_SIZE
private final int END_BLOCK_SIZE
-
MAX_DSP_CYCLES
private final int MAX_DSP_CYCLES
- See Also:
- Constant Field Values
-
results
java.lang.String results
-
inputStream
private java.io.InputStream inputStream
-
lastTotalTime
private long lastTotalTime
-
MESSAGE_ACTION
private final java.lang.String MESSAGE_ACTION
- See Also:
- Constant Field Values
-
MESSAGE_LAUNCH_TEST
private final java.lang.String MESSAGE_LAUNCH_TEST
- See Also:
- Constant Field Values
-
MESSAGE_RELEASE_TEST
private final java.lang.String MESSAGE_RELEASE_TEST
- See Also:
- Constant Field Values
-
MESSAGE_FINISH_TESTS
private final java.lang.String MESSAGE_FINISH_TESTS
- See Also:
- Constant Field Values
-
MESSAGE_STORE_RESULTS
private final java.lang.String MESSAGE_STORE_RESULTS
- See Also:
- Constant Field Values
-
MESSAGE_ALGORITHM
private final java.lang.String MESSAGE_ALGORITHM
- See Also:
- Constant Field Values
-
MESSAGE_BLOCK_SIZE
private final java.lang.String MESSAGE_BLOCK_SIZE
- See Also:
- Constant Field Values
-
MESSAGE_MAX_DSP_CYCLES
private final java.lang.String MESSAGE_MAX_DSP_CYCLES
- See Also:
- Constant Field Values
-
MESSAGE_TOTAL_TIME
private final java.lang.String MESSAGE_TOTAL_TIME
- See Also:
- Constant Field Values
-
MESSAGE_STRESS_PARAM
private final java.lang.String MESSAGE_STRESS_PARAM
- See Also:
- Constant Field Values
-
MESSAGE_RUN_TESTS
public static final java.lang.String MESSAGE_RUN_TESTS
- See Also:
- Constant Field Values
-
mt
private AllTestsActivity.TestControlThread mt
-
dt
protected DspThread dt
-
audioManager
private AudioManager audioManager
-
mHandler
Handle message from main thread. This handler receives messages from the TestControlThread and control test launch and screen update.
-
-
Method Detail
-
onCreate
public void onCreate(Bundle savedInstanceState)
Executes upon creation of activity: - configure screen. - configure tests. - start the test control thread.
-
configLayout
private void configLayout()
-
setupTests
protected void setupTests()
Sets up everything needed to start tests: - open an input stream. - configure the DSP algorithm (block size, audio source, input strea, max dsp cycles, etc). - start the DSP thread.
-
updateScreenInfo
protected void updateScreenInfo(DspThread.AlgorithmEnum algorithm, int blockSize)
Update screen with test information.
-
launchTest
protected void launchTest(DspThread.AlgorithmEnum algorithm, int blockSize, int maxDspCycles, int stressParameter)
Launch a new test by configuring and resuming the DSP thread.
-
releaseTest
protected void releaseTest()
Releases a test by suspending the DSP thread.
-
finishTests
private void finishTests(long totalTime)
Finish tests.
-
sendResults
private void sendResults(java.lang.String title)
Send tests results to email.- Parameters:
title
-
-
releaseDspThread
protected void releaseDspThread()
Stops and releases the DSP thread.
-
startControlThread
protected void startControlThread()
Start the test control thread.
-
storeResults
private void storeResults(int algInt, int stressParam, long totalTime)
Store results from a test.- Parameters:
maxFiltersize
-
-
getResultsHeader
private java.lang.String getResultsHeader()
- Returns:
- Formatted email header containing Android build info.
-
getDspThreadInfo
protected java.lang.String getDspThreadInfo()
Generates a byte array with statistics from the DSP thread- Returns:
-
onBackPressed
public void onBackPressed()
Do that ---^
-
-