Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@Ant1r
Copy link
Contributor

@Ant1r Ant1r commented Dec 30, 2025

This implements the native interface for the Oboe audio driver library.

It takes care of the buffer size conversion between Pd and Oboe, separately for input and output (since Oboe can provide less input samples than output ones, mainly on start).

The new pdnativeoboe.so is now loaded by PdBase loader when on Android, replacing the previous pdnativeopensl.so.

Closes #284.

This PR is similar to #422, but involves less change in the Java API.

@Ant1r Ant1r mentioned this pull request Dec 30, 2025
@joebowbeer
Copy link
Contributor

Why is this a draft?

Do you want to (first) create a PR in pd-for-android that uses this commit?

@Ant1r
Copy link
Contributor Author

Ant1r commented Jan 5, 2026

Why is this a draft

First, I wanted we discuss and decide which way is better.

Also, I wanted to test some other additions, mainly getter and setter for buffersize, latency and xruns.
I'm almost done for the latter, so I'll finalize it and remove the Draft flag.

Then I'll prepare a PR for updating pd-for-android.

@Ant1r Ant1r marked this pull request as ready for review January 5, 2026 10:54
@Ant1r
Copy link
Contributor Author

Ant1r commented Jan 5, 2026

So I've added a getter for runtime info from the audio implementation. With Oboe, this can be used to detect xruns, or query the latency, for example for abl_link fine tuning purpose.

The PR for pd-for-android is ready (libpd/pd-for-android#173).

I think that's enough for me now, ready for review!

@danomatika
Copy link
Member

Looks good to me. The only detail I can think of is perhaps naming "inputDeviceId" / "outputDeviceId" without the "id" naming ala "inputDevice" but I assume this is a convention used by Oboe / Android and, if so, let's keep it.

@Ant1r
Copy link
Contributor Author

Ant1r commented Jan 7, 2026

yes, the naming in Oboe is deviceId, as in:

AudioStreamBuilder * oboe::AudioStreamBuilder::setDeviceId (int32_t deviceId)

(see https://google.github.io/oboe/classoboe_1_1_audio_stream_builder.html#a69c0a23e7ef57bced029ef2193cfe741)
and in Android Java we get the id with:

AudioDeviceInfo.getId(); // The internal device ID.

(see https://developer.android.com/reference/android/media/AudioDeviceInfo#getId())

@danomatika danomatika added the todo label Jan 7, 2026
@danomatika
Copy link
Member

Ping @joebowbeer

@joebowbeer
Copy link
Contributor

Re. naming, if the single parameter is an 'id' then the method name should be an 'id'

I don't see any red flags, so LGTM.

I do wish there were more automated checks in this repo: build everything incl. Java, lint, unit test, smoke test (e2e). That would give me more confidence as a reviewer. I also suggest protecting the master branch.

@danomatika danomatika merged commit 3636048 into libpd:master Jan 7, 2026
5 checks passed
@danomatika
Copy link
Member

I do wish there were more automated checks in this repo: build everything incl. Java, lint, unit test, smoke test (e2e). That would give me more confidence as a reviewer. I also suggest protecting the master branch.

I am pretty behind with any CI stuff. Feel free to make a PR to the yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace OpenSL with Oboe for Android

3 participants