How to access concurrent cameras

100 views
Skip to first unread message

Prathiv Ar

unread,
Jan 22, 2026, 11:44:06 PMJan 22
to Android CameraX Discussion Group
I have a use case were I need to stream both cameras(front & back) same time and use ImageAnalysis.Analyzer to make some changes to the frame.

when I bind the first camera everything works fine 

cameraProvider.bindToLifecycle(

    lifecycleOwner,

    cameraSelector,

    preview,

    imageAnalysis

)


But then the second camera try to bind it doesn't work (yes I know) . I get 

Open count: 1 (Max allowed: 1)


But it works fine in camera2 but the camerax as good stability (lifecycle ....). 

I'm bit confused how to go forward . is there any way to achieve this in X ?

Wenhung Teng

unread,
Feb 12, 2026, 2:18:21 AMFeb 12
to Android CameraX Discussion Group, prath...@gmail.com
Hi there,

To use both cameras simultaneously, you need to use the Concurrent Camera API introduced in CameraX 1.3.0. The error "Open count: 1 (Max allowed: 1)" occurs because CameraX defaults to a single active camera unless you explicitly bind multiple cameras together in a single coordinated call.

Instead of calling bindToLifecycle twice, you must use the call that accepts a list of SingleCameraConfig objects. Please see Concurrent camera sample /   ConcurrentCamera | API 

Here is a quick code snippet based on our integration logic to get you started:

val cameraProvider = ProcessCameraProvider.getInstance(context).await() // 1. Check for available concurrent camera selectors val concurrentCameraInfos = cameraProvider.availableConcurrentCameraInfos if (concurrentCameraInfos.isEmpty()) { // Device does not support concurrent camera return } // 2. Select the first available pair (typically Front + Back) val selectorPair = concurrentCameraInfos[0] val primarySelector = selectorPair[0].cameraSelector val secondarySelector = selectorPair[1].cameraSelector // 3. Define configurations for each camera val primaryConfig = SingleCameraConfig( primarySelector, UseCaseGroup.Builder() .addUseCase(preview0) .addUseCase(imageAnalysis0) // Your Analyzer goes here .build(), lifecycleOwner ) val secondaryConfig = SingleCameraConfig( secondarySelector, UseCaseGroup.Builder() .addUseCase(preview1) .addUseCase(imageAnalysis1) .build(), lifecycleOwner ) // 4. Bind both in a single call val concurrentCamera = cameraProvider.bindToLifecycle(listOf(primaryConfig, secondaryConfig))

Rish Bhardwaj

unread,
Jun 25, 2026, 8:58:38 AMJun 25
to Android CameraX Discussion Group, wenhu...@google.com, prath...@gmail.com
Hi! Do you have numbers of what % of devices support concurrent preview (that is, front and back camera preview/recording at the same time)?
I've tried the above on Pixel 4a, Samsung S10 and it isn't supported. 
On Pixel 9 I see it is supported.
Is there a hard requirement starting some OS version that all phones must support concurrent preview? 

Scott Nien

unread,
Jun 26, 2026, 2:45:18 AMJun 26
to Rish Bhardwaj, Android CameraX Discussion Group, wenhu...@google.com, prath...@gmail.com
Devices meeting MPC 33 and later need to support the concurrent cameras.  [link]

Normally high-end Android devices will support this feature. 
The percentage is less than 10% 





CONFIDENTIAL

This  e-mail  and  any  attachments  are  confidential  and  intended  solely  for  the  addressee  and  may  also  be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments. Internet communications are not guaranteed to be secure or virus-free. Revolut does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by Revolut for operational or business reasons. Any  opinion  or  other  information  in  this  e-mail  or  its  attachments  that  does  not  relate  to  the  business  of Revolut is personal to the sender and is not given or endorsed by Revolut. Registered  Office: 30 South Colonnade, London E14 5HX, United Kingdom. Main Office: 30 South Colonnade, London E14 5HX, United  Kingdom. Revolut  Ltd  is  authorised  and regulated by the Financial Conduct Authority under the Electronic Money Regulations 2011, Firm Reference 900562.

--
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/a16675e7-2a64-4a7b-a1ec-95f73257b14dn%40android.com.
Reply all
Reply to author
Forward
0 new messages