audio sync problem on version 1.7.0-alpha01 & 1.6.0-rc01

47 views
Skip to first unread message

Arbel Solutions

unread,
Mar 17, 2026, 9:11:40 AM (2 days ago) Mar 17
to Android CameraX Discussion Group
I have noticed the same problems on multiple apps that I have.

Since those versions - the audio is not in sync - 
the recording is closing only after a couple of seconds, and in the recording - the audio is attached not in place. the video is also jumping and not fluent. 

I have attached a log from the failure and one from a working stable 1.5.3.
changing to 1.5.3 fixed all the sync problems.



1.7.0-error.txt
1.5.3.txt

Leo Huang

unread,
Mar 17, 2026, 11:09:17 AM (2 days ago) Mar 17
to Arbel Solutions, Android CameraX Discussion Group
Hi, 
Thanks for reporting the issue. I was unable to reproduce the problem using my local device. Some questions:
Does the issue happen on a specific device or multiple devices? Could you share the device model?
If the issue is easy to reproduce, could you also try other versions such as 1.6.0-beta02, 1.6.0-beta01 and 1.6.0-alpha02.
This would help us narrow down the possible changes. Thank you


Arbel Solutions <arbelso...@gmail.com> 於 2026年3月17日週二 下午9:11寫道:
--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/f6b8a500-eb04-4950-805a-44c0753a619en%40android.com.

Arbel Solutions

unread,
Mar 17, 2026, 11:24:07 AM (2 days ago) Mar 17
to Android CameraX Discussion Group, leoh...@google.com, Android CameraX Discussion Group, Arbel Solutions
I have a Pixel 9. it just starts to happens after a couple of recording. sometimes immediately.
I do not think it related to the model.
I got many complains about my apps lately , my cameraX motion detection video recording created errors. and the "BVR Pro" cameraX engine showed also some problems.
the latest apps using those CameraX versions created black videos or videos without audio. 
I think versions   1.6.0-beta02, 1.6.0-beta01 were OK - I did not get many complains until   1.6.0-rc01.
but since I use mostly Cmaera2 on my apps - I cannot be sure. 
Is the log not enough? I will try to upgrade and produce more logs - but it will take time - I need to release some new features. 

from the logs - it mostly looks like the media muxer did not sync the audio thread and the video thread correctly. 
Arbel

Leo Huang

unread,
Mar 18, 2026, 6:13:28 AM (23 hours ago) Mar 18
to Android CameraX Discussion Group, arbelso...@gmail.com, Leo Huang, Android CameraX Discussion Group

Thanks for the detailed report and for specifying that you're using a Pixel 9.

I have attempted to reproduce the issue on a local Pixel 9 but was unable to observe the same behavior. This suggests there might be differences in the implementation or specific configuration. Could you share a code snippet of how you are setting up?

Regarding the versioning, 1.6.0-rc01 should be functionally identical to 1.6.0-beta02 for the camera-video artifact, as no related changes were introduced in that release.

I've reviewed the attached logs but haven't found an obvious failure yet. Could you clarify what you mean by "the muxer not syncing the audio and video threads correctly"? It would also be very helpful if you could provide more complete logs (including a more detail successful recording by 1.5.3 for comparison), with log tags and thread IDs visible.

One significant change in 1.6.0-beta02 was the migration to the Media3 Muxer. As a diagnostic test, you can try reverting to the platform MediaMuxer to see if it resolves the issue. You can modify your code for creating Recorder using the following restricted APIs:

```
// Note: setMuxerFactory, MuxerFactory and MediaMuxerImpl are not public and may change.
// Add @SuppressLint("RestrictedApiAndroidX") if needed
Recorder.Builder builder = new Recorder.Builder();
builder.setMuxerFactory(new MuxerFactory() {
    @Override
    public @NonNull Muxer create(int outputFormat) {
        Logger.d("Test", "MediaMuxerImpl fallback");  // Confirm the log is printed after start recording.
        return new MediaMuxerImpl();
    }
});
```

arbelso...@gmail.com 在 2026年3月17日 星期二晚上11:24:07 [UTC+8] 的信中寫道:

Arbel Solutions

unread,
Mar 18, 2026, 8:25:41 AM (21 hours ago) Mar 18
to Android CameraX Discussion Group, leoh...@google.com, Arbel Solutions, Android CameraX Discussion Group
Could be that your code fixes it.

I have updated to 1.7.0 - it took couple of recording and it happens again.
here are some extra logs - in the 2 "BVR1.7.0"  you can see exactly what I mean.

"what do I mean - the muxer do not closed correctly."
from my personal experience - when the muxer, the audio codec and the video codec which runs on different threads are not in sync. this logs appears.
sometimes also cause of wrong timestamps.
on closing of the video - my app is waiting couple of seconds which means that one thread is still waiting on the join thread.




I see a lot of this messages : 
"plementalItem in surface: home [CONTEXT ratelimit_period="10 SECONDS" ]
13:09:31.520  I  #remoteViewsTwiddler: feature disabled.
13:09:31.524  I  #postPredictionTargets: Sending updates to UISurface lockscreen with targets# 1 (types=[1])
13:09:31.525  I  #postPredictionTargets: Sending updates to UISurface ambientcue with targets# 0 (types=[])
13:09:31.525  I  Receiving SmartSpace targets # 0
13:09:31.528  I  setFormattedContentDescription: text=8°C, iconDescription=Mostly cloudy day, contentDescription=Mostly cloudy day 8°C
13:09:31.528  I  #postPredictionTargets: Sending updates to UISurface home with targets# 1 (types=[1])
13:09:31.528  I  setFormattedContentDescription: text=8°C, iconDescription=Mostly cloudy day, contentDescription=Mostly cloudy day 8°C
13:09:31.528  I  Weather data parsed MOSTLY_CLOUDY_DAY ("Mostly cloudy day") 8°C from Bundle[{description=Mostly cloudy day, feedback_intent=null, explanation_intent=Supplier{VAL_PARCELABLE@160+1920}, is_gaia_linked_data=true, use_celsius=true, state=7, temperature=8}]
13:09:31.528  W  Drop audio data due to full of queue.
13:09:31.531  I  #postPredictionTargets: Sending updates to UISurface lockscreen with targets# 1 (types=[1])
13:09:31.532  I  #postPredictionTargets: Sending updates to UISurface ambientcue with targets# 0 (types=[])
13:09:31.533  I  Receiving SmartSpace targets # 0
13:09:31.534  I  #postPredictionTargets: Sending updates to UISurface home with targets# 1 (types=[1])
13:09:31.537  I  setFormattedContentDescription: text=8°C, iconDescription=Mostly cloudy day, contentDescription=Mostly cloudy day 8°C
13:09:31.537  I  setFormattedContentDescription: text=8°C, iconDescription=Mostly cloudy day, contentDescription=Mostly cloudy day 8°C
13:09:31.537  I  Weather data parsed MOSTLY_CLOUDY_DAY ("Mostly cloudy day") 8°C from Bundle[{description=Mostly cloudy day, feedback_intent=null, explanation_intent=Supplier{VAL_PARCELABLE@160+1920}, is_gaia_linked_data=true, use_celsius=true, state=7, temperature=8}]
13:09:31.549  W  Drop audio data due to full of queue.
13:09:31.568  W  Drop audio data due to full of queue.
13:09:31.581  D  [77320]< UPDATE_DEVICE_STATE
13:09:31.586  I  GetImpedances: speaker [0] impedance: 100 Ohms
13:09:31.586  I  GetImpedances: speaker [1] impedance: 100 Ohms
13:09:31.586  I  GetTemperatures: DSP1 Protection cd BDLOG_MAX_TEMP Max temp: 0x1a4e24 ==> 105.221 C
13:09:31.587  I  GetTemperatures: R DSP1 Protection cd BDLOG_MAX_TEMP Max temp: 0x17dfa6 ==> 95.4945 C
13:09:31.587  I  GetExcursions: DSP1 Protection cd BDLOG_MAX_EXC Max exc: 0x39999 ==> 0.449999 mm
13:09:31.587  I  GetExcursions: R DSP1 Protection cd BDLOG_MAX_EXC Max exc: 0x3ffff ==> 0.499998 mm
13:09:31.587  I  GetHeartBeats: DSP1 Protection 400a4 HALO_HEARTBEAT dsp heartbeat = 0x127d4
13:09:31.587  I  GetHeartBeats: R DSP1 Protection 400a4 HALO_HEARTBEAT dsp heartbeat = 0x127d5
13:09:31.589  W  Drop audio data due to full of queue.
13:09:31.609  W  Drop audio data due to full of queue.
13:09:31.628  W  Drop audio data due to full of queue.
13:09:31.648  W  Drop audio data due to full of queue.
13:09:31.668  W  Drop audio data due to full of queue.
13:09:31.689  W  Drop audio data due to full of queue.
13:09:31.708  W  Drop audio data due to full of queue.
13:09:31.728  W  Drop audio data due to full of queue.
13:09:31.734  D  sync unfroze 3789 com.google.android.settings.intelligence for 6
13:09:31.749  D  sync unfroze 12443 com.facebook.katana for 6
13:09:31.751  D  sync unfroze 12837 com.facebook.katana:sandboxed_process0:com.facebook.browser.helium.content.SandboxedProcessService0:0 for 6
13:09:31.753  D  sync unfroze 12829 com.facebook.katana:zygote_warmer:com.facebook.browser.helium.preload.AppZygoteWarmerService for 6
13:09:31.785  W  Drop audio data due to full of queue.
13:09:31.786  W  Drop audio data due to full of queue.
13:09:31.798  W  Drop audio data due to full of queue.
13:09:31.806  D  Video data reaches duration limit 20000655 > 20000000
13:09:31.807  D  Video data reaches duration limit 20067323 > 20000000
13:09:31.808  D  Video data reaches duration limit 20133993 > 20000000
13:09:31.809  D  Video data reaches duration limit 20200661 > 20000000
13:09:31.809  D  Video data reaches duration limit 20267329 > 20000000
13:09:31.810  D  Video data reaches duration limit 20333999 > 20000000
13:09:31.811  D  Video data reaches duration limit 20400667 > 20000000
13:09:31.811  D  Video data reaches duration limit 20467205 > 20000000
13:09:31.812  D  Video data reaches duration limit 20534005 > 20000000
13:09:31.812  D  Video data reaches duration limit 20600675 > 20000000
13:09:31.813  D  Video data reaches duration limit 20667343 > 20000000
13:09:31.814  D  Video data reaches duration limit 20734011 > 20000000
13:09:31.814  D  Video data reaches duration limit 20800681 > 20000000
13:09:31.815  D  Video data reaches duration limit 20867349 > 20000000
13:09:31.816  D  Video data reaches duration limit 20934019 > 20000000
13:09:31.816  D  Video data reaches duration limit 21000687 > 20000000
13:09:31.817  D  Video data reaches duration limit 21067355 > 20000000
13:09:31.817  D  Video data reaches duration limit 21134025 > 20000000
13:09:31.818  D  Video data reaches duration limit 21200693 > 20000000
13:09:31.819  D  Video data reaches duration limit 21267363 > 20000000
13:09:31.819  D  Video data reaches duration limit 21334031 > 20000000
13:09:31.820  D  Video data reaches duration limit 21400701 > 20000000
13:09:31.821  D  Video data reaches duration limit 21467297 > 20000000
13:09:31.821  D  Video data reaches duration limit 21534037 > 20000000
13:09:31.821  W  Tracking association SourceState{c307414 system/1000 ImpBg #1577681} whose proc state 6 is better than process ProcessState{eb1a2f com.facebook.katana/10319 pkg=com.facebook.katana} proc state 14 (2 skipped)
13:09:31.822  D  Video data reaches duration limit 21600707 > 20000000
13:09:31.822  D  Video data reaches duration limit 21667375 > 20000000
13:09:31.823  D  Video data reaches duration limit 21734045 > 20000000
13:09:31.823  D  Video data reaches duration limit 21800713 > 20000000
13:09:31.824  D  Video data reaches duration limit 21867383 > 20000000
13:09:31.824  D  Video data reaches duration limit 21934051 > 20000000
13:09:31.825  D  Video data reaches duration limit 22000719 > 20000000
13:09:31.825  D  Video data reaches duration limit 22067389 > 20000000
13:09:31.826  D  Video data reaches duration limit 22134057 > 20000000
13:09:31.827  D  Video data reaches duration limit 22200727 > 20000000
13:09:31.828  D  Video data reaches duration limit 22267395 > 20000000
13:09:31.828  D  Video data reaches duration limit 22334065 > 20000000
13:09:31.829  W  Drop audio data due to full of queue.
13:09:31.830  D  Video data reaches duration limit 22400733 > 20000000
13:09:31.831  D  Video data reaches duration limit 22467401 > 20000000
13:09:31.831  D  Video data reaches duration limit 22534071 > 20000000
13:09:31.832  D  Video data reaches duration limit 22600739 > 20000000
13:09:31.833  D  Video data reaches duration limit 22667409 > 20000000
13:09:31.834  D  Video data reaches duration limit 22734077 > 20000000
13:09:31.834  D  Video data reaches duration limit 22800745 > 20000000
13:09:31.835  D  Video data reaches duration limit 22867415 > 20000000
13:09:31.835  D  Video data reaches duration limit 22934069 > 20000000
13:09:31.835  D  Video data reaches duration limit 23000753 > 20000000
13:09:31.836  D  Video data reaches duration limit 23067421 > 20000000"


This is my code after your recommendation - It works for the last 10 minutes which is maybe ok

if (isVideoRecordingAllowed) {

if (videoCapture == null) {

QualitySelector selector = null;

int selectorFromPref = 0;
try {
selectorFromPref = Integer.parseInt(
mSharedPreferences.getString("listCameraXRes", "2")
);
} catch (Exception ex) {
AppendLogError(ex.toString());
}

// =====================================================
// DEVICE ROTATION (SAFE IN SERVICE)
// =====================================================
int deviceRotation = Surface.ROTATION_0;
try {
WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
if (wm != null) {
Display display = wm.getDefaultDisplay();
if (display != null) {
deviceRotation = display.getRotation();
}
}
} catch (Exception ex) {
AppendLogError("Rotation error: " + ex);
}
AppendLogDebug("CameraX TargetRotation = " + deviceRotation);

// =====================================================
// QUALITY SELECTOR LOGIC
// =====================================================

if (selectorFromPref == 0 && isWearOSRemote) {

// Prefer 2160p if available (non-HDR)
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_2160P) && !cameraxHDR) {

CamcorderProfile p = CamcorderProfile.get(CamcorderProfile.QUALITY_2160P);
int fps = p.videoFrameRate;

if (fps == 60) {
selectedFPSHigh = 60;
selectedFPSLow = 60;
}

AppendLogDebug("2160p: " + p.videoFrameWidth + "x" + p.videoFrameHeight + " @ " + fps + "fps");

selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.UHD, Quality.FHD, Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);

}
// Else prefer 1080p
else if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_1080P) && !cameraxHDR) {

CamcorderProfile p = CamcorderProfile.get(CamcorderProfile.QUALITY_1080P);
int fps = p.videoFrameRate;

if (fps == 60) {
selectedFPSHigh = 60;
selectedFPSLow = 60;
}

AppendLogDebug("1080p: " + p.videoFrameWidth + "x" + p.videoFrameHeight + " @ " + fps + "fps");

selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.FHD, Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);

} else {
// Fallback: FHD → HD → SD
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.FHD, Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);
}

} else if (shaderCameraX == Constants.CameraX_FilterType.DUAL
|| cameraxDual
|| cameraxWatermnark
|| cameraxHDR) {

// For dual / watermark / HDR: keep resolutions moderate
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.FHD, Quality.HD, Quality.SD, Quality.LOWEST),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);

} else {

// Default: let CameraX pick the highest possible
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(
Quality.HIGHEST,
Quality.UHD,
Quality.FHD,
Quality.HD,
Quality.SD
),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);
}

// =====================================================
// MANUAL QUALITY OVERRIDE FROM PREF
// =====================================================
switch (selectorFromPref) {
case 1:
// UHD → FHD → HD → SD
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.UHD, Quality.FHD, Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);
break;

case 2:
// FHD → HD → SD
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.FHD, Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);
break;

case 3:
// HD → SD
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.HD, Quality.SD),
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
);
break;

case 4:
// SD only
selector = QualitySelector.from(Quality.SD);
break;

case 5:
// SD → LOWEST
selector = QualitySelector.fromOrderedList(
java.util.Arrays.asList(Quality.SD, Quality.LOWEST),
FallbackStrategy.lowerQualityOrHigherThan(Quality.LOWEST)
);
break;

case 0:
default:
// 0 = "auto" → keep selector as computed above
break;
}

// =====================================================
// RECORDER BUILDER
// =====================================================
//Recorder recorder = new Recorder.Builder()
// .setQualitySelector(selector)
// .build();
Recorder.Builder builder2 = new Recorder.Builder().setQualitySelector(selector);
builder2.setMuxerFactory(new MuxerFactory() {

@Override
public @NonNull Muxer create(int outputFormat) {
AppendLogDebug("MediaMuxerImpl fallback"); // Confirm the log is printed after start recording.
return new MediaMuxerImpl();
}
});
Recorder recorder = builder2.build();


// =====================================================
// VIDEO CAPTURE BUILDER
// =====================================================

if (useBasic) {
// Basic builder path, no FPS/HDR tweaks
videoCapture = new VideoCapture.Builder<>(recorder)
.setTargetRotation(deviceRotation)
.build();

} else {

VideoCapture.Builder<Recorder> builder = new VideoCapture.Builder<>(recorder)
.setVideoStabilizationEnabled(IsStabilizationEnabled)
.setTargetRotation(deviceRotation);

// ------------- FPS LOGIC -------------------
if (force60FPS) {
AppendLogDebug("Forcing FPS = 60 (setTargetFrameRate)");
try {
builder.setTargetFrameRate(new Range<>(60, 60));
} catch (Exception ex) {
AppendLogError("setTargetFrameRate(60,60) failed: " + ex);
}
} else if (selectedFPSHigh > 0) {
AppendLogDebug("Using custom FPS range: " +
selectedFPSLow + " → " + selectedFPSHigh);
try {
builder.setTargetFrameRate(
new Range<>(selectedFPSLow, selectedFPSHigh)
);
} catch (Exception ex) {
AppendLogError("setTargetFrameRate(" +
selectedFPSLow + "," + selectedFPSHigh + ") failed: " + ex);
}
}

// ------------- HDR LOGIC -------------------
if (cameraxHDR && supportedHdrEncoding != null) {
AppendLogDebug("Enabling HDR dynamic range: " + supportedHdrEncoding);
try {
builder.setDynamicRange(supportedHdrEncoding);
} catch (Exception ex) {
AppendLogError("setDynamicRange failed: " + ex);
}
}

videoCapture = builder.build();
}
}

useCaseGroupBuilder.addUseCase(videoCapture);
}


 
BVR1.7.0-error-full.txt
BVR1.7.0-error-now happens on every recording.txt
1.7.0-error18.3-2.txt
BVR-1.5.3.txt
1.7.0-error18.3.txt
BVR1.7.0-error-now happens on every recording-2.txt
BVR1.7.0-error.txt
Reply all
Reply to author
Forward
0 new messages