USB Microphone on Android 9.0 not sending data

Dear support,

I am working on a setup in which an Android device with VirtualHere USB server app installed sends over a dedicated WiFi the audio data from a USB microphone.

I have tried two different android devices, an "old" smartphone (LG Nexus 5) with Android 6.0.1 and a brand new smartphone running Android 9. I purchased the VirtualHere server license for the Android 9 smartphone.

The VirtualHere server seems to work fine on both devices as in both cases the VirtualHere client detects the server, the microphone shows up and it can be set into use by the local client OS. By the way the client runs in a Win10 desktop connected through wire to the WiFi AP.

The problem is that while in both cases the setup seems to work fine, in the case of the Android 9 smartphone the audio data is not sent correctly. In fact it seems that no data is sent as the traffic throughput between both devices remains low (< 1kbps) while it should be around 3-4 Mbps from the smartphone towards the VirtualHere client when the microphone is used by any application in the client OS.

The OTG adapter is different on each setup, as the smartphones have different USB connectors (USB-C in the case of the Android9, USB-microB in the case of the Nexus).

I would appreciate your help in debugging the faulty setup.
Below are the system messages from the Android 9 device.

--------- beginning of main
09-04 12:48:44.385 4663 4663 E e.androidserve: Not starting debugger since process cannot load the jdwp agent.
09-04 12:48:44.392 4663 4663 W re-initialized>: type=1400 audit(0.0:7092): avc: denied { read } for name="u:object_r:mtk_amslog_prop:s0" dev="tmpfs" ino=12584 scontext=u:r:untrusted_app:s0:c115,c256,c512,c768 tcontext=u:object_r:mtk_amslog_prop:s0 tclass=file permissive=0
09-04 12:48:44.396 4663 4663 E libc : Access denied finding property "persist.vendor.sys.activitylog"
09-04 12:48:44.509 4663 4663 I SurfaceFactory: [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@3b37a0c
09-04 12:48:44.509 4663 4663 D OpenGLRenderer: Skia GL Pipeline
09-04 12:48:44.522 4663 4663 D ViewRootImpl[GUI]: hardware acceleration = true , fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated = false, sSystemRendererDisabled = false
09-04 12:48:44.527 4663 4663 V PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@a66425b, this = DecorView@3242af8[GUI]
09-04 12:48:44.550 4663 4686 I e.androidserve: The ClassLoaderContext is a special shared library.
09-04 12:48:44.556 4663 4686 I System.out: port:7575
09-04 12:48:44.563 4663 4663 D Surface : Surface::allocateBuffers(this=0x71b5c96000)
09-04 12:48:44.574 4663 4679 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
09-04 12:48:44.574 4663 4679 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
09-04 12:48:44.574 4663 4679 I OpenGLRenderer: Initialized EGL, version 1.4
09-04 12:48:44.575 4663 4679 D OpenGLRenderer: Swap behavior 2
09-04 12:48:44.585 4663 4679 D Surface : Surface::connect(this=0x71b5c96000,api=1)
09-04 12:48:44.587 4663 4679 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
09-04 12:48:44.596 4663 4679 E ion : ioctl c0044901 failed with code -1: Invalid argument
09-04 12:48:44.608 4663 4706 I vhusbd : Fri Sep 4 12:48:44 2020 LOG_INFO >>> Starting VirtualHere USB Server v4.0.7 (Built: Nov 25 2019, 23:01:59)<<<
09-04 12:48:44.609 4663 4706 I vhusbd : Fri Sep 4 12:48:44 2020 LOG_INFO Using configuration /data/data/com.virtualhere.androidserver/config.ini
09-04 12:48:44.623 4663 4663 E virtualhere-daemon: Opening local exception: Connection refused
09-04 12:48:44.624 4663 4663 I chatty : uid=10115(com.virtualhere.androidserver) identical 1 line
09-04 12:48:44.625 4663 4663 E virtualhere-daemon: Opening local exception: Connection refused
09-04 12:48:44.686 4663 4706 I vhusbd : Fri Sep 4 12:48:44 2020 LOG_INFO Server licensed to=XXXXXdeletedXXXXXX max_devices=unlimited
09-04 12:48:44.686 4663 4706 I vhusbd : Fri Sep 4 12:48:44 2020 LOG_INFO Using large URB's
09-04 12:48:44.687 4663 4706 I vhusbd : Fri Sep 4 12:48:44 2020 LOG_INFO Listening on all network interfaces at TCP port 7575 (IPv6 dual-stack)
09-04 12:48:44.691 4663 4706 I vhusbd : VirtualHere USB Server is running...press CTRL-C to stop
09-04 12:48:45.652 4663 4686 I taoqiong_wifi_log_cts: packagename:com.virtualhere.androidserver
09-04 12:48:59.225 4663 4706 I vhusbd : Fri Sep 4 12:48:59 2020 LOG_INFO 10.128.4.70 connected as connection 1
09-04 12:49:12.728 4663 4663 W com.virtualhere.androidserver: type=1400 audit(0.0:7093): avc: denied { read } for comm=4173796E635461736B202334 name="uevent" dev="sysfs" ino=32271 scontext=u:r:untrusted_app:s0:c115,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
09-04 12:49:12.740 4663 4706 I vhusbd : Fri Sep 4 12:49:12 2020 LOG_INFO Found High speed device [0869:0306] "DODOTRONIC Technology ., UltraMic 250K 16 bit r4" at address 1009
09-04 12:49:12.749 4663 4663 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@ed9e4f7
09-04 12:49:12.791 4663 4663 V PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@a66425b, this = DecorView@3242af8[GUI]
09-04 12:49:24.354 4663 4706 I vhusbd : Fri Sep 4 12:49:24 2020 LOG_INFO Device 1009 [0869:0306] BOUND to connection 1
09-04 12:49:37.909 4663 4671 W System : A resource failed to call close.
09-04 12:50:03.893 4663 4663 D ViewRootImpl[PopupWindow:24cd4b2]: hardware acceleration = true , fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated = false, sSystemRendererDisabled = false
09-04 12:50:03.936 4663 4663 D Surface : Surface::allocateBuffers(this=0x71b5da9000)
09-04 12:50:03.936 4663 4679 D Surface : Surface::connect(this=0x71b5da9000,api=1)
09-04 12:50:03.941 4663 4679 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
09-04 12:50:05.912 4663 4679 D Surface : Surface::disconnect(this=0x71b5da9000,api=1)
09-04 12:50:05.914 4663 4663 D View : [Warning] assignParent to null: this = android.widget.PopupWindow$PopupDecorView{7f6d7f4 V.E...... R.....ID 0,0-150,411}
09-04 12:50:07.000 4663 4663 D ViewRootImpl[PopupWindow:aed197a]: hardware acceleration = true , fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated = false, sSystemRendererDisabled = false
09-04 12:50:07.044 4663 4663 D Surface : Surface::allocateBuffers(this=0x71b5da9000)
09-04 12:50:07.047 4663 4679 D Surface : Surface::connect(this=0x71b5da9000,api=1)
09-04 12:50:07.049 4663 4679 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000

System messages from the Android 6.0.1 (working fine):

--------- beginning of main
09-04 11:32:38.311 25931 25931 W System : ClassLoader referenced unknown path: /data/app/com.virtualhere.androidserver-1/lib/arm
09-04 11:32:38.430 25931 25956 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
09-04 11:32:38.492 25931 25956 I Adreno-EGL: : QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
09-04 11:32:38.494 25931 25956 I OpenGLRenderer: Initialized EGL, version 1.4
09-04 11:32:38.530 25931 25969 I vhusbd : Fri Sep 4 11:32:38 2020 LOG_INFO >>> Starting VirtualHere USB Server v4.0.7 (Built: Nov 25 2019, 23:01:58)<<<
09-04 11:32:38.531 25931 25969 I vhusbd : Fri Sep 4 11:32:38 2020 LOG_INFO Using configuration /data/data/com.virtualhere.androidserver/config.ini
09-04 11:32:38.590 25931 25931 E virtualhere-daemon: Opening local exception: Connection refused
09-04 11:32:38.591 25931 25931 E virtualhere-daemon: Opening local exception: Connection refused
09-04 11:32:38.591 25931 25931 E virtualhere-daemon: Opening local exception: Connection refused
09-04 11:32:38.621 25931 25969 I vhusbd : Fri Sep 4 11:32:38 2020 LOG_INFO Server licensed to=unlicensed max_devices=1
09-04 11:32:38.621 25931 25969 I vhusbd : Fri Sep 4 11:32:38 2020 LOG_INFO Using large URB's
09-04 11:32:38.621 25931 25969 I vhusbd : Fri Sep 4 11:32:38 2020 LOG_INFO Listening on all network interfaces at TCP port 7575 (IPv6 dual-stack)
09-04 11:32:38.624 25931 25969 I vhusbd : VirtualHere USB Server is running...press CTRL-C to stop
09-04 11:32:39.885 25931 25931 I ListPopupWindow: Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.
09-04 11:32:41.798 25931 25956 D OpenGLRenderer: endAllStagingAnimators on 0xa03b7780 (l0$a) with handle 0xa036f0e0
09-04 11:33:51.163 25931 25969 I vhusbd : Fri Sep 4 11:33:51 2020 LOG_INFO Found Full speed device [0869:0306] "DODOTRONIC Technology ., UltraMic 250K 16 bit r4" at address 1005
09-04 11:34:36.216 25931 25969 I vhusbd : Fri Sep 4 11:34:36 2020 LOG_INFO 10.128.4.70 connected as connection 1
09-04 11:34:48.156 25931 25969 I vhusbd : Fri Sep 4 11:34:48 2020 LOG_INFO Device 1005 [0869:0306] BOUND to connection 1

Thank you in advance.
Antonio

#2

If it works on android 6 and not on android 9 unfortunately it a bug in your android 9. The virtualhere app is identical between android versions. So you might have to wait for an android update for your android 9 device from the manufacturer. Google Nexus/Pixel devices are well supported by google and have pretty good bug free kernels so im not surprised it works ok on the nexus

#3

Dear Michael,
Thank you for your answer.
Indeed I have tried other USB devices in the Android 9 and VirtualHere app worked fine for them (a mouse, a USB storage key, VoIP headsets...)
So the problem ought to lie in some sort of incompatibility between the USB microphone and Android 9 or Android 10 devices (I own an Android 10 phone which shows the same behavior with this microphone, no audio stream...)
Regards,
Antonio