@@ -86,8 +86,6 @@ public partial class OsuGameAndroid : OsuGame
8686 private OboeAudioRedirector ? audioRedirector ;
8787 private Delegate ? activeMixersHandler ;
8888 private object ? activeMixersList ;
89- private IntPtr updateAdpfSession ;
90- private IntPtr renderAdpfSession ;
9189
9290 /// <summary>
9391 /// Boxed reference to the native bridge manager.
@@ -211,24 +209,22 @@ protected override void LoadComplete()
211209 try
212210 {
213211 // Target 1ms (1,000,000ns) for 1000 FPS target.
214- updateAdpfSession = OboeAudioBridge . nADPFCreateSession ( 1000000 ) ;
212+
215213
216214 Scheduler . Add ( ( ) =>
217215 {
218216 Host . DrawThread . Scheduler . Add ( ( ) =>
219217 {
220218 try
221219 {
222- renderAdpfSession = OboeAudioBridge . nADPFCreateSession ( 1000000 ) ;
223220
224- if ( renderAdpfSession != IntPtr . Zero )
221+
225222 Debug . WriteLine ( "[osu!] ADPF Performance Hint Session created for Render thread" ) ;
226223 }
227224 catch { }
228225 } ) ;
229226 } ) ;
230227
231- if ( updateAdpfSession != IntPtr . Zero )
232228 Debug . WriteLine ( "[osu!] ADPF Performance Hint Session created for Update thread" ) ;
233229 }
234230 catch { }
@@ -267,9 +263,6 @@ protected override void LoadComplete()
267263 {
268264 startOboeBridge ( latency =>
269265 {
270- if ( Math . Abs ( audioOffset . Value ) >= 0.01 )
271- return ;
272-
273266 double suggested = Math . Clamp ( - latency , audioOffset . MinValue , audioOffset . MaxValue ) ;
274267 audioOffset . Value = suggested ;
275268 Debug . WriteLine ( $ "[osu!] Audio offset auto-suggested: { suggested : F1} ms (hardware latency={ latency : F1} ms)") ;
@@ -404,6 +397,12 @@ private void selectHighestRefreshRate()
404397
405398 public override bool IsVulkanSupported => ( nativeBridges as AndroidNativeBridgeManager ) ? . IsVulkanAvailable ( ) ?? false ;
406399
400+ public override bool IsOboeActive => ( nativeBridges as AndroidNativeBridgeManager ) ? . IsOboeActive ( ) ?? false ;
401+
402+ public override string OboeStatus => ( nativeBridges as AndroidNativeBridgeManager ) ? . GetOboeStatus ( ) ?? string . Empty ;
403+
404+ public override double OboeLatency => ( nativeBridges as AndroidNativeBridgeManager ) ? . GetMeasuredAudioLatencyMs ( ) ?? - 1 ;
405+
407406 private void onActiveMixersChanged ( object ? sender , NotifyCollectionChangedEventArgs args ) => Schedule ( ( ) => { if ( lowLatencyAudio . Value ) audioRedirector ? . RefreshMixers ( 0 ) ; } ) ;
408407
409408 public double GetMeasuredAudioLatencyMs ( ) => getMeasuredAudioLatencyFromBridge ( ) ;
@@ -543,37 +542,11 @@ protected override void Dispose(bool isDisposing)
543542
544543 if ( nativeBridges != null )
545544 disposeNativeBridges ( ) ;
546-
547- if ( updateAdpfSession != IntPtr . Zero )
548- {
549- OboeAudioBridge . nADPFCloseSession ( updateAdpfSession ) ;
550- updateAdpfSession = IntPtr . Zero ;
551- }
552-
553- if ( renderAdpfSession != IntPtr . Zero )
554- {
555- OboeAudioBridge . nADPFCloseSession ( renderAdpfSession ) ;
556- renderAdpfSession = IntPtr . Zero ;
557- }
558545 }
559546 }
560547
561548 [ MethodImpl ( MethodImplOptions . AggressiveOptimization ) ]
562- protected override void UpdateAfterChildren ( )
563- {
564- if ( updateAdpfSession == IntPtr . Zero )
565- {
566- base . UpdateAfterChildren ( ) ;
567- return ;
568- }
569-
570- long startTime = Stopwatch . GetTimestamp ( ) ;
571- base . UpdateAfterChildren ( ) ;
572- long elapsedTicks = Stopwatch . GetTimestamp ( ) - startTime ;
573- long elapsedNanos = ( elapsedTicks * 1000000000 ) / Stopwatch . Frequency ;
574-
575- OboeAudioBridge . nADPFReportActualDuration ( updateAdpfSession , elapsedNanos ) ;
576- }
549+ protected override void UpdateAfterChildren ( ) => base . UpdateAfterChildren ( ) ;
577550
578551 }
579552
0 commit comments