<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1473</bug_id>
          
          <creation_ts>2023-10-04 09:54:09 +0200</creation_ts>
          <short_desc>ALAudioSink: AV Synchronization Broken, Regression in-between JogAmp Version [2.4.0 - 2.5.0]</short_desc>
          <delta_ts>2023-10-16 18:48:43 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Joal</product>
          <component>core</component>
          <version>2.6.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>1472</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>gluegen e23a4c7fcc0b585c0708be114fa364e391da4843
joal edf181e8a75f41c7d7e8de5d65c51d66f01fd61c
jogl d0dd0c04463c6b09b1f15ce6cc3a2c50286c57bf</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6918</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-10-04 09:54:09 +0200</bug_when>
    <thetext>See related Bug 1472, as detected here there first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6920</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-10-04 11:19:47 +0200</bug_when>
    <thetext>commit edf181e8a75f41c7d7e8de5d65c51d66f01fd61c 

    Bug 1473 - ALAudioSink: AV Synchronization Broken, Regression in-between JogAmp Version [2.4.0 - 2.5.0]
    
    - Adopt to simplified AudioSink
      - Add lastBufferedPTS and expose it
    - Cleanup short* and perf*String() trace/debug presentations to simplify review
      - Hence drop growBuffers()
    - Set initial avgFrameDuration to latency, at least a good start
    
    +++
    
    dequeueBuffer(..):
    - Pass releaseBufferCountReq directly, tangible only if wait == true,
      have enqueueData(..) determine the wait and releaseBufferCountReq value.
    - Drop dequeueBuffer(..) overload caller, simplifying code
    - Don&apos;t change playingPTS(..) in overload caller, enqueueData(..) takes care of it
    - Align DEBUG trace with enqueueData(..) to simplify review
    - Otherwise no semnatic change in dequeueBuffer(..)
    
    enqueueData(..):
    - Dropped growBuffers()
    - Show DEBUG trace before actual dequeueBuffer(..) to have meanigful output
    - SOFT (no-wait) dequeueBuffer(..) triggers on 2/3rd full queue
    - HARD (wait) dequeueBuffer(..) if queue is full
    - Set playingPTS, either use
      - old queue-tip (too old) and add (forward) 60% of queue-buffer time
      - new queue-tail (too young), subtract (delay) 40% of queue-buffer time</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6921</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-10-04 11:20:51 +0200</bug_when>
    <thetext>Commit e23a4c7fcc0b585c0708be114fa364e391da4843

    AudioSink: Just pass a finte buffer size (KISS), add getLastBufferedPTS() to access the last buffered audio pts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6922</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-10-04 11:36:43 +0200</bug_when>
    <thetext>Commit d0dd0c04463c6b09b1f15ce6cc3a2c50286c57bf

ALAudioSink: AV Synchronization: Adopt to JOAL ALAudioSink changes
    
    FFMPEGMediaPlayer: This also effectively reduces the audio buffer size from 3000ms -&gt; 768ms,
    the new default for audio streams with video.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6928</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-10-15 07:16:18 +0200</bug_when>
    <thetext>Resolved, see further fixes in Bug 1472</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>