Fixed
Status Update
Comments
do...@gmail.com <do...@gmail.com> #3
Successful workaround: Kill the ADB process if it does not return within 120 seconds.
le...@google.com <le...@google.com> #4
I've seen the same problem on rare occasion -- I believe on both 32-bit and 64-bit machines (all running Ubuntu).
This scenario is from an Amazon EC2 instance running Ubuntu 10.04.
== Long-running processes involved:
* PID 4440 adb (daemon)
* PID 5396 adb -s localhost:52384 install -r MyApp-debug.apk
* PID 5216 emulator -ports 38007,52384 -no-boot-anim -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_240_WVGA_android-8 -no-window
== Commands run:
* adb daemon was (presumably) already running
* emulator is started as above
* `adb connect localhost:52384`
* `adb logcat -v time` is left running in the background
* `adb install` below is run once emulator is ready
adb -s localhost:52384 install -r MyApp-debug.apk
116 KB/s (57642 bytes in 0.482s)
pkg: /data/local/tmp/MyApp-debug.apk
Success
** hangs here indefinitely without returning (despite "Success") **
== Investigation
* `ps` shows that the hung `adb install` process has PID 5396
root@ip-10-228-211-159:~# strace -p 5396
Process 5396 attached - interrupt to quit
read(4, ^C <unfinished ...>
Process 5396 detached
* adb is blocked reading from FD 4 -- what is that?
root@ip-10-228-211-159:~# ls -l /proc/5396/fd/
total 0
lr-x------ 1 root root 64 2010-09-12 12:26 0 -> pipe:[135089]
l-wx------ 1 root root 64 2010-09-12 12:26 1 -> pipe:[135090]
l-wx------ 1 root root 64 2010-09-12 12:26 2 -> pipe:[135090]
lrwx------ 1 root root 64 2010-09-12 12:26 3 -> socket:[135142]
lrwx------ 1 root root 64 2010-09-12 12:26 4 -> socket:[136177]
root@ip-10-228-211-159:~# lsof | grep 136177
adb 5396 root 4u IPv4 136177 0t0 TCP localhost:51221->localhost:5037 (ESTABLISHED)
root@ip-10-228-211-159:~# netstat -antp | grep LISTEN
tcp 0 0127.0.0.1:5037 0.0.0.0:* LISTEN 4440/adb
tcp 0 00.0.0.0:22 0.0.0.0:* LISTEN 406/sshd
tcp 0 0127.0.0.1:38007 0.0.0.0:* LISTEN 5216/emulator
tcp 0 0127.0.0.1:52384 0.0.0.0:* LISTEN 5216/emulator
* So we're waiting to read from port 5037 -- the adb daemon (PID 4440)?
root@ip-10-228-211-159:~# strace -tt -T -p 4440
Process 4440 attached - interrupt to quit
12:28:55.909470 select(26, [4 5 14 18 25], [], [], NULL^C <unfinished ...>
Process 4440 detached
* It's blocking in select(), waiting for FD 26 to become ready. What's that?
root@ip-10-228-211-159:~# ls -l /proc/4440/fd/
total 0
lr-x------ 1 root root 64 2010-09-12 12:27 0 -> /dev/null
l-wx------ 1 root root 64 2010-09-12 12:27 1 -> /tmp/adb.log
lrwx------ 1 root root 64 2010-09-12 12:27 14 -> socket:[133791]
lrwx------ 1 root root 64 2010-09-12 12:27 15 -> socket:[133790]
lrwx------ 1 root root 64 2010-09-12 12:27 16 -> socket:[133792]
lrwx------ 1 root root 64 2010-09-12 12:27 18 -> socket:[133949]
l-wx------ 1 root root 64 2010-09-12 12:27 2 -> /tmp/adb.log
lrwx------ 1 root root 64 2010-09-12 12:27 25 -> socket:[136178]
lrwx------ 1 root root 64 2010-09-12 12:27 3 -> socket:[127504]
lrwx------ 1 root root 64 2010-09-12 12:27 4 -> socket:[127505]
lrwx------ 1 root root 64 2010-09-12 12:27 5 -> socket:[127506]
lr-x------ 1 root root 64 2010-09-12 12:27 6 -> /dev/null
l-wx------ 1 root root 64 2010-09-12 12:27 7 -> /tmp/adb.log
root@ip-10-228-211-159:~# ls -l /proc/4440/fd/26
ls: cannot access /proc/4440/fd/26: No such file or directory
* Hmm.. it doesn't exist?
* Ok, let's see what the server does when we manually kill the `adb install` process (PID 5396), at time 12:32:50:
root@ip-10-228-211-159:~# strace -tt -T -p 4440
Process 4440 attached - interrupt to quit
12:32:43.366720 select(26, [4 5 14 18 25], [], [], NULL) = 1 (in [25]) <7.274112>
12:32:50.641019 read(25, "", 4096) = 0 <0.000015>
12:32:50.641596 write(14, "\20R\6\t", 4) = 4 <0.000061>
12:32:50.641711 close(25) = 0 <0.000058>
12:32:50.641805 select(26, [4 5 14 18], [], [], NULL) = 1 (in [14]) <0.002506>
12:32:50.644385 read(14, "\20r\6\t", 4) = 4 <0.000025>
12:32:50.644470 select(26, [4 5 14 18], [], [], NULL) = 1 (in [5]) <0.281615>
12:32:50.926206 accept(5, {sa_family=AF_INET, sin_port=htons(44907), sin_addr=inet_addr("127.0.0.1")}, [16]) = 8 <0.000043>
12:32:50.926370 setsockopt(8, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0 <0.000030>
12:32:50.926477 fcntl64(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 <0.000053>
12:32:50.926651 select(26, [4 5 8 14 18], [], [], NULL) = 1 (in [8]) <0.000015>
12:32:50.926727 read(8, "000chost:version", 4096) = 16 <0.000020>
12:32:50.926787 read(8, 0x9067244, 4080) = -1 EAGAIN (Resource temporarily unavailable) <0.000013>
12:32:50.926860 write(8, "OKAY0004001a", 12) = 12 <0.000037>
12:32:50.926943 close(8) = 0 <0.000053>
12:32:50.927031 select(19, [4 5 14 18], [], [], NULL) = 1 (in [5]) <0.000037>
12:32:50.927144 accept(5, {sa_family=AF_INET, sin_port=htons(44908), sin_addr=inet_addr("127.0.0.1")}, [16]) = 8 <0.000035>
12:32:50.927251 setsockopt(8, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0 <0.000029>
12:32:50.927334 fcntl64(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 <0.000029>
12:32:50.927433 select(19, [4 5 8 14 18], [], [], NULL) = 1 (in [8]) <0.000030>
12:32:50.927526 read(8, "001fhost:disconnect:localhost:52"..., 4096) = 35 <0.000033>
12:32:50.927623 read(8, 0x9067257, 4061) = -1 EAGAIN (Resource temporarily unavailable) <0.000028>
12:32:50.927729 shutdown(15, 2 /* send and receive */) = 0 <0.000053>
12:32:50.927825 close(15) = 0 <0.000028>
12:32:50.934829 close(16) = 0 <0.000062>
12:32:50.934959 write(3, "\260\237\5\t\0\0\0\0", 8) = 8 <0.000036>
12:32:50.935064 write(8, "OKAY0000", 8) = 8 <0.000048>
12:32:50.935154 close(8) = 0 <0.000032>
12:32:50.935233 select(19, [4 5 14 18], [], [], NULL) = 2 (in [4 14]) <0.000015>
12:32:50.935290 read(4, "\260\237\5\t\0\0\0\0", 8) = 8 <0.000141>
12:32:50.935470 close(14PANIC: attached pid 4440 exited with 255
<unfinished ... exit status 255>
* Not so good.
This scenario is from an Amazon EC2 instance running Ubuntu 10.04.
== Long-running processes involved:
* PID 4440 adb (daemon)
* PID 5396 adb -s localhost:52384 install -r MyApp-debug.apk
* PID 5216 emulator -ports 38007,52384 -no-boot-anim -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_240_WVGA_android-8 -no-window
== Commands run:
* adb daemon was (presumably) already running
* emulator is started as above
* `adb connect localhost:52384`
* `adb logcat -v time` is left running in the background
* `adb install` below is run once emulator is ready
adb -s localhost:52384 install -r MyApp-debug.apk
116 KB/s (57642 bytes in 0.482s)
pkg: /data/local/tmp/MyApp-debug.apk
Success
** hangs here indefinitely without returning (despite "Success") **
== Investigation
* `ps` shows that the hung `adb install` process has PID 5396
root@ip-10-228-211-159:~# strace -p 5396
Process 5396 attached - interrupt to quit
read(4, ^C <unfinished ...>
Process 5396 detached
* adb is blocked reading from FD 4 -- what is that?
root@ip-10-228-211-159:~# ls -l /proc/5396/fd/
total 0
lr-x------ 1 root root 64 2010-09-12 12:26 0 -> pipe:[135089]
l-wx------ 1 root root 64 2010-09-12 12:26 1 -> pipe:[135090]
l-wx------ 1 root root 64 2010-09-12 12:26 2 -> pipe:[135090]
lrwx------ 1 root root 64 2010-09-12 12:26 3 -> socket:[135142]
lrwx------ 1 root root 64 2010-09-12 12:26 4 -> socket:[136177]
root@ip-10-228-211-159:~# lsof | grep 136177
adb 5396 root 4u IPv4 136177 0t0 TCP localhost:51221->localhost:5037 (ESTABLISHED)
root@ip-10-228-211-159:~# netstat -antp | grep LISTEN
tcp 0 0
tcp 0 0
tcp 0 0
tcp 0 0
* So we're waiting to read from port 5037 -- the adb daemon (PID 4440)?
root@ip-10-228-211-159:~# strace -tt -T -p 4440
Process 4440 attached - interrupt to quit
12:28:55.909470 select(26, [4 5 14 18 25], [], [], NULL^C <unfinished ...>
Process 4440 detached
* It's blocking in select(), waiting for FD 26 to become ready. What's that?
root@ip-10-228-211-159:~# ls -l /proc/4440/fd/
total 0
lr-x------ 1 root root 64 2010-09-12 12:27 0 -> /dev/null
l-wx------ 1 root root 64 2010-09-12 12:27 1 -> /tmp/adb.log
lrwx------ 1 root root 64 2010-09-12 12:27 14 -> socket:[133791]
lrwx------ 1 root root 64 2010-09-12 12:27 15 -> socket:[133790]
lrwx------ 1 root root 64 2010-09-12 12:27 16 -> socket:[133792]
lrwx------ 1 root root 64 2010-09-12 12:27 18 -> socket:[133949]
l-wx------ 1 root root 64 2010-09-12 12:27 2 -> /tmp/adb.log
lrwx------ 1 root root 64 2010-09-12 12:27 25 -> socket:[136178]
lrwx------ 1 root root 64 2010-09-12 12:27 3 -> socket:[127504]
lrwx------ 1 root root 64 2010-09-12 12:27 4 -> socket:[127505]
lrwx------ 1 root root 64 2010-09-12 12:27 5 -> socket:[127506]
lr-x------ 1 root root 64 2010-09-12 12:27 6 -> /dev/null
l-wx------ 1 root root 64 2010-09-12 12:27 7 -> /tmp/adb.log
root@ip-10-228-211-159:~# ls -l /proc/4440/fd/26
ls: cannot access /proc/4440/fd/26: No such file or directory
* Hmm.. it doesn't exist?
* Ok, let's see what the server does when we manually kill the `adb install` process (PID 5396), at time 12:32:50:
root@ip-10-228-211-159:~# strace -tt -T -p 4440
Process 4440 attached - interrupt to quit
12:32:43.366720 select(26, [4 5 14 18 25], [], [], NULL) = 1 (in [25]) <7.274112>
12:32:50.641019 read(25, "", 4096) = 0 <0.000015>
12:32:50.641596 write(14, "\20R\6\t", 4) = 4 <0.000061>
12:32:50.641711 close(25) = 0 <0.000058>
12:32:50.641805 select(26, [4 5 14 18], [], [], NULL) = 1 (in [14]) <0.002506>
12:32:50.644385 read(14, "\20r\6\t", 4) = 4 <0.000025>
12:32:50.644470 select(26, [4 5 14 18], [], [], NULL) = 1 (in [5]) <0.281615>
12:32:50.926206 accept(5, {sa_family=AF_INET, sin_port=htons(44907), sin_addr=inet_addr("127.0.0.1")}, [16]) = 8 <0.000043>
12:32:50.926370 setsockopt(8, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0 <0.000030>
12:32:50.926477 fcntl64(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 <0.000053>
12:32:50.926651 select(26, [4 5 8 14 18], [], [], NULL) = 1 (in [8]) <0.000015>
12:32:50.926727 read(8, "000chost:version", 4096) = 16 <0.000020>
12:32:50.926787 read(8, 0x9067244, 4080) = -1 EAGAIN (Resource temporarily unavailable) <0.000013>
12:32:50.926860 write(8, "OKAY0004001a", 12) = 12 <0.000037>
12:32:50.926943 close(8) = 0 <0.000053>
12:32:50.927031 select(19, [4 5 14 18], [], [], NULL) = 1 (in [5]) <0.000037>
12:32:50.927144 accept(5, {sa_family=AF_INET, sin_port=htons(44908), sin_addr=inet_addr("127.0.0.1")}, [16]) = 8 <0.000035>
12:32:50.927251 setsockopt(8, SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0 <0.000029>
12:32:50.927334 fcntl64(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 <0.000029>
12:32:50.927433 select(19, [4 5 8 14 18], [], [], NULL) = 1 (in [8]) <0.000030>
12:32:50.927526 read(8, "001fhost:disconnect:localhost:52"..., 4096) = 35 <0.000033>
12:32:50.927623 read(8, 0x9067257, 4061) = -1 EAGAIN (Resource temporarily unavailable) <0.000028>
12:32:50.927729 shutdown(15, 2 /* send and receive */) = 0 <0.000053>
12:32:50.927825 close(15) = 0 <0.000028>
12:32:50.934829 close(16) = 0 <0.000062>
12:32:50.934959 write(3, "\260\237\5\t\0\0\0\0", 8) = 8 <0.000036>
12:32:50.935064 write(8, "OKAY0000", 8) = 8 <0.000048>
12:32:50.935154 close(8) = 0 <0.000032>
12:32:50.935233 select(19, [4 5 14 18], [], [], NULL) = 2 (in [4 14]) <0.000015>
12:32:50.935290 read(4, "\260\237\5\t\0\0\0\0", 8) = 8 <0.000141>
12:32:50.935470 close(14PANIC: attached pid 4440 exited with 255
<unfinished ... exit status 255>
* Not so good.
le...@google.com <le...@google.com> #5
[Comment deleted]
le...@google.com <le...@google.com> #6
I've met almost the same problem, without 'Success' printed out.
My env: Mac OS 10.6.5 i386, sdk r07 with latest platform packages.
my test script to reproduce:
i=0
while [ 1 ] ; do
let i=$i+1
echo "========== $i ==============="
adb install -r Test.apk
done
output:
========== 1 ===============
1255 KB/s (137164 bytes in 0.106s)
pkg: /data/local/tmp/Test.apk
Success
========== 2 ===============
1882 KB/s (137164 bytes in 0.071s)
pkg: /data/local/tmp/Test.apk
Success
^A========== 3 ===============
1830 KB/s (137164 bytes in 0.073s)
^A pkg: /data/local/tmp/Test.apk
Success
========== 4 ===============
1695 KB/s (137164 bytes in 0.079s)
pkg: /data/local/tmp/Test.apk
Success
========== 5 ===============
1905 KB/s (137164 bytes in 0.070s)
pkg: /data/local/tmp/Test.apk
Success
========== 6 ===============
1849 KB/s (137164 bytes in 0.072s)
---> hangs here, then use gdb to get the stack trace:
$ ps ax|grep adb
11587 ?? S 0:01.31 adb fork-server server
15773 s001 S+ 0:00.00 grep adb
15757 s003 S+ 0:00.01 adb install -r Test.apk
$ gdb adb 15757
(gdb) bt
#0 0x9503b459 in read$UNIX2003 ()
#1 0x00009c34 in read_and_dump ()
#2 0x0000c1d7 in send_shellcommand ()
#3 0x0000c30c in pm_command ()
#4 0x0000c516 in install_app ()
#5 0x0000b940 in adb_commandline ()
#6 0x000042b6 in start ()
it seems in system/core/adb/commandline.c, adb_read expects a 4096 byte result but never returns ...
static void read_and_dump(int fd)
{
char buf[4096];
int len;
while(fd >= 0) {
len = adb_read(fd, buf, 4096);
if(len == 0) {
break;
}
if(len < 0) {
if(errno == EINTR) continue;
break;
}
fwrite(buf, 1, len, stdout);
fflush(stdout);
}
}
My env: Mac OS 10.6.5 i386, sdk r07 with latest platform packages.
my test script to reproduce:
i=0
while [ 1 ] ; do
let i=$i+1
echo "========== $i ==============="
adb install -r Test.apk
done
output:
========== 1 ===============
1255 KB/s (137164 bytes in 0.106s)
pkg: /data/local/tmp/Test.apk
Success
========== 2 ===============
1882 KB/s (137164 bytes in 0.071s)
pkg: /data/local/tmp/Test.apk
Success
^A========== 3 ===============
1830 KB/s (137164 bytes in 0.073s)
^A pkg: /data/local/tmp/Test.apk
Success
========== 4 ===============
1695 KB/s (137164 bytes in 0.079s)
pkg: /data/local/tmp/Test.apk
Success
========== 5 ===============
1905 KB/s (137164 bytes in 0.070s)
pkg: /data/local/tmp/Test.apk
Success
========== 6 ===============
1849 KB/s (137164 bytes in 0.072s)
---> hangs here, then use gdb to get the stack trace:
$ ps ax|grep adb
11587 ?? S 0:01.31 adb fork-server server
15773 s001 S+ 0:00.00 grep adb
15757 s003 S+ 0:00.01 adb install -r Test.apk
$ gdb adb 15757
(gdb) bt
#0 0x9503b459 in read$UNIX2003 ()
#1 0x00009c34 in read_and_dump ()
#2 0x0000c1d7 in send_shellcommand ()
#3 0x0000c30c in pm_command ()
#4 0x0000c516 in install_app ()
#5 0x0000b940 in adb_commandline ()
#6 0x000042b6 in start ()
it seems in system/core/adb/commandline.c, adb_read expects a 4096 byte result but never returns ...
static void read_and_dump(int fd)
{
char buf[4096];
int len;
while(fd >= 0) {
len = adb_read(fd, buf, 4096);
if(len == 0) {
break;
}
if(len < 0) {
if(errno == EINTR) continue;
break;
}
fwrite(buf, 1, len, stdout);
fflush(stdout);
}
}
wu...@google.com <wu...@google.com>
ap...@google.com <ap...@google.com> #7
I experienced the same problem several times. This is kind of a blocker for me as my regression test system uses adb commands repeatedly.
Experienced hang for "install","uninstall","shell" commands.
Host OS: Windows 7
SDK tools version (available in the "About" section of the 'android' tool
UI): Revision 10
Platform targeted by your project: 2.2
Version of the platform running in the emulator: 2.2
Experienced hang for "install","uninstall","shell" commands.
Host OS: Windows 7
SDK tools version (available in the "About" section of the 'android' tool
UI): Revision 10
Platform targeted by your project: 2.2
Version of the platform running in the emulator: 2.2
Description
1.0.0-beta01
CAMERA APPLICATION NAME AND VERSION:
CameraXBasic with modification to have torch always on
ANDROID OS BUILD NUMBER:
QQ2A.200305.002
DEVICE NAME:
Pixel 3a
DESCRIPTION:
Enabling torch after camera binding is not reliable. It always works only for the first Activity launch, but when returning to the same Activity is not working correctly.
LIST ANY EXPERIMENTAL FEATURES:
N/A
STEPS TO REPRODUCE:
1. Launch the example app with modification below, which enables torch after binding.
2. Navigate to Gallery.
3. Go Back to camera preview.
OBSERVED RESULTS:
A torch is switched off.
EXPECTED RESULTS:
A torch is always on.
REPRODUCIBILITY:
5 of 5
ADDITIONAL INFORMATION:
Log from opening app (torch is on) -> Gallery (then Back button) -> camera (torch is off):
CameraXBasic: Screen metrics: 1080 x 2220
CameraXBasic: Preview aspect ratio: 1
CameraRepository: Added camera: 0
UseCaseAttachState: Active and online use case: [] for camera: 0
CameraRepository: Added camera: 1
UseCaseAttachState: Active and online use case: [] for camera: 1
UseCaseAttachState: Active and online use case: [] for camera: 0
Camera: Use cases [ImageCapture:androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, Preview:androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, ImageAnalysis:androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] now ONLINE for camera 0
UseCaseAttachState: Active and online use case: [] for camera: 0
Camera: Resetting Capture Session
Camera: releasing session in state INITIALIZED
Camera: Transitioning camera internal state: INITIALIZED --> OPENING
Camera: Opening camera: 0
UseCaseAttachState: All use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
Camera: Use case ImageCapture:androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b] for camera: 0
Camera: Use case Preview:androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf] for camera: 0
Camera: Use case ImageAnalysis:androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
Camera: CameraDevice.onOpened(): 0
Camera: Transitioning camera internal state: OPENING --> OPENED
UseCaseAttachState: All use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
CaptureSession: Opening capture session.
CaptureSession: Attempting to send capture request onConfigured
CaptureSession: Issuing request for session.
CaptureSession: CameraCaptureSession.onConfigured() mState=OPENED
CaptureSession: CameraCaptureSession.onReady() OPENED
Camera: Use cases [ImageCapture:androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, Preview:androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, ImageAnalysis:androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] now OFFLINE for camera 0
Camera: Resetting Capture Session
Camera: releasing session in state OPENED
Camera: Closing camera: 0
Camera: Transitioning camera internal state: OPENED --> CLOSING
Camera: Resetting Capture Session
Camera: releasing session in state CLOSING
UseCaseAttachState: Active and online use case: [] for camera: 0
UseCaseAttachState: Active and online use case: [] for camera: 0
Camera: issue capture request for camera 0
UseCaseAttachState: Active and online use case: [] for camera: 0
CaptureSession: CameraCaptureSession.onClosed()
Camera: CameraDevice.onClosed(): 0
Camera: Transitioning camera internal state: CLOSING --> INITIALIZED
Camera: Use cases [ImageCapture:androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, Preview:androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, ImageAnalysis:androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] now ONLINE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
Camera: Resetting Capture Session
Camera: releasing session in state INITIALIZED
Camera: Transitioning camera internal state: INITIALIZED --> OPENING
Camera: Opening camera: 0
UseCaseAttachState: All use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
Camera: CameraDevice.onOpened(): 0
Camera: Transitioning camera internal state: OPENING --> OPENED
UseCaseAttachState: All use case: [androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] for camera: 0
CaptureSession: Opening capture session.
CameraXBasic: Screen metrics: 1080 x 2220
CameraXBasic: Preview aspect ratio: 1
Camera: Use cases [ImageCapture:androidx.camera.core.ImageCapture-0adade8a-60ab-4b3e-8b97-370ff318f73b, Preview:androidx.camera.core.Preview-c3e392d8-57ad-40a2-989e-b56ebd134eaf, ImageAnalysis:androidx.camera.core.ImageAnalysis-1671baa6-a5f8-45f0-9bb7-dab949c97b3b] now OFFLINE for camera 0
Camera: Resetting Capture Session
Camera: releasing session in state OPENED
Camera: Closing camera: 0
Camera: Transitioning camera internal state: OPENED --> CLOSING
Camera: Resetting Capture Session
Camera: releasing session in state CLOSING
UseCaseAttachState: Active and online use case: [] for camera: 0
Camera: Use cases [ImageCapture:androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, ImageAnalysis:androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, Preview:androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] now ONLINE for camera 0
UseCaseAttachState: Active and online use case: [] for camera: 0
Camera: Resetting Capture Session
Camera: releasing session in state CLOSING
Camera: Transitioning camera internal state: CLOSING --> REOPENING
Camera: Transitioning camera internal state: REOPENING --> OPENED
UseCaseAttachState: All use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
Camera: Use case ImageCapture:androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a] for camera: 0
Camera: Use case ImageAnalysis:androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc] for camera: 0
Camera: Use case Preview:androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0 ACTIVE for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
CaptureSession: CameraCaptureSession.onConfigured() mState=RELEASING
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
Camera: issue capture request for camera 0
UseCaseAttachState: Active and online use case: [androidx.camera.core.ImageCapture-a07cad15-fa28-4e60-a12b-b7b572df394a, androidx.camera.core.ImageAnalysis-6e588f99-bc88-4afd-b906-17a67e514dbc, androidx.camera.core.Preview-764071db-da2c-42ff-9b85-002d632d1ac0] for camera: 0
CaptureSession: CameraCaptureSession.onReady() RELEASING
CaptureSession: Opening capture session.
CaptureSession: CameraCaptureSession.onClosed()
CaptureSession: Attempting to send capture request onConfigured
CaptureSession: Issuing request for session.
CaptureSession: Issuing capture request.
CaptureSession: CameraCaptureSession.onConfigured() mState=OPENED
CaptureSession: CameraCaptureSession.onReady() OPENED
CODE FRAGMENTS:
Use an example from
and just change binding to this:
camera = cameraProvider.bindToLifecycle(
this, cameraSelector, preview, imageCapture, imageAnalyzer)
.apply { cameraControl.enableTorch(true) }