On Jul 15, 6:18 pm, Diego <diego.rond...@kynetics.it> wrote: > On Jul 13, 6:38 pm, Diego Rondini <diego.rond...@kynetics.it> wrote: > > > I don't get while I see the "err = ..." line multiple times, and it's not > > clear to me what's happening in this method. Can anybody help me? > > Ok, found out some more: the "err = ..." line is present several times > because the function is recursive, and the actual problem is that the / > dev/snd/pcmC0D0p is busy. > I infact discovered that the "error -16" is coming from the > "snd_pcm_hw_open" method in the "pcm_hw.c" source file, from the line: > fd = snd_open_device(filename, fmode); > According to file "bionic/libc/kernel/common/asm-generic/errno-base.h" > the error: > #define EBUSY 16 > which means "Device or resource busy". > > Has anybody an idea of why it's busy? How can I check what uses it > (Android doesn't have "lsof")? >
Another step: I found out I can use busybox's "fuser". I get: # busybox fuser /dev/snd/pcmC0D0p 1788 # ps | busybox grep 1788 media 1788 1 17636 1212 ffffffff afe0c51c S /system/bin/ mediaserver So the pcmC0D0p is opened by the mediaserver process, which seems normal to me (if I manually kill mediaserver, it restarts and occupies again pcmC0D0p). Is this behaviour correct? And why should it prevent the possibility to record audio? Thanks, Diego -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting