├── Android ├── .gitignore ├── Android.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── superpowered │ │ │ └── superpoweredlatency │ │ │ ├── MainActivity.java │ │ │ └── SettingsActivity.java │ │ ├── jni │ │ ├── CMakeLists.txt │ │ ├── SuperpoweredLatency.cpp │ │ ├── latencyMeasurer.cpp │ │ └── latencyMeasurer.h │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_launcher.png │ │ └── superpowered.png │ │ ├── drawable-mdpi │ │ ├── ic_launcher.png │ │ └── superpowered.png │ │ ├── drawable-xhdpi │ │ ├── ic_launcher.png │ │ └── superpowered.png │ │ ├── drawable-xxhdpi │ │ ├── ic_launcher.png │ │ └── superpowered.png │ │ ├── layout │ │ └── activity_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── network_security_config.xml │ │ └── preferences.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── LICENSE ├── README.md └── iOS ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ ├── Contents.json │ ├── Icon-1024 1.png │ ├── Icon-1024.png │ ├── Icon-120 1.png │ ├── Icon-120.png │ ├── Icon-128.png │ ├── Icon-152.png │ ├── Icon-16.png │ ├── Icon-167.png │ ├── Icon-180.png │ ├── Icon-20.png │ ├── Icon-256 1.png │ ├── Icon-256.png │ ├── Icon-29.png │ ├── Icon-32 1.png │ ├── Icon-32.png │ ├── Icon-40 1.png │ ├── Icon-40 2.png │ ├── Icon-40.png │ ├── Icon-512 1.png │ ├── Icon-512.png │ ├── Icon-58 1.png │ ├── Icon-58.png │ ├── Icon-60.png │ ├── Icon-64.png │ ├── Icon-76.png │ ├── Icon-80 1.png │ ├── Icon-80.png │ └── Icon-87.png ├── Contents.json ├── bg.imageset │ ├── Contents.json │ ├── wave-1.svg │ ├── wave-2.svg │ └── wave.svg └── superpoweredLogo.imageset │ ├── Contents.json │ ├── superpowered-black-1.svg │ ├── superpowered-black-2.svg │ └── superpowered-black.svg ├── Images.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist ├── Main.storyboard ├── SuperpoweredLatency.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── SuperpoweredLatency.xccheckout │ └── xcuserdata │ │ ├── gaborszanto.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── szantog.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── gaborszanto.xcuserdatad │ └── xcschemes │ │ ├── SuperpoweredLatency.xcscheme │ │ └── xcschememanagement.plist │ └── szantog.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SuperpoweredLatency.xcscheme │ └── xcschememanagement.plist ├── ViewController.h ├── ViewController.mm ├── machines.h ├── main.m ├── superpowered.png ├── superpowered@2x.png └── superpowered@3x.png /Android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /Android/Android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Android/app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /Android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 33 5 | 6 | defaultConfig { 7 | applicationId "com.superpowered.superpoweredlatency" 8 | minSdkVersion 19 9 | targetSdkVersion 33 10 | versionCode 5 11 | versionName "1.9.1" 12 | 13 | ndk { // these platforms cover 99% percent of all Android devices 14 | abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' 15 | } 16 | 17 | externalNativeBuild { 18 | cmake { 19 | arguments '-DANDROID_PLATFORM=android-26', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_ARM_NEON=TRUE', '-DANDROID_STL=c++_shared' 20 | cFlags '-O3', '-fsigned-char' // full optimization, char data type is signed 21 | cppFlags '-fsigned-char' 22 | } 23 | } 24 | } 25 | 26 | externalNativeBuild { 27 | cmake { 28 | path 'src/main/jni/CMakeLists.txt' 29 | } 30 | } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | api 'com.android.support:appcompat-v7:27.1.1' 36 | } 37 | -------------------------------------------------------------------------------- /Android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /Android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/superpowered/superpoweredlatency/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.superpowered.superpoweredlatency; 2 | 3 | import android.Manifest; 4 | import android.content.BroadcastReceiver; 5 | import android.content.pm.PackageManager; 6 | import android.preference.PreferenceManager; 7 | import android.support.v4.app.ActivityCompat; 8 | import android.support.v4.content.ContextCompat; 9 | import android.os.Bundle; 10 | import android.support.v7.app.AppCompatActivity; 11 | import android.support.annotation.NonNull; 12 | import android.util.Base64; 13 | import android.view.Menu; 14 | import android.view.MenuItem; 15 | import android.media.AudioManager; 16 | import android.os.Build; 17 | import android.content.Context; 18 | import android.view.View; 19 | import android.widget.ProgressBar; 20 | import android.widget.RelativeLayout; 21 | import android.widget.TextView; 22 | import android.widget.Toast; 23 | import android.os.Handler; 24 | import android.net.Uri; 25 | import android.os.AsyncTask; 26 | 27 | import java.net.HttpURLConnection; 28 | import java.net.URL; 29 | import java.io.InputStream; 30 | import java.io.InputStreamReader; 31 | import java.io.IOException; 32 | import android.content.Intent; 33 | import android.content.IntentFilter; 34 | 35 | public class MainActivity extends AppCompatActivity { 36 | TextView button = null; 37 | TextView infoView = null; 38 | TextView status = null; 39 | TextView network = null; 40 | TextView website = null; 41 | RelativeLayout statusView = null; 42 | RelativeLayout resultsView = null; 43 | ProgressBar progress = null; 44 | int measurerState = -1000; 45 | private Handler handler; 46 | private boolean headphoneSocket = false; 47 | private boolean proAudioFlag = false; 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | 53 | boolean didAskForPermissions = false; 54 | 55 | if (Build.VERSION.SDK_INT >= 23) { // Need to ask for permissions. 56 | String[] permissions = { 57 | Manifest.permission.RECORD_AUDIO, 58 | Manifest.permission.MODIFY_AUDIO_SETTINGS, 59 | Manifest.permission.INTERNET, 60 | }; 61 | 62 | for (String s:permissions) if (ContextCompat.checkSelfPermission(this, s) != PackageManager.PERMISSION_GRANTED) { 63 | didAskForPermissions = true; 64 | ActivityCompat.requestPermissions(this, permissions, 0); 65 | break; 66 | } 67 | } 68 | 69 | if (!didAskForPermissions) initialize(); 70 | } 71 | 72 | @Override 73 | public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { 74 | if ((requestCode != 0) || (grantResults.length < 1) || (grantResults.length != permissions.length)) return; 75 | boolean canInitialize = true; 76 | for (int grantResult:grantResults) if (grantResult != PackageManager.PERMISSION_GRANTED) { 77 | canInitialize = false; 78 | Toast.makeText(getApplicationContext(), "Please allow all permissions for the Latency Test app.", Toast.LENGTH_LONG).show(); 79 | } 80 | if (canInitialize) initialize(); 81 | } 82 | 83 | private void initialize() { 84 | setContentView(R.layout.activity_main); 85 | 86 | // Set up UI and display system information. 87 | try { 88 | TextView title = findViewById(R.id.header); 89 | title.setText("Superpowered Latency Test v" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName); 90 | } catch (PackageManager.NameNotFoundException e) { 91 | e.printStackTrace(); 92 | } 93 | 94 | TextView model = findViewById(R.id.model); 95 | model.setText(Build.MANUFACTURER + " " + Build.MODEL); 96 | TextView os = findViewById(R.id.os); 97 | os.setText("Android " + Build.VERSION.RELEASE + " " + Build.ID); 98 | 99 | button = findViewById(R.id.button); 100 | infoView = findViewById(R.id.infoview); 101 | statusView = findViewById(R.id.statusview); 102 | resultsView = findViewById(R.id.resultsview); 103 | status = findViewById(R.id.status); 104 | network = findViewById(R.id.network); 105 | progress = findViewById(R.id.progress); 106 | website = findViewById(R.id.website); 107 | 108 | if (Build.VERSION.SDK_INT >= 21) { // Check if there is something in the headphone socket. 109 | IntentFilter filter = new IntentFilter(Intent.ACTION_HEADSET_PLUG); 110 | registerReceiver(new BroadcastReceiver() { 111 | @Override 112 | public void onReceive(Context context, Intent intent) { 113 | if (intent.getAction().equals(Intent.ACTION_HEADSET_PLUG)) { 114 | int state = intent.getIntExtra("state", -1); 115 | headphoneSocket = (state > 0); 116 | } 117 | } 118 | }, filter); 119 | } 120 | 121 | if (Build.VERSION.SDK_INT >= 23) { // Check for the pro audio flag. 122 | proAudioFlag = getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUDIO_PRO); 123 | } 124 | 125 | // Two native libs are built from the same code, one with and one without AAudio. 126 | try { 127 | System.loadLibrary("WithAAudio"); 128 | } catch (UnsatisfiedLinkError e) { // If AAudio is not present, use the other one without it. 129 | System.loadLibrary("WithoutAAudio"); 130 | } 131 | 132 | // Get the device's sample rate and buffer size to enable low-latency Android audio output, if available. 133 | AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE); 134 | String samplerateString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE); 135 | String buffersizeString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER); 136 | if (samplerateString == null) samplerateString = "48000"; 137 | if (buffersizeString == null) buffersizeString = "960"; 138 | 139 | // Call the native lib to set up. 140 | SuperpoweredLatency(Integer.parseInt(samplerateString), Integer.parseInt(buffersizeString)); 141 | 142 | // Update UI every 40 ms until UI_update returns with false. 143 | Runnable runnable = new Runnable() { 144 | @Override 145 | public void run() { 146 | if (UI_update()) handler.postDelayed(this, 40); 147 | } 148 | }; 149 | handler = new Handler(); 150 | handler.postDelayed(runnable, 40); 151 | } 152 | 153 | // Encodes safe strings for network transfer. 154 | public String encodeString(String str) { 155 | return Base64.encodeToString(str.getBytes(), Base64.DEFAULT); 156 | } 157 | 158 | // Called periodically to update the UI. 159 | public boolean UI_update() { 160 | // Get the current state and latency values. 161 | long _state = getState(); 162 | long _latencyMs = getLatencyMs(); 163 | 164 | // Update the UI if the measurer's state has been changed. 165 | if ((measurerState != _state) || (_latencyMs < 0)) { 166 | measurerState = (int)_state; 167 | 168 | // Idle state. 169 | if (measurerState == 0) { 170 | infoView.setVisibility(View.VISIBLE); 171 | resultsView.setVisibility(View.INVISIBLE); 172 | statusView.setVisibility(View.INVISIBLE); 173 | button.setText("Start Latency Test"); 174 | 175 | // Result or error. 176 | } else if (measurerState > 10) { 177 | if (_latencyMs == 0) { 178 | status.setText("Dispersion too big, please try again."); 179 | button.setText("Restart Test"); 180 | toggleMeasurer(false); // Stopping the measurer. 181 | } else { 182 | infoView.setVisibility(View.INVISIBLE); 183 | resultsView.setVisibility(View.VISIBLE); 184 | statusView.setVisibility(View.INVISIBLE); 185 | website.setVisibility(View.INVISIBLE); 186 | 187 | long samplerate = getSamplerate(); 188 | long buffersize = getBuffersize(); 189 | boolean aaudio = getAAudio(); 190 | 191 | ((TextView)findViewById(R.id.latency)).setText(_latencyMs + " ms"); 192 | ((TextView)findViewById(R.id.buffersize)).setText(Long.toString(buffersize)); 193 | ((TextView)findViewById(R.id.samplerate)).setText(samplerate + " Hz"); 194 | ((TextView)findViewById(R.id.api)).setText(aaudio ? "AAudio" : "OpenSL ES"); 195 | button.setText("Share Results"); 196 | 197 | if (PreferenceManager.getDefaultSharedPreferences(getBaseContext()).getBoolean("submit", true)) { 198 | // Uploading the result to our server. Results with native buffer sizes are reported only. 199 | network.setText("Uploading data..."); 200 | String url = Uri.parse("http://superpowered.com/latencydata/input.php?ms=" + _latencyMs + "&samplerate=" + samplerate + "&buffersize=" + buffersize + "&sapa=0&headphone=" + (headphoneSocket ? 1 : 0) + "&proaudio=" + (proAudioFlag ? 1 : 0) + "&aaudio=" + (aaudio ? 1 : 0)) 201 | .buildUpon() 202 | .appendQueryParameter("model", encodeString(Build.MANUFACTURER + " " + Build.MODEL)) 203 | .appendQueryParameter("os", encodeString(Build.VERSION.RELEASE)) 204 | .appendQueryParameter("build", encodeString(Build.VERSION.INCREMENTAL)) 205 | .appendQueryParameter("buildid", encodeString(Build.ID)) 206 | .build().toString(); 207 | new HTTPGetTask().execute(url); 208 | } else { 209 | network.setText(""); 210 | website.setVisibility(View.VISIBLE); 211 | } 212 | 213 | toggleMeasurer(false); // Stopping the measurer. 214 | return false; // Stopping periodical UI updates. 215 | } 216 | 217 | // Measurement starts. 218 | } else if (measurerState == 1) { 219 | statusView.setVisibility(View.VISIBLE); 220 | resultsView.setVisibility(View.INVISIBLE); 221 | infoView.setVisibility(View.INVISIBLE); 222 | status.setText("? ms"); 223 | progress.setProgress(0); 224 | button.setText("Cancel"); 225 | 226 | // Measurement in progress. 227 | } else { 228 | if (_latencyMs < 0) status.setText("The environment is too loud!"); 229 | else { 230 | status.setText(_latencyMs + " ms"); 231 | progress.setProgress((measurerState - 1) * 10); 232 | } 233 | } 234 | } 235 | return true; 236 | } 237 | 238 | // When the user taps on the main button. 239 | public void onButton(View _button) { 240 | if (resultsView.getVisibility() == View.VISIBLE) { // Sharing results - let's hope this creates a small viral loop for us. :-) 241 | String model = ((TextView)findViewById(R.id.model)).getText().toString(); 242 | if (model.length() > 40) model = model.substring(0, 40); 243 | String message = "I just tested my " + model + " with the Superpowered Latency Test App: " + ((TextView)findViewById(R.id.latency)).getText() + "\r\n\r\nhttp://superpowered.com/latency"; 244 | Intent share = new Intent(Intent.ACTION_SEND); 245 | share.setType("text/plain"); 246 | share.putExtra(Intent.EXTRA_TEXT, message); 247 | startActivity(Intent.createChooser(share, "Share Results")); 248 | } else { 249 | toggleMeasurer(PreferenceManager.getDefaultSharedPreferences(getBaseContext()).getBoolean("aaudio", false)); 250 | long state = getState(); 251 | button.setText(state > 0 ? "Cancel" : "Start Latency Test"); 252 | } 253 | } 254 | 255 | public void onLatency(View _view) { 256 | Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://superpowered.com/latency")); 257 | startActivity(browserIntent); 258 | } 259 | 260 | public void onSuperpowered(View _view) { 261 | Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://superpowered.com/")); 262 | startActivity(browserIntent); 263 | } 264 | 265 | @Override 266 | public boolean onCreateOptionsMenu(Menu menu) { 267 | getMenuInflater().inflate(R.menu.menu_main, menu); 268 | return true; 269 | } 270 | 271 | @Override 272 | public boolean onOptionsItemSelected(MenuItem item) { 273 | return super.onOptionsItemSelected(item); 274 | } 275 | 276 | public void onSettings(View _view) { 277 | Intent settingsIntent = new Intent(this, SettingsActivity.class); 278 | startActivity(settingsIntent); 279 | } 280 | 281 | private native void SuperpoweredLatency(long samplerate, long buffersize); 282 | private native void toggleMeasurer(boolean useAAudioIfAvailable); 283 | private native int getState(); 284 | private native int getLatencyMs(); 285 | private native int getSamplerate(); 286 | private native int getBuffersize(); 287 | private native boolean getAAudio(); 288 | 289 | // This performs the data upload to our server. 290 | private class HTTPGetTask extends AsyncTask { 291 | protected Boolean doInBackground(String... param) { 292 | boolean okay = false; 293 | try { 294 | URL url = new URL(param[0]); 295 | HttpURLConnection connection = (HttpURLConnection)url.openConnection(); 296 | connection.setRequestMethod("GET"); 297 | connection.setRequestProperty("Cache-Control", "no-cache"); 298 | connection.setConnectTimeout(30000); 299 | connection.setReadTimeout(60000); 300 | try { 301 | InputStream in = connection.getInputStream(); 302 | InputStreamReader reader = new InputStreamReader(in); 303 | for (int bytesRead = 0; bytesRead < 5; bytesRead++) if (reader.read() < 0) { 304 | if (bytesRead == 2) okay = true; 305 | break; 306 | } 307 | } catch(Exception e) { 308 | e.printStackTrace(); 309 | } finally { 310 | connection.disconnect(); 311 | } 312 | } catch (IOException e) { 313 | e.printStackTrace(); 314 | return false; 315 | } 316 | return okay; 317 | } 318 | 319 | @Override 320 | protected void onPostExecute(Boolean result) { 321 | if (result) { 322 | network.setText("Thank you. We've uploaded the result to the latency benchmarking at:"); 323 | website.setVisibility(View.VISIBLE); 324 | } else network.setText("Network error."); 325 | } 326 | } 327 | } 328 | -------------------------------------------------------------------------------- /Android/app/src/main/java/com/superpowered/superpoweredlatency/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.superpowered.superpoweredlatency; 2 | 3 | import android.preference.PreferenceActivity; 4 | import android.os.Bundle; 5 | import android.preference.PreferenceFragment; 6 | 7 | public class SettingsActivity extends PreferenceActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit(); 12 | } 13 | 14 | public static class SettingsFragment extends PreferenceFragment { 15 | @Override 16 | public void onCreate(final Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | addPreferencesFromResource(R.xml.preferences); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | set( 4 | CACHE STRING "" 5 | ) 6 | 7 | file(GLOB CPP_FILES "*.cpp") 8 | 9 | # Building two native libs from the same code, one with and one without AAudio. 10 | 11 | add_library( 12 | WithoutAAudio 13 | SHARED 14 | ${CPP_FILES} 15 | ) 16 | 17 | add_library( 18 | WithAAudio 19 | SHARED 20 | ${CPP_FILES} 21 | ) 22 | 23 | include_directories(src/main/jni) 24 | 25 | target_compile_definitions(WithoutAAudio PUBLIC HAS_AAUDIO=0) 26 | 27 | target_link_libraries( 28 | WithoutAAudio 29 | log 30 | android 31 | OpenSLES 32 | ) 33 | 34 | target_compile_definitions(WithAAudio PUBLIC HAS_AAUDIO=1) 35 | 36 | target_link_libraries( 37 | WithAAudio 38 | log 39 | android 40 | OpenSLES 41 | aaudio 42 | ) 43 | -------------------------------------------------------------------------------- /Android/app/src/main/jni/SuperpoweredLatency.cpp: -------------------------------------------------------------------------------- 1 | #include "latencyMeasurer.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #if HAS_AAUDIO == 1 10 | #include 11 | #endif 12 | 13 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "superpoweredlatency", __VA_ARGS__) 14 | 15 | static int samplerate; 16 | static int buffersize; 17 | static latencyMeasurer *measurer; 18 | static bool hasAAudio = false; 19 | static bool isRunning = false; 20 | 21 | // --------- 22 | // OPENSL ES 23 | // --------- 24 | 25 | #define NUMOPENSLESBUFFERS 128 26 | static struct { 27 | SLObjectItf engine, outputMix, outputBufferQueue, inputBufferQueue; 28 | SLAndroidSimpleBufferQueueItf outputBufferQueueInterface, inputBufferQueueInterface; 29 | short int *inputBuffers[NUMOPENSLESBUFFERS], *outputBuffers[NUMOPENSLESBUFFERS]; 30 | int samplerateFromJava, buffersizeFromJava, inputBufferWriteIndex, inputBufferReadIndex, inputBuffersAvailable, outputBufferWriteIndex; 31 | } openSLES; 32 | 33 | // Audio input comes here. 34 | static void openSLESInputCallback(SLAndroidSimpleBufferQueueItf caller, __unused void *pContext) { 35 | __sync_fetch_and_add(&openSLES.inputBuffersAvailable, 1); 36 | short int *inputBuffer = openSLES.inputBuffers[openSLES.inputBufferWriteIndex]; 37 | if (openSLES.inputBufferWriteIndex < NUMOPENSLESBUFFERS - 1) openSLES.inputBufferWriteIndex++; else openSLES.inputBufferWriteIndex = 0; 38 | (*caller)->Enqueue(caller, inputBuffer, (SLuint32)buffersize * 4); 39 | } 40 | 41 | // Audio output must be provided here. 42 | static void openSLESOutputCallback(SLAndroidSimpleBufferQueueItf caller, __unused void *pContext) { 43 | short int *outputBuffer = openSLES.outputBuffers[openSLES.outputBufferWriteIndex]; 44 | if (openSLES.outputBufferWriteIndex < NUMOPENSLESBUFFERS - 1) openSLES.outputBufferWriteIndex++; else openSLES.outputBufferWriteIndex = 0; 45 | 46 | if (__sync_fetch_and_add(&openSLES.inputBuffersAvailable, 0) > 0) { 47 | __sync_fetch_and_add(&openSLES.inputBuffersAvailable, -1); 48 | short int *inputBuffer = openSLES.inputBuffers[openSLES.inputBufferReadIndex]; 49 | if (openSLES.inputBufferReadIndex < NUMOPENSLESBUFFERS - 1) openSLES.inputBufferReadIndex++; else openSLES.inputBufferReadIndex = 0; 50 | 51 | measurer->processInput(inputBuffer, samplerate, buffersize); 52 | measurer->processOutput(outputBuffer); 53 | if (measurer->state == -1) memcpy(outputBuffer, inputBuffer, (size_t)buffersize * 4); 54 | } else memset(outputBuffer, 0, (size_t)buffersize * 4); 55 | 56 | (*caller)->Enqueue(caller, outputBuffer, (SLuint32)buffersize * 4); 57 | } 58 | 59 | static void startOpenSLES() { 60 | hasAAudio = false; 61 | samplerate = openSLES.samplerateFromJava; 62 | buffersize = openSLES.buffersizeFromJava; 63 | 64 | openSLES.inputBufferWriteIndex = 1; // Start from 1, because we enqueue one buffer when we start the input buffer queue. 65 | openSLES.inputBufferReadIndex = 0; 66 | openSLES.inputBuffersAvailable = 0; 67 | openSLES.outputBufferWriteIndex = 1; // Start from 1, because we enqueue one buffer when we start the output buffer queue. 68 | 69 | // Allocating audio buffers for input and output. 70 | for (int n = 0; n < NUMOPENSLESBUFFERS; n++) { 71 | openSLES.inputBuffers[n] = (short int *)malloc(((size_t)buffersize + 16) * 4); 72 | openSLES.outputBuffers[n] = (short int *)malloc(((size_t)buffersize + 16) * 4); 73 | memset(openSLES.inputBuffers[n], 0, (size_t)buffersize * 4); 74 | memset(openSLES.outputBuffers[n], 0, (size_t)buffersize * 4); 75 | }; 76 | 77 | const SLboolean requireds[2] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_FALSE }; 78 | 79 | // Create the OpenSL ES engine. 80 | slCreateEngine(&openSLES.engine, 0, NULL, 0, NULL, NULL); 81 | (*openSLES.engine)->Realize(openSLES.engine, SL_BOOLEAN_FALSE); 82 | SLEngineItf openSLEngineInterface = NULL; 83 | (*openSLES.engine)->GetInterface(openSLES.engine, SL_IID_ENGINE, &openSLEngineInterface); 84 | // Create the output mix. 85 | (*openSLEngineInterface)->CreateOutputMix(openSLEngineInterface, &openSLES.outputMix, 0, NULL, NULL); 86 | (*openSLES.outputMix)->Realize(openSLES.outputMix, SL_BOOLEAN_FALSE); 87 | SLDataLocator_OutputMix outputMixLocator = { SL_DATALOCATOR_OUTPUTMIX, openSLES.outputMix }; 88 | 89 | // Create the output buffer queue. 90 | SLDataLocator_AndroidSimpleBufferQueue outputLocator = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 1 }; 91 | SLDataFormat_PCM outputFormat = { SL_DATAFORMAT_PCM, 2, (SLuint32)samplerate * 1000, SL_PCMSAMPLEFORMAT_FIXED_16, SL_PCMSAMPLEFORMAT_FIXED_16, SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT, SL_BYTEORDER_LITTLEENDIAN }; 92 | SLDataSource outputSource = { &outputLocator, &outputFormat }; 93 | const SLInterfaceID outputInterfaces[1] = { SL_IID_BUFFERQUEUE }; 94 | SLDataSink outputSink = { &outputMixLocator, NULL }; 95 | (*openSLEngineInterface)->CreateAudioPlayer(openSLEngineInterface, &openSLES.outputBufferQueue, &outputSource, &outputSink, 1, outputInterfaces, requireds); 96 | (*openSLES.outputBufferQueue)->Realize(openSLES.outputBufferQueue, SL_BOOLEAN_FALSE); 97 | 98 | // Create the input buffer queue. 99 | SLDataLocator_IODevice deviceInputLocator = { SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, SL_DEFAULTDEVICEID_AUDIOINPUT, NULL }; 100 | SLDataSource inputSource = { &deviceInputLocator, NULL }; 101 | SLDataLocator_AndroidSimpleBufferQueue inputLocator = { SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 1 }; 102 | SLDataFormat_PCM inputFormat = { SL_DATAFORMAT_PCM, 2, (SLuint32)samplerate * 1000, SL_PCMSAMPLEFORMAT_FIXED_16, SL_PCMSAMPLEFORMAT_FIXED_16, SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT, SL_BYTEORDER_LITTLEENDIAN }; 103 | SLDataSink inputSink = { &inputLocator, &inputFormat }; 104 | const SLInterfaceID inputInterfaces[2] = { SL_IID_ANDROIDSIMPLEBUFFERQUEUE, SL_IID_ANDROIDCONFIGURATION }; 105 | (*openSLEngineInterface)->CreateAudioRecorder(openSLEngineInterface, &openSLES.inputBufferQueue, &inputSource, &inputSink, 2, inputInterfaces, requireds); 106 | 107 | // Configure the voice recognition preset which has no signal processing for lower latency. 108 | SLAndroidConfigurationItf inputConfiguration; 109 | if ((*openSLES.inputBufferQueue)->GetInterface(openSLES.inputBufferQueue, SL_IID_ANDROIDCONFIGURATION, &inputConfiguration) == SL_RESULT_SUCCESS) { 110 | SLuint32 presetValue = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION; 111 | (*inputConfiguration)->SetConfiguration(inputConfiguration, SL_ANDROID_KEY_RECORDING_PRESET, &presetValue, sizeof(SLuint32)); 112 | }; 113 | (*openSLES.inputBufferQueue)->Realize(openSLES.inputBufferQueue, SL_BOOLEAN_FALSE); 114 | 115 | // Initialize and start the output buffer queue. 116 | (*openSLES.outputBufferQueue)->GetInterface(openSLES.outputBufferQueue, SL_IID_BUFFERQUEUE, &openSLES.outputBufferQueueInterface); 117 | (*openSLES.outputBufferQueueInterface)->RegisterCallback(openSLES.outputBufferQueueInterface, openSLESOutputCallback, NULL); 118 | (*openSLES.outputBufferQueueInterface)->Enqueue(openSLES.outputBufferQueueInterface, openSLES.outputBuffers[0], (SLuint32)buffersize * 4); 119 | SLPlayItf outputPlayInterface; 120 | (*openSLES.outputBufferQueue)->GetInterface(openSLES.outputBufferQueue, SL_IID_PLAY, &outputPlayInterface); 121 | (*outputPlayInterface)->SetPlayState(outputPlayInterface, SL_PLAYSTATE_PLAYING); 122 | 123 | // Initialize and start the input buffer queue. 124 | (*openSLES.inputBufferQueue)->GetInterface(openSLES.inputBufferQueue, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &openSLES.inputBufferQueueInterface); 125 | (*openSLES.inputBufferQueueInterface)->RegisterCallback(openSLES.inputBufferQueueInterface, openSLESInputCallback, NULL); 126 | SLRecordItf recordInterface; 127 | (*openSLES.inputBufferQueue)->GetInterface(openSLES.inputBufferQueue, SL_IID_RECORD, &recordInterface); 128 | (*openSLES.inputBufferQueueInterface)->Enqueue(openSLES.inputBufferQueueInterface, openSLES.inputBuffers[0], (SLuint32)buffersize * 4); 129 | (*recordInterface)->SetRecordState(recordInterface, SL_RECORDSTATE_RECORDING); 130 | } 131 | 132 | static void stopOpenSLES() { 133 | SLRecordItf recordInterface; 134 | (*openSLES.inputBufferQueue)->GetInterface(openSLES.inputBufferQueue, SL_IID_RECORD, &recordInterface); 135 | (*recordInterface)->SetRecordState(recordInterface, SL_RECORDSTATE_STOPPED); 136 | 137 | SLPlayItf outputPlayInterface; 138 | (*openSLES.outputBufferQueue)->GetInterface(openSLES.outputBufferQueue, SL_IID_PLAY, &outputPlayInterface); 139 | (*outputPlayInterface)->SetPlayState(outputPlayInterface, SL_PLAYSTATE_STOPPED); 140 | 141 | usleep(200000); 142 | 143 | (*openSLES.outputBufferQueue)->Destroy(openSLES.outputBufferQueue); 144 | (*openSLES.inputBufferQueue)->Destroy(openSLES.inputBufferQueue); 145 | (*openSLES.outputMix)->Destroy(openSLES.outputMix); 146 | (*openSLES.engine)->Destroy(openSLES.engine); 147 | 148 | for (int n = 0; n < NUMOPENSLESBUFFERS; n++) { 149 | free(openSLES.inputBuffers[n]); 150 | free(openSLES.outputBuffers[n]); 151 | } 152 | } 153 | 154 | #if HAS_AAUDIO == 1 155 | // ------ 156 | // AAudio 157 | // ------ 158 | 159 | static struct { 160 | AAudioStream *outputStream; 161 | AAudioStream *inputStream; 162 | bool firstAAudioInput, restarting; 163 | } aaudio; 164 | 165 | aaudio_data_callback_result_t aaudioProcessingCallback(__unused AAudioStream *stream, __unused void *userData, void *audioData, int32_t numFrames) { 166 | // Drain excess samples in input the first time. 167 | if (aaudio.firstAAudioInput) { 168 | aaudio.firstAAudioInput = false; 169 | aaudio_result_t drainedFrames = 0; 170 | do { 171 | drainedFrames = AAudioStream_read(aaudio.inputStream, audioData, numFrames, 0); 172 | } while (drainedFrames > 0); 173 | } 174 | 175 | if (numFrames > buffersize) buffersize = numFrames; 176 | 177 | aaudio_result_t frameCount = AAudioStream_read(aaudio.inputStream, audioData, numFrames, 0); // Read input. 178 | 179 | if (frameCount > 0) { // Has input. 180 | short int *audio = (short int *)audioData; 181 | measurer->processInput(audio, samplerate, frameCount); 182 | measurer->processOutput(audio); 183 | 184 | // If the input frames are less than the output frames. Should not happen. 185 | if (frameCount < numFrames) memset(audio + frameCount * 2, 0, size_t(numFrames - frameCount) * 4); 186 | } else memset(audioData, 0, (size_t)numFrames * 4); // No input, return with silence. 187 | 188 | return AAUDIO_CALLBACK_RESULT_CONTINUE; 189 | } 190 | 191 | static void *restartAAudioThread(__unused void *param); 192 | 193 | static void AAudioErrorCallback(AAudioStream *stream, __unused void *userData, aaudio_result_t error) { 194 | LOGI("%s aaudio stream error: %s", (AAudioStream_getDirection(stream) == AAUDIO_DIRECTION_OUTPUT) ? "output" : "input", AAudio_convertResultToText(error)); 195 | 196 | if (AAudioStream_getState(stream) == AAUDIO_STREAM_STATE_DISCONNECTED) { // If the audio routing has been changed, restart audio I/O. 197 | if (aaudio.restarting) LOGI("Restarting already."); 198 | else { 199 | aaudio.restarting = true; 200 | pthread_t thread; 201 | pthread_create(&thread, NULL, restartAAudioThread, NULL); 202 | } 203 | } 204 | } 205 | 206 | static bool startAAudio() { 207 | hasAAudio = false; 208 | aaudio.firstAAudioInput = true; 209 | aaudio.inputStream = NULL; 210 | aaudio.outputStream = NULL; 211 | 212 | // Setup output. 213 | AAudioStreamBuilder *outputStreamBuilder; 214 | if (AAudio_createStreamBuilder(&outputStreamBuilder) != AAUDIO_OK) return false; 215 | 216 | AAudioStreamBuilder_setDirection(outputStreamBuilder, AAUDIO_DIRECTION_OUTPUT); 217 | AAudioStreamBuilder_setFormat(outputStreamBuilder, AAUDIO_FORMAT_PCM_I16); 218 | AAudioStreamBuilder_setChannelCount(outputStreamBuilder, 2); 219 | AAudioStreamBuilder_setSharingMode(outputStreamBuilder, AAUDIO_SHARING_MODE_EXCLUSIVE); 220 | AAudioStreamBuilder_setPerformanceMode(outputStreamBuilder, AAUDIO_PERFORMANCE_MODE_LOW_LATENCY); 221 | AAudioStreamBuilder_setErrorCallback(outputStreamBuilder, AAudioErrorCallback, NULL); 222 | AAudioStreamBuilder_setDataCallback(outputStreamBuilder, aaudioProcessingCallback, NULL); 223 | 224 | if ((AAudioStreamBuilder_openStream(outputStreamBuilder, &aaudio.outputStream) == AAUDIO_OK) && (aaudio.outputStream != NULL)) { 225 | samplerate = AAudioStream_getSampleRate(aaudio.outputStream); 226 | AAudioStream_setBufferSizeInFrames(aaudio.outputStream, AAudioStream_getFramesPerBurst(aaudio.outputStream)); 227 | buffersize = AAudioStream_getBufferSizeInFrames(aaudio.outputStream); 228 | } else { 229 | AAudioStreamBuilder_delete(outputStreamBuilder); 230 | return false; 231 | } 232 | 233 | // Setup input. 234 | AAudioStreamBuilder *inputStreamBuilder; 235 | if (AAudio_createStreamBuilder(&inputStreamBuilder) != AAUDIO_OK) { 236 | AAudioStreamBuilder_delete(outputStreamBuilder); 237 | AAudioStream_close(aaudio.outputStream); 238 | return false; 239 | } 240 | 241 | AAudioStreamBuilder_setDirection(inputStreamBuilder, AAUDIO_DIRECTION_INPUT); 242 | AAudioStreamBuilder_setFormat(inputStreamBuilder, AAUDIO_FORMAT_PCM_I16); 243 | AAudioStreamBuilder_setChannelCount(inputStreamBuilder, 2); 244 | AAudioStreamBuilder_setSharingMode(inputStreamBuilder, AAUDIO_SHARING_MODE_EXCLUSIVE); 245 | AAudioStreamBuilder_setPerformanceMode(inputStreamBuilder, AAUDIO_PERFORMANCE_MODE_LOW_LATENCY); 246 | AAudioStreamBuilder_setErrorCallback(inputStreamBuilder, AAudioErrorCallback, NULL); 247 | AAudioStreamBuilder_setSampleRate(inputStreamBuilder, samplerate); 248 | 249 | if (!((AAudioStreamBuilder_openStream(inputStreamBuilder, &aaudio.inputStream) == AAUDIO_OK) && (aaudio.inputStream != NULL))) { 250 | AAudioStreamBuilder_delete(inputStreamBuilder); 251 | AAudioStreamBuilder_delete(outputStreamBuilder); 252 | AAudioStream_close(aaudio.outputStream); 253 | return false; 254 | } 255 | 256 | AAudioStreamBuilder_delete(inputStreamBuilder); 257 | AAudioStreamBuilder_delete(outputStreamBuilder); 258 | 259 | // Start audio I/O. 260 | bool success = (AAudioStream_requestStart(aaudio.outputStream) == AAUDIO_OK) && (AAudioStream_requestStart(aaudio.inputStream) == AAUDIO_OK); 261 | if (!success) { 262 | AAudioStream_close(aaudio.outputStream); 263 | AAudioStream_close(aaudio.inputStream); 264 | } else hasAAudio = true; 265 | 266 | aaudio.restarting = false; 267 | return success; 268 | } 269 | 270 | static void stopAAudio() { 271 | AAudioStream_requestStop(aaudio.outputStream); 272 | AAudioStream_requestStop(aaudio.inputStream); 273 | AAudioStream_close(aaudio.outputStream); 274 | AAudioStream_close(aaudio.inputStream); 275 | } 276 | 277 | // This is started by the error callback. 278 | static void *restartAAudioThread(__unused void *param) { 279 | LOGI("Restarting AAudio."); 280 | stopAAudio(); 281 | usleep(200000); 282 | startAAudio(); 283 | pthread_detach(pthread_self()); 284 | pthread_exit(NULL); 285 | return NULL; 286 | } 287 | 288 | #endif 289 | 290 | // Ugly Java-native bridges - JNI, that is. 291 | extern "C" { 292 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_SuperpoweredLatency(JNIEnv *javaEnvironment, jobject self, jlong samplerateFromJava, jlong buffersizeFromJava); 293 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_toggleMeasurer(JNIEnv *javaEnvironment, jobject self, jboolean useAAudioIfAvailable); 294 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_togglePassThrough(JNIEnv *javaEnvironment, jobject self); 295 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getState(JNIEnv *javaEnvironment, jobject self); 296 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getLatencyMs(JNIEnv *javaEnvironment, jobject self); 297 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getSamplerate(JNIEnv *javaEnvironment, jobject self); 298 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getBuffersize(JNIEnv *javaEnvironment, jobject self); 299 | JNIEXPORT jboolean Java_com_superpowered_superpoweredlatency_MainActivity_getAAudio(JNIEnv *javaEnvironment, jobject self); 300 | } 301 | 302 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_toggleMeasurer(__unused JNIEnv *javaEnvironment, __unused jobject self, jboolean useAAudioIfAvailable) { 303 | measurer->toggle(); 304 | isRunning = !isRunning; 305 | #if HAS_AAUDIO == 1 306 | if (isRunning) { 307 | if (useAAudioIfAvailable) { 308 | if (!startAAudio()) startOpenSLES(); // Use OpenSL ES if AAudio is not available. 309 | } else startOpenSLES(); 310 | LOGI(hasAAudio ? "Using AAudio." : "Using OpenSL ES."); 311 | } else { 312 | if (hasAAudio) stopAAudio(); else stopOpenSLES(); 313 | } 314 | #else 315 | if (isRunning) startOpenSLES(); else stopOpenSLES(); 316 | #endif 317 | } 318 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_togglePassThrough(__unused JNIEnv *javaEnvironment, __unused jobject self) { measurer->togglePassThrough(); } 319 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getState(__unused JNIEnv *javaEnvironment, __unused jobject self) { return measurer->state; } 320 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getLatencyMs(__unused JNIEnv *javaEnvironment, __unused jobject self) { return measurer->latencyMs; } 321 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getSamplerate(__unused JNIEnv *javaEnvironment, __unused jobject self) { return measurer->samplerate; } 322 | JNIEXPORT jint Java_com_superpowered_superpoweredlatency_MainActivity_getBuffersize(__unused JNIEnv *javaEnvironment, __unused jobject self) { return measurer->buffersize; } 323 | JNIEXPORT jboolean Java_com_superpowered_superpoweredlatency_MainActivity_getAAudio(__unused JNIEnv *javaEnvironment, __unused jobject self) { return (jboolean)hasAAudio; } 324 | 325 | // Set up audio and measurer. 326 | JNIEXPORT void Java_com_superpowered_superpoweredlatency_MainActivity_SuperpoweredLatency(__unused JNIEnv *javaEnvironment, __unused jobject self, jlong _samplerateFromJava, jlong _buffersizeFromJava) { 327 | openSLES.samplerateFromJava = (int)_samplerateFromJava; 328 | openSLES.buffersizeFromJava = (int)_buffersizeFromJava; 329 | measurer = new latencyMeasurer(); 330 | } 331 | -------------------------------------------------------------------------------- /Android/app/src/main/jni/latencyMeasurer.cpp: -------------------------------------------------------------------------------- 1 | #include "latencyMeasurer.h" 2 | #include 3 | #include 4 | #include 5 | 6 | /* 7 | Cross-platform class measuring round-trip audio latency. 8 | How one measurement step works: 9 | 10 | - Listen and measure the average loudness of the environment for 1 second. 11 | - Create a threshold value 24 decibels higher than the average loudness. 12 | - Begin playing a 1000 Hz sine wave and start counting the samples elapsed. 13 | - Stop counting and playing if the input's loudness is higher than the threshold, as the output wave is coming back (probably). 14 | - Divide the the elapsed samples with the sample rate to get the round-trip audio latency value in seconds. 15 | - We expect the threshold exceeded within 1 second. If it did not, then fail with error. Usually happens when the environment is too noisy (loud). 16 | 17 | How the measurement process works: 18 | 19 | - Perform 10 measurement steps. 20 | - Repeat every step until it returns without an error. 21 | - Store the results in an array of 10 floats. 22 | - After each step, check the minimum and maximum values. 23 | - If the maximum is higher than the minimum's double, stop the measurement process with an error. It indicates an unknown error, perhaps an unwanted noise happened. Double jitter (dispersion) is too high, an audio system can not be so bad. 24 | */ 25 | 26 | // Returns with the absolute sum of the audio. 27 | static int sumAudio(short int *audio, int numberOfSamples) { 28 | int sum = 0; 29 | while (numberOfSamples) { 30 | numberOfSamples--; 31 | sum += abs(audio[0]) + abs(audio[1]); 32 | audio += 2; 33 | }; 34 | return sum; 35 | } 36 | 37 | latencyMeasurer::latencyMeasurer() : measurementState(idle), nextMeasurementState(idle), samplesElapsed(0), sineWave(0), sum(0), threshold(0), state(0), samplerate(0), latencyMs(0), buffersize(0) { 38 | } 39 | 40 | void latencyMeasurer::toggle() { 41 | if ((state == -1) || ((state > 0) && (state < 11))) { // stop 42 | state = 0; 43 | nextMeasurementState = idle; 44 | } else { // start 45 | state = 1; 46 | samplerate = latencyMs = buffersize = 0; 47 | nextMeasurementState = measure_average_loudness_for_1_sec; 48 | }; 49 | } 50 | 51 | void latencyMeasurer::togglePassThrough() { 52 | if (state != -1) { 53 | state = -1; 54 | nextMeasurementState = passthrough; 55 | } else { 56 | state = 0; 57 | nextMeasurementState = idle; 58 | }; 59 | } 60 | 61 | void latencyMeasurer::processInput(short int *audio, int _samplerate, int numberOfSamples) { 62 | rampdec = -1.0f; 63 | samplerate = _samplerate; 64 | buffersize = numberOfSamples; 65 | 66 | if (nextMeasurementState != measurementState) { 67 | if (nextMeasurementState == measure_average_loudness_for_1_sec) samplesElapsed = 0; 68 | measurementState = nextMeasurementState; 69 | }; 70 | 71 | switch (measurementState) { 72 | // Measuring average loudness for 1 second. 73 | case measure_average_loudness_for_1_sec: 74 | sum += sumAudio(audio, numberOfSamples); 75 | samplesElapsed += numberOfSamples; 76 | 77 | if (samplesElapsed >= samplerate) { // 1 second elapsed, set up the next step. 78 | // Look for an audio energy rise of 24 decibel. 79 | float averageAudioValue = (float(sum) / float(samplesElapsed >> 1)) / 32767.0f; 80 | float referenceDecibel = 20.0f * log10f(averageAudioValue) + 24.0f; 81 | threshold = (short int)(powf(10.0f, referenceDecibel / 20.0f) * 32767.0f); 82 | 83 | measurementState = nextMeasurementState = playing_and_listening; 84 | sineWave = 0; 85 | samplesElapsed = 0; 86 | sum = 0; 87 | }; 88 | break; 89 | 90 | // Playing sine wave and listening if it comes back. 91 | case playing_and_listening: { 92 | int averageInputValue = sumAudio(audio, numberOfSamples) / numberOfSamples; 93 | rampdec = 0.0f; 94 | 95 | if (averageInputValue > threshold) { // The signal is above the threshold, so our sine wave comes back on the input. 96 | int n = 0; 97 | short int *input = audio; 98 | while (n < numberOfSamples) { // Check the location when it became loud enough. 99 | if (*input++ > threshold) break; 100 | if (*input++ > threshold) break; 101 | n++; 102 | }; 103 | samplesElapsed += n; // Now we know the total round trip latency. 104 | 105 | if (samplesElapsed > numberOfSamples) { // Expect at least 1 buffer of round-trip latency. 106 | roundTripLatencyMs[state - 1] = float(samplesElapsed * 1000) / float(samplerate); 107 | 108 | float sum = 0, max = 0, min = 100000.0f; 109 | for (n = 0; n < state; n++) { 110 | if (roundTripLatencyMs[n] > max) max = roundTripLatencyMs[n]; 111 | if (roundTripLatencyMs[n] < min) min = roundTripLatencyMs[n]; 112 | sum += roundTripLatencyMs[n]; 113 | }; 114 | 115 | if (max / min > 2.0f) { // Dispersion error. 116 | latencyMs = 0; 117 | state = 10; 118 | measurementState = nextMeasurementState = idle; 119 | } else if (state == 10) { // Final result. 120 | latencyMs = int(sum * 0.1f); 121 | measurementState = nextMeasurementState = idle; 122 | } else { // Next step. 123 | latencyMs = (int)roundTripLatencyMs[state - 1]; 124 | measurementState = nextMeasurementState = waiting; 125 | }; 126 | 127 | state++; 128 | } else measurementState = nextMeasurementState = waiting; // Happens when an early noise comes in. 129 | 130 | rampdec = 1.0f / float(numberOfSamples); 131 | } else { // Still listening. 132 | samplesElapsed += numberOfSamples; 133 | 134 | // Do not listen to more than a second, let's start over. Maybe the environment's noise is too high. 135 | if (samplesElapsed > samplerate) { 136 | rampdec = 1.0f / float(numberOfSamples); 137 | measurementState = nextMeasurementState = waiting; 138 | latencyMs = -1; 139 | }; 140 | }; 141 | }; break; 142 | 143 | case passthrough: 144 | case idle: break; 145 | 146 | default: // Waiting 1 second. 147 | samplesElapsed += numberOfSamples; 148 | 149 | if (samplesElapsed > samplerate) { // 1 second elapsed, start over. 150 | samplesElapsed = 0; 151 | measurementState = nextMeasurementState = measure_average_loudness_for_1_sec; 152 | }; 153 | }; 154 | } 155 | 156 | void latencyMeasurer::processOutput(short int *audio) { 157 | if (measurementState == passthrough) return; 158 | 159 | if (rampdec < 0.0f) memset(audio, 0, (size_t)buffersize * 4); // Output silence. 160 | else { // Output sine wave. 161 | float ramp = 1.0f, mul = (2.0f * float(M_PI) * 1000.0f) / float(samplerate); // 1000 Hz 162 | int n = buffersize; 163 | while (n) { 164 | n--; 165 | audio[0] = audio[1] = (short int)(sinf(mul * sineWave) * ramp * 32767.0f); 166 | ramp -= rampdec; 167 | sineWave += 1.0f; 168 | audio += 2; 169 | }; 170 | }; 171 | } 172 | -------------------------------------------------------------------------------- /Android/app/src/main/jni/latencyMeasurer.h: -------------------------------------------------------------------------------- 1 | #ifndef Header_latencyMeasurer 2 | #define Header_latencyMeasurer 3 | 4 | typedef enum measurementStates { 5 | measure_average_loudness_for_1_sec, 6 | playing_and_listening, 7 | waiting, 8 | passthrough, 9 | idle 10 | } measurementStates; 11 | 12 | class latencyMeasurer { 13 | public: 14 | int state; // -1: passthrough, 0: idle, 1..10 taking measurement steps, 11 finished 15 | int samplerate; 16 | int latencyMs; 17 | int buffersize; 18 | 19 | latencyMeasurer(); 20 | void processInput(short int *audio, int samplerate, int numberOfSamples); 21 | void processOutput(short int *audio); 22 | void toggle(); 23 | void togglePassThrough(); 24 | 25 | private: 26 | measurementStates measurementState, nextMeasurementState; 27 | float roundTripLatencyMs[10], sineWave, rampdec; 28 | int sum, samplesElapsed; 29 | short int threshold; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-hdpi/superpowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-hdpi/superpowered.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-mdpi/superpowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-mdpi/superpowered.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-xhdpi/superpowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-xhdpi/superpowered.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/drawable-xxhdpi/superpowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/app/src/main/res/drawable-xxhdpi/superpowered.png -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 28 | 48 | 49 | 59 | 60 | 61 | 72 | 73 | 88 | 89 | 101 | 102 | 117 | 118 | 128 | 129 | 148 | 149 | 156 | 157 | 171 | 172 | 182 | 183 | 184 | 185 | 191 | 192 | 203 | 204 | 219 | 220 | 232 | 233 | 248 | 249 | 261 | 262 | 277 | 278 | 290 | 291 | 306 | 307 | 327 | 328 | 350 | 351 | 352 | 353 | 368 | 369 | 379 | 380 | 401 | 402 | 403 | -------------------------------------------------------------------------------- /Android/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0dp 4 | 0dp 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Latency Test 5 | Superpowered Latency Test 6 | Before starting the total round-trip audio latency test, please do the following:\n\n1. Make sure you are in a quiet place.\n2. Check you have an active Internet connection.\n3. Set volume to near maximum. 7 | Settings 8 | Thank you. We\'ve uploaded the result to the latency benchmarking at: 9 | 10 | 11 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | superpowered.com 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | -------------------------------------------------------------------------------- /Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:7.2.2' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jan 04 14:17:27 CET 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /Android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /Android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This application measures round-trip audio latency on an iOS or Android device. 2 | 3 | Low round-trip audio latency is a strong indicator of how well any mobile device is optimized for professional audio. 4 | Lower latency confers significant benefits to users of all sorts of apps like games, augmented hearing apps, VOIP and other interactive apps. 5 | Read more: http://superpowered.com/latency 6 | 7 | The core of this app is a cross-platform class under: Android/app/src/main/jni/latencyMeasurer.cpp 8 | -------------------------------------------------------------------------------- /iOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface AppDelegate: UIResponder 4 | 5 | @property (strong, nonatomic) UIWindow *window; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /iOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | @implementation AppDelegate 4 | 5 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 6 | return YES; 7 | } 8 | 9 | - (void)applicationWillResignActive:(UIApplication *)application {} 10 | 11 | - (void)applicationDidEnterBackground:(UIApplication *)application {} 12 | 13 | - (void)applicationWillEnterForeground:(UIApplication *)application {} 14 | 15 | - (void)applicationDidBecomeActive:(UIApplication *)application {} 16 | 17 | - (void)applicationWillTerminate:(UIApplication *)application {} 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Icon-40.png", 5 | "idiom" : "iphone", 6 | "scale" : "2x", 7 | "size" : "20x20" 8 | }, 9 | { 10 | "filename" : "Icon-60.png", 11 | "idiom" : "iphone", 12 | "scale" : "3x", 13 | "size" : "20x20" 14 | }, 15 | { 16 | "filename" : "Icon-58.png", 17 | "idiom" : "iphone", 18 | "scale" : "2x", 19 | "size" : "29x29" 20 | }, 21 | { 22 | "filename" : "Icon-87.png", 23 | "idiom" : "iphone", 24 | "scale" : "3x", 25 | "size" : "29x29" 26 | }, 27 | { 28 | "filename" : "Icon-80.png", 29 | "idiom" : "iphone", 30 | "scale" : "2x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "Icon-120.png", 35 | "idiom" : "iphone", 36 | "scale" : "3x", 37 | "size" : "40x40" 38 | }, 39 | { 40 | "filename" : "Icon-120 1.png", 41 | "idiom" : "iphone", 42 | "scale" : "2x", 43 | "size" : "60x60" 44 | }, 45 | { 46 | "filename" : "Icon-180.png", 47 | "idiom" : "iphone", 48 | "scale" : "3x", 49 | "size" : "60x60" 50 | }, 51 | { 52 | "filename" : "Icon-20.png", 53 | "idiom" : "ipad", 54 | "scale" : "1x", 55 | "size" : "20x20" 56 | }, 57 | { 58 | "filename" : "Icon-40 1.png", 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "20x20" 62 | }, 63 | { 64 | "filename" : "Icon-29.png", 65 | "idiom" : "ipad", 66 | "scale" : "1x", 67 | "size" : "29x29" 68 | }, 69 | { 70 | "filename" : "Icon-58 1.png", 71 | "idiom" : "ipad", 72 | "scale" : "2x", 73 | "size" : "29x29" 74 | }, 75 | { 76 | "filename" : "Icon-40 2.png", 77 | "idiom" : "ipad", 78 | "scale" : "1x", 79 | "size" : "40x40" 80 | }, 81 | { 82 | "filename" : "Icon-80 1.png", 83 | "idiom" : "ipad", 84 | "scale" : "2x", 85 | "size" : "40x40" 86 | }, 87 | { 88 | "filename" : "Icon-76.png", 89 | "idiom" : "ipad", 90 | "scale" : "1x", 91 | "size" : "76x76" 92 | }, 93 | { 94 | "filename" : "Icon-152.png", 95 | "idiom" : "ipad", 96 | "scale" : "2x", 97 | "size" : "76x76" 98 | }, 99 | { 100 | "filename" : "Icon-167.png", 101 | "idiom" : "ipad", 102 | "scale" : "2x", 103 | "size" : "83.5x83.5" 104 | }, 105 | { 106 | "filename" : "Icon-1024.png", 107 | "idiom" : "ios-marketing", 108 | "scale" : "1x", 109 | "size" : "1024x1024" 110 | }, 111 | { 112 | "filename" : "Icon-16.png", 113 | "idiom" : "mac", 114 | "scale" : "1x", 115 | "size" : "16x16" 116 | }, 117 | { 118 | "filename" : "Icon-32.png", 119 | "idiom" : "mac", 120 | "scale" : "2x", 121 | "size" : "16x16" 122 | }, 123 | { 124 | "filename" : "Icon-32 1.png", 125 | "idiom" : "mac", 126 | "scale" : "1x", 127 | "size" : "32x32" 128 | }, 129 | { 130 | "filename" : "Icon-64.png", 131 | "idiom" : "mac", 132 | "scale" : "2x", 133 | "size" : "32x32" 134 | }, 135 | { 136 | "filename" : "Icon-128.png", 137 | "idiom" : "mac", 138 | "scale" : "1x", 139 | "size" : "128x128" 140 | }, 141 | { 142 | "filename" : "Icon-256.png", 143 | "idiom" : "mac", 144 | "scale" : "2x", 145 | "size" : "128x128" 146 | }, 147 | { 148 | "filename" : "Icon-256 1.png", 149 | "idiom" : "mac", 150 | "scale" : "1x", 151 | "size" : "256x256" 152 | }, 153 | { 154 | "filename" : "Icon-512.png", 155 | "idiom" : "mac", 156 | "scale" : "2x", 157 | "size" : "256x256" 158 | }, 159 | { 160 | "filename" : "Icon-512 1.png", 161 | "idiom" : "mac", 162 | "scale" : "1x", 163 | "size" : "512x512" 164 | }, 165 | { 166 | "filename" : "Icon-1024 1.png", 167 | "idiom" : "mac", 168 | "scale" : "2x", 169 | "size" : "512x512" 170 | } 171 | ], 172 | "info" : { 173 | "author" : "xcode", 174 | "version" : 1 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-120 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-120 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-120.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-128.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-152.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-16.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-167.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-180.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-20.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-256 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-256.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-32 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-32.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-40 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-40 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-40 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-40 2.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-512 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-512.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-58 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-58 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-58.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-64.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-80 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-80 1.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-80.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/AppIcon.appiconset/Icon-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/Assets.xcassets/AppIcon.appiconset/Icon-87.png -------------------------------------------------------------------------------- /iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "wave.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "wave-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "wave-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/bg.imageset/wave-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/bg.imageset/wave-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/bg.imageset/wave.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/superpoweredLogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "superpowered-black.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "superpowered-black-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "superpowered-black-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/superpoweredLogo.imageset/superpowered-black-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/superpoweredLogo.imageset/superpowered-black-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iOS/Assets.xcassets/superpoweredLogo.imageset/superpowered-black.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Latency Test 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | NSMicrophoneUsageDescription 31 | To measure the round-trip audio latency. 32 | UIBackgroundModes 33 | 34 | audio 35 | 36 | UILaunchStoryboardName 37 | Main 38 | UIMainStoryboardFile 39 | Main 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | 48 | UISupportedInterfaceOrientations~ipad 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationPortraitUpsideDown 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | UIUserInterfaceStyle 56 | Light 57 | CFBundleIconName 58 | AppIcon 59 | 60 | 61 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B17E9081A972E9000C5A894 /* superpowered.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B17E9061A972E9000C5A894 /* superpowered.png */; }; 11 | 1B17E9091A972E9000C5A894 /* superpowered@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B17E9071A972E9000C5A894 /* superpowered@2x.png */; }; 12 | 1B3401411A9E2E9E00BCD8A3 /* superpowered@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B3401401A9E2E9E00BCD8A3 /* superpowered@3x.png */; }; 13 | 1B4F1D7B1A8241640062EF66 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4F1D7A1A8241640062EF66 /* main.m */; }; 14 | 1B4F1D811A8241780062EF66 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B4F1D801A8241780062EF66 /* ViewController.mm */; }; 15 | 1B4F1D841A82417E0062EF66 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4F1D831A82417E0062EF66 /* AppDelegate.m */; }; 16 | 1B4F1D861A82419E0062EF66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1B4F1D851A82419E0062EF66 /* Images.xcassets */; }; 17 | 1B4F1D8A1A8241B40062EF66 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1B4F1D881A8241B40062EF66 /* Main.storyboard */; }; 18 | 1B4F1D951A82483E0062EF66 /* latencyMeasurer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1B4F1D931A82483E0062EF66 /* latencyMeasurer.cpp */; }; 19 | 1B5170221A81015700B17D41 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B5170211A81015700B17D41 /* AudioToolbox.framework */; }; 20 | 1B5170241A81015A00B17D41 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B5170231A81015A00B17D41 /* AVFoundation.framework */; }; 21 | 1B5170261A81016700B17D41 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B5170251A81016700B17D41 /* MediaPlayer.framework */; }; 22 | 1B73E7871A9C6E5400ACFE83 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B73E7861A9C6E5400ACFE83 /* Social.framework */; }; 23 | 6DA77E662C5CF1A6009B33A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6DA77E652C5CF1A6009B33A6 /* Assets.xcassets */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 1B17E9061A972E9000C5A894 /* superpowered.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = superpowered.png; sourceTree = ""; }; 28 | 1B17E9071A972E9000C5A894 /* superpowered@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "superpowered@2x.png"; sourceTree = ""; }; 29 | 1B3401401A9E2E9E00BCD8A3 /* superpowered@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "superpowered@3x.png"; sourceTree = ""; }; 30 | 1B4F1D7A1A8241640062EF66 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; }; 31 | 1B4F1D7F1A8241780062EF66 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = SOURCE_ROOT; }; 32 | 1B4F1D801A8241780062EF66 /* ViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = SOURCE_ROOT; }; 33 | 1B4F1D821A82417E0062EF66 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; }; 34 | 1B4F1D831A82417E0062EF66 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; }; 35 | 1B4F1D851A82419E0062EF66 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = SOURCE_ROOT; }; 36 | 1B4F1D881A8241B40062EF66 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = SOURCE_ROOT; }; 37 | 1B4F1D911A82421C0062EF66 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 1B4F1D931A82483E0062EF66 /* latencyMeasurer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = latencyMeasurer.cpp; path = ../Android/app/src/main/jni/latencyMeasurer.cpp; sourceTree = ""; }; 39 | 1B4F1D941A82483E0062EF66 /* latencyMeasurer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = latencyMeasurer.h; path = ../Android/app/src/main/jni/latencyMeasurer.h; sourceTree = ""; }; 40 | 1B516FF51A81006200B17D41 /* SuperpoweredLatency.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SuperpoweredLatency.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 1B5170211A81015700B17D41 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 42 | 1B5170231A81015A00B17D41 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 43 | 1B5170251A81016700B17D41 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 44 | 1B6990ED1A839EE200FD24DC /* machines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = machines.h; sourceTree = ""; }; 45 | 1B73E7861A9C6E5400ACFE83 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; 46 | 6DA77E652C5CF1A6009B33A6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 1B516FF21A81006200B17D41 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 1B73E7871A9C6E5400ACFE83 /* Social.framework in Frameworks */, 55 | 1B5170261A81016700B17D41 /* MediaPlayer.framework in Frameworks */, 56 | 1B5170241A81015A00B17D41 /* AVFoundation.framework in Frameworks */, 57 | 1B5170221A81015700B17D41 /* AudioToolbox.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 1B516FEC1A81006200B17D41 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 1B4F1D941A82483E0062EF66 /* latencyMeasurer.h */, 68 | 1B4F1D931A82483E0062EF66 /* latencyMeasurer.cpp */, 69 | 1B6990ED1A839EE200FD24DC /* machines.h */, 70 | 1B4F1D7F1A8241780062EF66 /* ViewController.h */, 71 | 1B4F1D801A8241780062EF66 /* ViewController.mm */, 72 | 1B4F1D821A82417E0062EF66 /* AppDelegate.h */, 73 | 1B4F1D831A82417E0062EF66 /* AppDelegate.m */, 74 | 1B4F1D881A8241B40062EF66 /* Main.storyboard */, 75 | 1B5170251A81016700B17D41 /* MediaPlayer.framework */, 76 | 1B5170231A81015A00B17D41 /* AVFoundation.framework */, 77 | 1B5170211A81015700B17D41 /* AudioToolbox.framework */, 78 | 1B73E7861A9C6E5400ACFE83 /* Social.framework */, 79 | 1B4F1D851A82419E0062EF66 /* Images.xcassets */, 80 | 6DA77E652C5CF1A6009B33A6 /* Assets.xcassets */, 81 | 1B17E9061A972E9000C5A894 /* superpowered.png */, 82 | 1B3401401A9E2E9E00BCD8A3 /* superpowered@3x.png */, 83 | 1B17E9071A972E9000C5A894 /* superpowered@2x.png */, 84 | 1B4F1D911A82421C0062EF66 /* Info.plist */, 85 | 1B4F1D7A1A8241640062EF66 /* main.m */, 86 | 1B516FF61A81006200B17D41 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 1B516FF61A81006200B17D41 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 1B516FF51A81006200B17D41 /* SuperpoweredLatency.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXNativeTarget section */ 101 | 1B516FF41A81006200B17D41 /* SuperpoweredLatency */ = { 102 | isa = PBXNativeTarget; 103 | buildConfigurationList = 1B5170181A81006200B17D41 /* Build configuration list for PBXNativeTarget "SuperpoweredLatency" */; 104 | buildPhases = ( 105 | 1B516FF11A81006200B17D41 /* Sources */, 106 | 1B516FF21A81006200B17D41 /* Frameworks */, 107 | 1B516FF31A81006200B17D41 /* Resources */, 108 | ); 109 | buildRules = ( 110 | ); 111 | dependencies = ( 112 | ); 113 | name = SuperpoweredLatency; 114 | productName = SuperpoweredLatency; 115 | productReference = 1B516FF51A81006200B17D41 /* SuperpoweredLatency.app */; 116 | productType = "com.apple.product-type.application"; 117 | }; 118 | /* End PBXNativeTarget section */ 119 | 120 | /* Begin PBXProject section */ 121 | 1B516FED1A81006200B17D41 /* Project object */ = { 122 | isa = PBXProject; 123 | attributes = { 124 | LastUpgradeCheck = 1120; 125 | ORGANIZATIONNAME = imect; 126 | TargetAttributes = { 127 | 1B516FF41A81006200B17D41 = { 128 | CreatedOnToolsVersion = 6.1.1; 129 | DevelopmentTeam = Z674RYS8AW; 130 | ProvisioningStyle = Automatic; 131 | SystemCapabilities = { 132 | com.apple.BackgroundModes = { 133 | enabled = 1; 134 | }; 135 | }; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 1B516FF01A81006200B17D41 /* Build configuration list for PBXProject "SuperpoweredLatency" */; 140 | compatibilityVersion = "Xcode 3.2"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 1B516FEC1A81006200B17D41; 148 | productRefGroup = 1B516FF61A81006200B17D41 /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 1B516FF41A81006200B17D41 /* SuperpoweredLatency */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 1B516FF31A81006200B17D41 /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 1B4F1D8A1A8241B40062EF66 /* Main.storyboard in Resources */, 163 | 1B17E9091A972E9000C5A894 /* superpowered@2x.png in Resources */, 164 | 1B3401411A9E2E9E00BCD8A3 /* superpowered@3x.png in Resources */, 165 | 1B17E9081A972E9000C5A894 /* superpowered.png in Resources */, 166 | 6DA77E662C5CF1A6009B33A6 /* Assets.xcassets in Resources */, 167 | 1B4F1D861A82419E0062EF66 /* Images.xcassets in Resources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXResourcesBuildPhase section */ 172 | 173 | /* Begin PBXSourcesBuildPhase section */ 174 | 1B516FF11A81006200B17D41 /* Sources */ = { 175 | isa = PBXSourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 1B4F1D951A82483E0062EF66 /* latencyMeasurer.cpp in Sources */, 179 | 1B4F1D841A82417E0062EF66 /* AppDelegate.m in Sources */, 180 | 1B4F1D7B1A8241640062EF66 /* main.m in Sources */, 181 | 1B4F1D811A8241780062EF66 /* ViewController.mm in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | 1B5170161A81006200B17D41 /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 193 | CLANG_CXX_LIBRARY = "libc++"; 194 | CLANG_ENABLE_MODULES = YES; 195 | CLANG_ENABLE_OBJC_ARC = YES; 196 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_COMMA = YES; 199 | CLANG_WARN_CONSTANT_CONVERSION = YES; 200 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 202 | CLANG_WARN_EMPTY_BODY = YES; 203 | CLANG_WARN_ENUM_CONVERSION = YES; 204 | CLANG_WARN_INFINITE_RECURSION = YES; 205 | CLANG_WARN_INT_CONVERSION = YES; 206 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 207 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 208 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 209 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 210 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 211 | CLANG_WARN_STRICT_PROTOTYPES = YES; 212 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 213 | CLANG_WARN_UNREACHABLE_CODE = YES; 214 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 215 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 216 | COPY_PHASE_STRIP = NO; 217 | ENABLE_STRICT_OBJC_MSGSEND = YES; 218 | ENABLE_TESTABILITY = YES; 219 | GCC_C_LANGUAGE_STANDARD = gnu99; 220 | GCC_DYNAMIC_NO_PIC = NO; 221 | GCC_NO_COMMON_BLOCKS = YES; 222 | GCC_OPTIMIZATION_LEVEL = 0; 223 | GCC_PREPROCESSOR_DEFINITIONS = ( 224 | "DEBUG=1", 225 | "$(inherited)", 226 | ); 227 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 230 | GCC_WARN_UNDECLARED_SELECTOR = YES; 231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 232 | GCC_WARN_UNUSED_FUNCTION = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 235 | MTL_ENABLE_DEBUG_INFO = YES; 236 | ONLY_ACTIVE_ARCH = YES; 237 | SDKROOT = iphoneos; 238 | TARGETED_DEVICE_FAMILY = "1,2"; 239 | }; 240 | name = Debug; 241 | }; 242 | 1B5170171A81006200B17D41 /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 247 | CLANG_CXX_LIBRARY = "libc++"; 248 | CLANG_ENABLE_MODULES = YES; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 251 | CLANG_WARN_BOOL_CONVERSION = YES; 252 | CLANG_WARN_COMMA = YES; 253 | CLANG_WARN_CONSTANT_CONVERSION = YES; 254 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INFINITE_RECURSION = YES; 259 | CLANG_WARN_INT_CONVERSION = YES; 260 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 261 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 262 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 263 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 264 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 265 | CLANG_WARN_STRICT_PROTOTYPES = YES; 266 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 267 | CLANG_WARN_UNREACHABLE_CODE = YES; 268 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 269 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 270 | COPY_PHASE_STRIP = YES; 271 | ENABLE_NS_ASSERTIONS = NO; 272 | ENABLE_STRICT_OBJC_MSGSEND = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu99; 274 | GCC_NO_COMMON_BLOCKS = YES; 275 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 277 | GCC_WARN_UNDECLARED_SELECTOR = YES; 278 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 279 | GCC_WARN_UNUSED_FUNCTION = YES; 280 | GCC_WARN_UNUSED_VARIABLE = YES; 281 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 282 | MTL_ENABLE_DEBUG_INFO = NO; 283 | SDKROOT = iphoneos; 284 | TARGETED_DEVICE_FAMILY = "1,2"; 285 | VALIDATE_PRODUCT = YES; 286 | }; 287 | name = Release; 288 | }; 289 | 1B5170191A81006200B17D41 /* Debug */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 294 | CODE_SIGN_STYLE = Automatic; 295 | CURRENT_PROJECT_VERSION = 1; 296 | DEVELOPMENT_TEAM = Z674RYS8AW; 297 | INFOPLIST_FILE = Info.plist; 298 | INFOPLIST_KEY_CFBundleDisplayName = SuperpoweredLatency; 299 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 301 | MARKETING_VERSION = 1.0.0; 302 | PRODUCT_BUNDLE_IDENTIFIER = com.superpowered.SuperpoweredLatency; 303 | PRODUCT_NAME = SuperpoweredLatency; 304 | PROVISIONING_PROFILE_SPECIFIER = ""; 305 | }; 306 | name = Debug; 307 | }; 308 | 1B51701A1A81006200B17D41 /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 312 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 313 | CODE_SIGN_STYLE = Automatic; 314 | CURRENT_PROJECT_VERSION = 1; 315 | DEVELOPMENT_TEAM = Z674RYS8AW; 316 | INFOPLIST_FILE = Info.plist; 317 | INFOPLIST_KEY_CFBundleDisplayName = SuperpoweredLatency; 318 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 320 | MARKETING_VERSION = 1.0.0; 321 | PRODUCT_BUNDLE_IDENTIFIER = com.superpowered.SuperpoweredLatency; 322 | PRODUCT_NAME = SuperpoweredLatency; 323 | PROVISIONING_PROFILE = ""; 324 | PROVISIONING_PROFILE_SPECIFIER = ""; 325 | }; 326 | name = Release; 327 | }; 328 | 1B6990EE1A83CFC900FD24DC /* Ad Hoc */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ALWAYS_SEARCH_USER_PATHS = NO; 332 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 333 | CLANG_CXX_LIBRARY = "libc++"; 334 | CLANG_ENABLE_MODULES = YES; 335 | CLANG_ENABLE_OBJC_ARC = YES; 336 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 337 | CLANG_WARN_BOOL_CONVERSION = YES; 338 | CLANG_WARN_COMMA = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_EMPTY_BODY = YES; 343 | CLANG_WARN_ENUM_CONVERSION = YES; 344 | CLANG_WARN_INFINITE_RECURSION = YES; 345 | CLANG_WARN_INT_CONVERSION = YES; 346 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 347 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 348 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 350 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 351 | CLANG_WARN_STRICT_PROTOTYPES = YES; 352 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 353 | CLANG_WARN_UNREACHABLE_CODE = YES; 354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 356 | COPY_PHASE_STRIP = YES; 357 | ENABLE_NS_ASSERTIONS = NO; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 368 | MTL_ENABLE_DEBUG_INFO = NO; 369 | SDKROOT = iphoneos; 370 | TARGETED_DEVICE_FAMILY = "1,2"; 371 | VALIDATE_PRODUCT = YES; 372 | }; 373 | name = "Ad Hoc"; 374 | }; 375 | 1B6990EF1A83CFC900FD24DC /* Ad Hoc */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 379 | CODE_SIGN_IDENTITY = "iPhone Distribution: iMect Szolgaltato Beteti Tarsasag"; 380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 381 | CODE_SIGN_STYLE = Automatic; 382 | CURRENT_PROJECT_VERSION = 1; 383 | DEVELOPMENT_TEAM = Z674RYS8AW; 384 | INFOPLIST_FILE = Info.plist; 385 | INFOPLIST_KEY_CFBundleDisplayName = SuperpoweredLatency; 386 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | MARKETING_VERSION = 1.0.0; 389 | PRODUCT_BUNDLE_IDENTIFIER = com.superpowered.SuperpoweredLatency; 390 | PRODUCT_NAME = SuperpoweredLatency; 391 | PROVISIONING_PROFILE = ""; 392 | PROVISIONING_PROFILE_SPECIFIER = ""; 393 | }; 394 | name = "Ad Hoc"; 395 | }; 396 | /* End XCBuildConfiguration section */ 397 | 398 | /* Begin XCConfigurationList section */ 399 | 1B516FF01A81006200B17D41 /* Build configuration list for PBXProject "SuperpoweredLatency" */ = { 400 | isa = XCConfigurationList; 401 | buildConfigurations = ( 402 | 1B5170161A81006200B17D41 /* Debug */, 403 | 1B5170171A81006200B17D41 /* Release */, 404 | 1B6990EE1A83CFC900FD24DC /* Ad Hoc */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | 1B5170181A81006200B17D41 /* Build configuration list for PBXNativeTarget "SuperpoweredLatency" */ = { 410 | isa = XCConfigurationList; 411 | buildConfigurations = ( 412 | 1B5170191A81006200B17D41 /* Debug */, 413 | 1B51701A1A81006200B17D41 /* Release */, 414 | 1B6990EF1A83CFC900FD24DC /* Ad Hoc */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | /* End XCConfigurationList section */ 420 | }; 421 | rootObject = 1B516FED1A81006200B17D41 /* Project object */; 422 | } 423 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcshareddata/SuperpoweredLatency.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | FE1C449B-3270-4B47-AB2B-1B7406FE3324 9 | IDESourceControlProjectName 10 | SuperpoweredLatency 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 7D9A8E066C6631246F3EA2356BA7CA70663E76B1 14 | https://github.com/superpoweredSDK/SuperpoweredLatency.git 15 | 16 | IDESourceControlProjectPath 17 | iOS/SuperpoweredLatency.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 7D9A8E066C6631246F3EA2356BA7CA70663E76B1 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/superpoweredSDK/SuperpoweredLatency.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 7D9A8E066C6631246F3EA2356BA7CA70663E76B1 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 7D9A8E066C6631246F3EA2356BA7CA70663E76B1 36 | IDESourceControlWCCName 37 | SuperpoweredLatency 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcuserdata/gaborszanto.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcuserdata/gaborszanto.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcuserdata/szantog.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/SuperpoweredLatency.xcodeproj/project.xcworkspace/xcuserdata/szantog.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/xcuserdata/gaborszanto.xcuserdatad/xcschemes/SuperpoweredLatency.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/xcuserdata/gaborszanto.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SuperpoweredLatency.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1B516FF41A81006200B17D41 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/xcuserdata/szantog.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/xcuserdata/szantog.xcuserdatad/xcschemes/SuperpoweredLatency.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /iOS/SuperpoweredLatency.xcodeproj/xcuserdata/szantog.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SuperpoweredLatency.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1B516FF41A81006200B17D41 16 | 17 | primary 18 | 19 | 20 | 1B51700D1A81006200B17D41 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /iOS/ViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ViewController: UIViewController 4 | 5 | @property (nonatomic, retain) IBOutlet UILabel *mainTitle; 6 | @property (nonatomic, retain) IBOutlet UILabel *model; 7 | @property (nonatomic, retain) IBOutlet UILabel *os; 8 | 9 | @property (nonatomic, retain) IBOutlet UIView *info; 10 | 11 | @property (nonatomic, retain) IBOutlet UIView *status; 12 | @property (nonatomic, retain) IBOutlet UILabel *statusMessage; 13 | @property (nonatomic, retain) IBOutlet UIPageControl *progress; 14 | 15 | @property (nonatomic, retain) IBOutlet UIView *results; 16 | @property (nonatomic, retain) IBOutlet UILabel *latency; 17 | @property (nonatomic, retain) IBOutlet UILabel *bufferSize; 18 | @property (nonatomic, retain) IBOutlet UILabel *sampleRate; 19 | @property (nonatomic, retain) IBOutlet UILabel *network; 20 | @property (nonatomic, retain) IBOutlet UILabel *website; 21 | 22 | @property (nonatomic, retain) IBOutlet UILabel *button; 23 | @property (nonatomic, retain) IBOutlet UIImageView *superpowered; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /iOS/ViewController.mm: -------------------------------------------------------------------------------- 1 | #import "ViewController.h" 2 | #import 3 | #import 4 | #import 5 | #import 6 | #include "latencyMeasurer.h" 7 | #include 8 | #include "machines.h" 9 | 10 | @implementation ViewController { 11 | AudioUnit au; 12 | latencyMeasurer *measurer; 13 | int samplerate, measurerState; 14 | CADisplayLink *displayLink; 15 | } 16 | 17 | @synthesize mainTitle, model, os, info, status, statusMessage, progress, results, latency, bufferSize, sampleRate, network, button, website, superpowered; 18 | 19 | // When the user taps on the main button. 20 | - (IBAction)onButton:(id)sender { 21 | if (!results.hidden) { 22 | UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Share Results" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Twitter", @"Facebook", @"Email", nil]; 23 | [sheet showInView:self.view]; 24 | } else if (measurer) { 25 | measurer->toggle(); 26 | button.text = (measurer->state > 0) ? @"Start Latency Test" : @"Cancel"; 27 | }; 28 | } 29 | 30 | // Encodes safe strings for network transfer. 31 | static NSString *encodedString(NSString *str) { 32 | return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)[[str dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0], NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingASCII)); 33 | } 34 | 35 | // Called periodically to update the UI. 36 | - (void)UI_update { 37 | if ((measurerState != measurer->state) || (measurer->latencyMs < 0)) { // Update the UI if the measurer's state has been changed. 38 | measurerState = measurer->state; 39 | 40 | // Idle state. 41 | if (measurerState == 0) { 42 | info.hidden = NO; 43 | results.hidden = status.hidden = YES; 44 | button.text = @"Start Latency Test"; 45 | 46 | // Result or error. 47 | } else if (measurerState > 10) { 48 | if (measurer->latencyMs == 0) { 49 | statusMessage.text = @"Dispersion too big, please try again."; 50 | button.text = @"Restart Test"; 51 | } else { 52 | info.hidden = status.hidden = website.hidden = YES; 53 | results.hidden = NO; 54 | latency.text = [NSString stringWithFormat:@"%i ms", measurer->latencyMs]; 55 | bufferSize.text = [NSString stringWithFormat:@"%i", measurer->buffersize]; 56 | sampleRate.text = [NSString stringWithFormat:@"%i Hz", measurer->samplerate]; 57 | network.text = @"Uploading data..."; 58 | button.text = @"Share Results"; 59 | 60 | // Uploading the result to our server. 61 | NSString *url = [NSString stringWithFormat:@"http://superpowered.com/latencydata/input.php?ms=%i&samplerate=%i&buffersize=%i&model=%@&os=%@&build=0", measurer->latencyMs, measurer->samplerate, measurer->buffersize, encodedString(model.text), encodedString([[UIDevice currentDevice] systemVersion])]; 62 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]; 63 | [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { 64 | if (error) { 65 | self.network.text = [error localizedDescription]; 66 | } else if ([data length] == 2) { 67 | self.network.text = @"Thank you. We've uploaded the result to the latency benchmarking at:"; 68 | self.website.hidden = NO; 69 | } else { 70 | self.network.text = @"Network error."; 71 | } 72 | }]; 73 | }; 74 | 75 | // Measurement starts. 76 | } else if (measurerState == 1) { 77 | status.hidden = NO; 78 | results.hidden = info.hidden = YES; 79 | statusMessage.text = @"? ms"; 80 | progress.currentPage = 0; 81 | button.text = @"Cancel"; 82 | 83 | // Measurement in progress. 84 | } else { 85 | if (measurer->latencyMs < 0) statusMessage.text = @"The environment is too loud!"; 86 | else { 87 | statusMessage.text = [NSString stringWithFormat:@"%i ms", measurer->latencyMs]; 88 | progress.currentPage = measurerState - 1; 89 | }; 90 | }; 91 | }; 92 | } 93 | 94 | // Called periodically for audio input/output. 95 | static OSStatus audioProcessingCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { 96 | ViewController *self = (__bridge ViewController *)inRefCon; 97 | 98 | if (self->samplerate > 0) { 99 | // Get input samples. 100 | AudioUnitRender(self->au, ioActionFlags, inTimeStamp, 1, inNumberFrames, ioData); 101 | 102 | // Process audio. The reason for a separate input and output process is Android. 103 | // We are measuring with the same code on both iOS and Android, where the input and output must be processed separately. 104 | self->measurer->processInput((short int *)ioData->mBuffers[0].mData, self->samplerate, inNumberFrames); 105 | self->measurer->processOutput((short int *)ioData->mBuffers[0].mData); 106 | }; 107 | 108 | return noErr; 109 | } 110 | 111 | // Called when the stream format has been changed. Let's read the current samplerate. 112 | static void streamFormatChangedCallback(void *inRefCon, AudioUnit inUnit, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement) { 113 | if ((inScope == kAudioUnitScope_Output) && (inElement == 0)) { 114 | // Read the current sample rate. 115 | UInt32 size = 0; 116 | AudioUnitGetPropertyInfo(inUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &size, NULL); 117 | AudioStreamBasicDescription format; 118 | AudioUnitGetProperty(inUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &format, &size); 119 | 120 | ViewController *self = (__bridge ViewController *)inRefCon; 121 | self->samplerate = (int)format.mSampleRate; 122 | }; 123 | } 124 | 125 | // Setup everything. 126 | - (void)viewDidLoad { 127 | [super viewDidLoad]; 128 | mainTitle.text = [NSString stringWithFormat:@"Superpowered Latency Test v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; 129 | if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(recordPermission)] && [[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)] && ([[AVAudioSession sharedInstance] recordPermission] != AVAudioSessionRecordPermissionGranted)) { 130 | [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { 131 | if (granted) { 132 | dispatch_async(dispatch_get_main_queue(), ^{ 133 | [self finishLoading]; 134 | }); 135 | } 136 | }]; 137 | } else [self finishLoading]; 138 | } 139 | 140 | - (void)finishLoading { 141 | measurerState = -1000; 142 | measurer = new latencyMeasurer(); 143 | 144 | // Set up the audio session. Prefer 48 kHz and 64 samples. 145 | [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:NULL]; 146 | // Default mode adds 30 ms of additional latency for the built-in microphone on iOS devices from the first iPad Air. 147 | [[AVAudioSession sharedInstance] setMode:AVAudioSessionModeMeasurement error:NULL]; 148 | [[AVAudioSession sharedInstance] setPreferredSampleRate:48000 error:NULL]; 149 | [[AVAudioSession sharedInstance] setPreferredIOBufferDuration:64.0 / 48000.0 error:NULL]; 150 | [[AVAudioSession sharedInstance] setActive:YES error:NULL]; 151 | //[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil]; 152 | 153 | // Set up the RemoteIO audio input/output unit. 154 | AudioComponentDescription desc; 155 | desc.componentType = kAudioUnitType_Output; 156 | desc.componentSubType = kAudioUnitSubType_RemoteIO; 157 | desc.componentFlags = 0; 158 | desc.componentFlagsMask = 0; 159 | desc.componentManufacturer = kAudioUnitManufacturer_Apple; 160 | AudioComponent component = AudioComponentFindNext(NULL, &desc); 161 | if (AudioComponentInstanceNew(component, &au) != 0) abort(); 162 | 163 | UInt32 value = 1; 164 | if (AudioUnitSetProperty(au, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &value, sizeof(value))) abort(); 165 | value = 1; 166 | if (AudioUnitSetProperty(au, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &value, sizeof(value))) abort(); 167 | 168 | AudioUnitAddPropertyListener(au, kAudioUnitProperty_StreamFormat, streamFormatChangedCallback, (__bridge void *)self); 169 | 170 | // 16-bit interleaved stereo PCM. While the native audio format is different, conversion does not add any latency (just some CPU). 171 | AudioStreamBasicDescription format; 172 | format.mSampleRate = 0; 173 | format.mFormatID = kAudioFormatLinearPCM; 174 | format.mFormatFlags = kAudioFormatFlagIsSignedInteger; 175 | format.mBitsPerChannel = 16; 176 | format.mFramesPerPacket = 1; 177 | format.mBytesPerFrame = 4; 178 | format.mBytesPerPacket = 4; 179 | format.mChannelsPerFrame = 2; 180 | if (AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &format, sizeof(format))) abort(); 181 | if (AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &format, sizeof(format))) abort(); 182 | 183 | AURenderCallbackStruct callbackStruct; 184 | callbackStruct.inputProc = audioProcessingCallback; 185 | callbackStruct.inputProcRefCon = (__bridge void *)self; 186 | if (AudioUnitSetProperty(au, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callbackStruct, sizeof(callbackStruct))) abort(); 187 | 188 | AudioUnitInitialize(au); 189 | if (AudioOutputUnitStart(au)) abort(); 190 | 191 | // Our buttons are not regular buttons, but labels or images. Add tap events here. 192 | button.userInteractionEnabled = website.userInteractionEnabled = superpowered.userInteractionEnabled = YES; 193 | UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onButton:)]; 194 | [button addGestureRecognizer:gesture]; 195 | gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onWebsite:)]; 196 | [website addGestureRecognizer:gesture]; 197 | gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSuperpowered:)]; 198 | [superpowered addGestureRecognizer:gesture]; 199 | 200 | // Display system information. 201 | NSString *deviceModel = nil; 202 | struct utsname systemInfo; 203 | uname(&systemInfo); 204 | const char **m = machines[0]; 205 | while (m[0]) { 206 | if (strcmp(m[0], systemInfo.machine) == 0) { 207 | deviceModel = [NSString stringWithCString:m[1] encoding:NSASCIIStringEncoding]; 208 | break; 209 | }; 210 | m++; 211 | }; 212 | if (deviceModel == nil) deviceModel = [[UIDevice currentDevice] model]; 213 | model.text = deviceModel; 214 | os.text = [NSString stringWithFormat:@"iOS %@", [[UIDevice currentDevice] systemVersion]]; 215 | 216 | // Start updating the UI periodically. 217 | displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(UI_update)]; 218 | displayLink.frameInterval = 1; 219 | [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; 220 | } 221 | 222 | // Social sharing and website hooks. Let's hope this creates a small viral loop for us. :-) 223 | - (void)composeSocial:(NSString *)serviceType { 224 | dispatch_async(dispatch_get_main_queue(), ^{ 225 | SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:serviceType]; 226 | if (!controller) return; 227 | 228 | [controller setInitialText:[NSString stringWithFormat:@"I just tested my %@ with the Superpowered Latency Test App: %i ms.", self.model.text, self->measurer->latencyMs]]; 229 | [controller addURL:[NSURL URLWithString:@"http://superpowered.com/latency"]]; 230 | controller.completionHandler = ^(SLComposeViewControllerResult result) {}; 231 | 232 | [self presentViewController:controller animated:YES completion:NULL]; 233 | }); 234 | } 235 | - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { 236 | switch (buttonIndex) { 237 | case 0: if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) [self composeSocial:SLServiceTypeTwitter]; break; 238 | case 1: if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) [self composeSocial:SLServiceTypeFacebook]; break; 239 | case 2: { 240 | NSString *body = [NSString stringWithFormat:@"I just tested my %@ for audio latency.\r\n\r\nTotal roundtrip audio latency is %i ms.\r\nBuffer size is %i.\r\nSample rate is %i Hz.\r\n%@\r\n\r\nTest your mobile device's audio latency with the Superpowered Latency Test App for iOS and Android.\r\nhttp://superpowered.com/latency", model.text, measurer->latencyMs, measurer->buffersize, measurer->samplerate, os.text]; 241 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"mailto:?subject=%@&body=%@", [@"Audio Latency Result" stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [body stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]]; 242 | }; break; 243 | }; 244 | } 245 | - (IBAction)onWebsite:(id)sender { 246 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://superpowered.com/latency"]]; 247 | } 248 | - (IBAction)onSuperpowered:(id)sender { 249 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://superpowered.com"]]; 250 | } 251 | 252 | - (void)dealloc { 253 | [displayLink invalidate]; 254 | displayLink = nil; 255 | [[AVAudioSession sharedInstance] setActive:NO error:NULL]; 256 | AudioUnitUninitialize(au); 257 | AudioComponentInstanceDispose(au); 258 | delete measurer; 259 | } 260 | 261 | @end 262 | -------------------------------------------------------------------------------- /iOS/machines.h: -------------------------------------------------------------------------------- 1 | #ifndef SuperpoweredLatency_machines 2 | #define SuperpoweredLatency_machines 3 | 4 | const char *machines[][2] = { 5 | 6 | // iPhones 7 | 8 | { "iPhone1,1", "iPhone (first)" }, 9 | { "iPhone1,2", "iPhone 3G" }, 10 | { "iPhone2,1", "iPhone 3GS" }, 11 | { "iPhone3,1", "iPhone 4" }, 12 | { "iPhone3,3", "iPhone 4" }, 13 | { "iPhone4,1", "iPhone 4S" }, 14 | { "iPhone5,1", "iPhone 5" }, 15 | { "iPhone5,2", "iPhone 5" }, 16 | { "iPhone5,3", "iPhone 5c" }, 17 | { "iPhone5,4", "iPhone 5c" }, 18 | { "iPhone6,1", "iPhone 5s" }, 19 | { "iPhone6,2", "iPhone 5s" }, 20 | { "iPhone7,1", "iPhone 6 Plus" }, 21 | { "iPhone7,2", "iPhone 6" }, 22 | { "iPhone8,1", "iPhone 6s" }, 23 | { "iPhone8,2", "iPhone 6s Plus" }, 24 | { "iPhone8,4", "iPhone SE" }, 25 | { "iPhone9,1", "iPhone 7" }, 26 | { "iPhone9,2", "iPhone 7 Plus" }, 27 | { "iPhone9,3", "iPhone 7" }, 28 | { "iPhone9,4", "iPhone 7 Plus" }, 29 | { "iPhone10,1", "iPhone 8" }, 30 | { "iPhone10,2", "iPhone 8 Plus" }, 31 | { "iPhone10,3", "iPhone X" }, 32 | { "iPhone10,4", "iPhone 8" }, 33 | { "iPhone10,5", "iPhone 8 Plus" }, 34 | { "iPhone10,6", "iPhone X" }, 35 | { "iPhone11,2", "iPhone XS" }, 36 | { "iPhone11,4", "iPhone XS Max" }, 37 | { "iPhone11,6", "iPhone XS Max" }, 38 | { "iPhone11,8", "iPhone XR" }, 39 | { "iPhone12,1", "iPhone 11" }, 40 | { "iPhone12,3", "iPhone 11 Pro" }, 41 | { "iPhone12,5", "iPhone 11 Pro Max" }, 42 | { "iPhone12,8", "iPhone SE (2nd gen)" }, 43 | { "iPhone13,1", "iPhone 12 mini" }, 44 | { "iPhone13,2", "iPhone 12" }, 45 | { "iPhone13,3", "iPhone 12 Pro" }, 46 | { "iPhone13,4", "iPhone 12 Pro Max" }, 47 | { "iPhone14,2", "iPhone 13 Pro" }, 48 | { "iPhone14,3", "iPhone 13 Pro Max" }, 49 | { "iPhone14,4", "iPhone 13 mini" }, 50 | { "iPhone14,5", "iPhone 13" }, 51 | { "iPhone14,6", "iPhone SE (3rd gen)" }, 52 | { "iPhone14,7", "iPhone 14" }, 53 | { "iPhone14,8", "iPhone 14 Plus" }, 54 | { "iPhone15,2", "iPhone 14 Pro" }, 55 | { "iPhone15,3", "iPhone 14 Pro Max" }, 56 | 57 | // iPads 58 | 59 | { "iPad1,1", "iPad (first)" }, 60 | { "iPad2,1", "iPad 2" }, 61 | { "iPad2,2", "iPad 2" }, 62 | { "iPad2,3", "iPad 2" }, 63 | { "iPad2,4", "iPad 2" }, 64 | { "iPad2,5", "iPad mini (first)" }, 65 | { "iPad2,6", "iPad mini (first)" }, 66 | { "iPad2,7", "iPad mini (first)" }, 67 | { "iPad3,1", "iPad 3" }, 68 | { "iPad3,2", "iPad 3" }, 69 | { "iPad3,3", "iPad 3" }, 70 | { "iPad3,4", "iPad 4" }, 71 | { "iPad3,5", "iPad 4" }, 72 | { "iPad3,6", "iPad 4" }, 73 | { "iPad4,1", "iPad Air (first)" }, 74 | { "iPad4,2", "iPad Air (first)" }, 75 | { "iPad4,3", "iPad Air (first)" }, 76 | { "iPad4,4", "iPad mini 2" }, 77 | { "iPad4,5", "iPad mini 2" }, 78 | { "iPad4,6", "iPad mini 2" }, 79 | { "iPad4,7", "iPad mini 3" }, 80 | { "iPad4,8", "iPad mini 3" }, 81 | { "iPad4,9", "iPad mini 3" }, 82 | { "iPad5,3", "iPad Air 2" }, 83 | { "iPad5,4", "iPad Air 2" }, 84 | { "iPad6,11", "iPad (5th gen)" }, 85 | { "iPad6,12", "iPad (5th gen)" }, 86 | { "iPad6,3", "iPad Pro" }, 87 | { "iPad6,4", "iPad Pro" }, 88 | { "iPad6,7", "iPad Pro" }, 89 | { "iPad6,8", "iPad Pro" }, 90 | { "iPad7,1", "iPad Pro (2nd gen)" }, 91 | { "iPad7,11", "iPad (7th gen)" }, 92 | { "iPad7,12", "iPad (7th gen)" }, 93 | { "iPad7,2", "iPad Pro (2nd gen)" }, 94 | { "iPad7,3", "iPad Pro" }, 95 | { "iPad7,4", "iPad Pro" }, 96 | { "iPad7,5", "iPad (6th gen)" }, 97 | { "iPad7,6", "iPad (6th gen)" }, 98 | { "iPad8,1", "iPad Pro" }, 99 | { "iPad8,10", "iPad Pro (2nd gen)" }, 100 | { "iPad8,11", "iPad Pro (4th gen)" }, 101 | { "iPad8,12", "iPad Pro (4th gen)" }, 102 | { "iPad8,2", "iPad Pro" }, 103 | { "iPad8,3", "iPad Pro" }, 104 | { "iPad8,4", "iPad Pro" }, 105 | { "iPad8,5", "iPad Pro (3rd gen)" }, 106 | { "iPad8,6", "iPad Pro (3rd gen)" }, 107 | { "iPad8,7", "iPad Pro (3rd gen)" }, 108 | { "iPad8,8", "iPad Pro (3rd gen)" }, 109 | { "iPad8,9", "iPad Pro (2nd gen)" }, 110 | { "iPad11,1", "iPad mini (5th gen)" }, 111 | { "iPad11,2", "iPad mini (5th gen)" }, 112 | { "iPad11,3", "iPad Air (3rd gen)" }, 113 | { "iPad11,4", "iPad Air (3rd gen)" }, 114 | { "iPad11,6", "iPad (8th gen)" }, 115 | { "iPad11,7", "iPad (8th gen)" }, 116 | { "iPad12,1", "iPad (9th gen)" }, 117 | { "iPad12,2", "iPad (9th gen)" }, 118 | { "iPad13,1", "iPad Air (4th gen)" }, 119 | { "iPad13,10", "iPad Pro (5th gen)" }, 120 | { "iPad13,11", "iPad Pro (5th gen)" }, 121 | { "iPad13,16", "iPad Air (5th gen)" }, 122 | { "iPad13,17", "iPad Air (5th gen)" }, 123 | { "iPad13,18", "iPad (10th gen)" }, 124 | { "iPad13,19", "iPad (10th gen)" }, 125 | { "iPad13,2", "iPad Air 4 (4th gen)" }, 126 | { "iPad13,4", "iPad Pro (3rd gen)" }, 127 | { "iPad13,5", "iPad Pro (3rd gen)" }, 128 | { "iPad13,6", "iPad Pro (3rd gen)" }, 129 | { "iPad13,7", "iPad Pro (3rd gen)" }, 130 | { "iPad13,8", "iPad Pro (5th gen)" }, 131 | { "iPad13,9", "iPad Pro (5th gen)" }, 132 | { "iPad14,1", "iPad mini (6th gen)" }, 133 | { "iPad14,2", "iPad mini (6th gen)" }, 134 | { "iPad14,3-A", "iPad Pro (4th gen)" }, 135 | { "iPad14,3-B", "iPad Pro (4th gen)" }, 136 | { "iPad14,4-A", "iPad Pro (4th gen)" }, 137 | { "iPad14,4-B", "iPad Pro (4th gen)" }, 138 | { "iPad14,5-A", "iPad Pro (6th gen)" }, 139 | { "iPad14,5-B", "iPad Pro (6th gen)" }, 140 | { "iPad14,6-A", "iPad Pro (6th gen)" }, 141 | { "iPad14,6-B", "iPad Pro (6th gen)" }, 142 | 143 | 144 | // iPods 145 | 146 | { "iPod1,1", "iPod touch (first)" }, 147 | { "iPod2,1", "iPod touch (2nd gen)" }, 148 | { "iPod3,1", "iPod touch (3rd gen)" }, 149 | { "iPod4,1", "iPod touch (4th gen)" }, 150 | { "iPod5,1", "iPod touch (5th gen)" }, 151 | { "iPod7,1", "iPod touch (6th gen)" }, 152 | { "iPod9,1", "iPod touch (7th gen)" }, 153 | 154 | { NULL, NULL } 155 | }; 156 | 157 | #endif 158 | -------------------------------------------------------------------------------- /iOS/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AppDelegate.h" 3 | 4 | int main(int argc, char * argv[]) { 5 | @autoreleasepool { 6 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /iOS/superpowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/superpowered.png -------------------------------------------------------------------------------- /iOS/superpowered@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/superpowered@2x.png -------------------------------------------------------------------------------- /iOS/superpowered@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superpoweredSDK/SuperpoweredLatency/693e3a19f186136386166567ec35d963914f3139/iOS/superpowered@3x.png --------------------------------------------------------------------------------