GithubHelp home page GithubHelp logo

Comments (4)

metaphore avatar metaphore commented on June 22, 2024 1

I think you're right about the device-specific nature of the case. I couldn't find any similar reports about Oboe anywhere and it doesn't seem like any of the emulators share the same problem.

However, I have two Pixel 3 phones and they both have lower output volume with libgdx-oboe.

Anyway, it's not nearly a critical bug and it doesn't worth any more time spent investigating it. I'd suggest just keeping this issue open till there are more details available. Hopefully, someone else will notice the same behavior sometime soon.

from libgdx-oboe.

barsoosayque avatar barsoosayque commented on June 22, 2024

I tested this on music example and on my device there is no difference (or possibly I don't hear very well 😢). AFAIR there is nothing in Oboe itself that would create such effect, although there is an option that can indirectly cause that. On some android APIs there are different settings of audio volume per "usage group", and in libgdx-oboe, the usage group is Game (oboe_engine.cpp:52). Perhaps in the default implementation it's different and that is what causing the volume to be different as well, though, I'm really not sure about that.

As a workaround, I can implement a master volume just for OboeAudio, it's a rather easy thing to do, definitely much easier than going into the android audio stack rabbit hole once more.

from libgdx-oboe.

metaphore avatar metaphore commented on June 22, 2024

A good point about the audio attributes!
But I can see that the default Android audio implementation uses USAGE_GAME either.

Audio attributes for the sound pool (all game sounds use it):

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
	AudioAttributes audioAttrib = new AudioAttributes.Builder()
		.setUsage(AudioAttributes.USAGE_GAME)
		.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
		.build();
	soundPool = new SoundPool.Builder()
		.setAudioAttributes(audioAttrib)
		.setMaxStreams(config.maxSimultaneousSounds)
		.build();
} else {
	soundPool = new SoundPool(config.maxSimultaneousSounds, AudioManager.STREAM_MUSIC, 0); // srcQuality: the sample-rate
											       // converter quality. Currently
											       // has no effect. Use 0 for the
											       // default.
}
manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
if (context instanceof Activity) {
	((Activity)context).setVolumeControlStream(AudioManager.STREAM_MUSIC);
}

Music instance creation:

protected MediaPlayer createMediaPlayer () {
    MediaPlayer mediaPlayer = new MediaPlayer();
    if (Build.VERSION.SDK_INT <= 21) {
	mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    } else {
	mediaPlayer.setAudioAttributes(new AudioAttributes.Builder()
		.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
		.setUsage(AudioAttributes.USAGE_GAME).build());
    }
    return mediaPlayer;
}

I checked again the game with and without Oboe on my Pixel 3 (Android 12). I can't spot any difference in the sound slider or in the sound settings menu. It always changes the volume under the "Media volume" slider. And the perceived output volume is dramatically different under the same system's "Media volume" value for both sound effects and music.

from libgdx-oboe.

barsoosayque avatar barsoosayque commented on June 22, 2024

Oh. My thoughts on that is because I don't hear any difference on my device, it must be device specific, hence this issue is something with google/oboe (either AAudio implementation or oboe wrapper itself). I didn't test extensively though, so I hope I can test a little bit more and actually find a repro and fix this, though, I haven't worked with neither android nor audio in a while, it will take some time. If you have time and dedication to test this further (I know I don't, but I'll try when I can), there is OboeTester app (part of google/oboe repo), it supposed to tell you if your device has audio glitches; you might want to try that to see if there any anomalies like the audio volume in this particular issue.

from libgdx-oboe.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.