google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.7k stars 566 forks source link

OboeTester loopback should work with low volume #1917

Open philburk opened 1 year ago

philburk commented 1 year ago

Some devices, such as the Creative SB4! have low loopback gain. We need to tune the Glitch Tests and RT Latency to work better with low volume.

robertwu1 commented 1 year ago

In LatencyAnalyzer.h, the pulse doesn't change depending on the device and the audio recording is normalized to 1.0f. The min confidence is .2 (kMinimumConfidence = 0.2;) which seems reasonable.

            float gain = mAudioRecording.normalize(1.0f);
            measureLatencyFromPulse(mAudioRecording,
                                    mPulse,
                                    &mLatencyReport);

In GlitchAnalyzer.h, the SNR is set as 65 (MIN_SNR_DB = 65). Perhaps we should reduce this.

Look at Amazon FAQs of the Sound Blaster PLAY! 4.

3. Why does the Sound Blaster PLAY! 4 sound louder on PC / Mac compared to Android devices?

PC has the capability to control both the media playback volume of the media player and USB audio volume of Sound Blaster PLAY! 4. Under most cases, the default media playback volume is always set to maximum on the media player software. On Android phones, you are only allowed to control the media playback volume and not the USB audio volume. Furthermore, the default media player volume is normally set to 50% or lower on most phones, thus it will sound softer compared to PC / Mac. For more power output, switch the Sound Blaster PLAY! 4 to USB Mode 1, as detailed in following FAQs.

4. How do I know which USB Mode is my Sound Blaster PLAY! 4 in?

When powering on, the LED indicator on the EQ button will flash either blue or white to indicate the USB Mode that it's in:
USB Mode 1: The LED indicator will flash Blue 5 times
USB Mode 2: The LED indicator will flash White 5 times (Do note that the Sound Blaster PLAY! 4 is set to USB Mode 2 by default)

5. What are the differences between USB Mode 1 and USB Mode 2? What are the recommended modes?

USB Mode 1 is best suited for gaming consoles such as PS4, PS5, and mobile devices, and supports playback resolution of up to 24-bit / 96 kHz. USB Mode 2 is recommended for Windows and Mac systems and supports playback resolution of up to 24-bit / 192 kHz. We also recommend using USB Mode 2 if your intended primary platform for the Sound Blaster PLAY! 4 is PC or Mac, and using USB Mode 1 if your intended primary platform is on gaming consoles and mobile devices.

6. How do I switch between USB Mode 1 and 2? Will the Sound Blaster PLAY! 4 remember the USB Mode after I've set it?

While connected and powered on by a device, switch between USB Mode 1 and 2 via the following steps:
Press and hold the EQ button for approximately 2 seconds
When the LED indicator on the EQ button flashes Blue 5 times, the Sound Blaster PLAY! 4 is set to USB Mode 1
To set the device into USB Mode 2, press and hold the EQ button for approximately 2 seconds. When the LED indicator on the EQ button flashes White 5 times, the Sound Blaster PLAY! 4 is set to USB Mode 2
Sound Blaster PLAY! 4 will remember the last USB Mode that it has been set to, i.e. if the device is set to USB Mode 2, it will remain in USB Mode 2.
robertwu1 commented 1 year ago

Note that that Creative SB4 is marketed With Auto Mute and Two-way Noise Cancellation. Maybe the Creative SB4 thinks our outputs from our tests are noise and treats them accordingly when the same input comes in from the funplug.

robertwu1 commented 1 year ago

If you have a Windows computer, you can try removing VoiceDetect and NoiseClean.

SUPER EASY TO SET UP – VoiceDetect and NoiseClean are part of our SmartComms Kit's suite of smart communication features. Simply plug the PLAY! 4 to your PC, download the Creative app (for Windows 10 and later) to get started, or further customize them via the Advanced settings. The software also comes with Sound Blaster Acoustic Engine, our suite of industry-leading audio processing technology like Surround immersion, and CrystalVoice that enhances voice clarity during video calls
philburk commented 1 year ago

USB Mode 2: The LED indicator will flash White 5 times

When I plug a SB 4 into a Macbook it flashes 5 times. When I plug it into a Pixel 7 Pro it flashes 2.1 times, pauses then flashes 2.1 times again!

I configured the SB4 to use HW Volume COntrol by long pressing the mute button for >2 seconds. Then I pressed the + button (AKA mute) many times while running the Round Trip Latency test. The rms.signal increased up to 0.64. This did not cause the Android Volume faders to move. Then I was able to reduce the Android volume fader to a reasonable and the test worked. So the gain in the SB4 can be changed. Note than when the SB4 is unplugged it reverts to a low HW volume.