Status Update
Comments
as...@gmail.com <as...@gmail.com> #2
cm...@google.com <cm...@google.com>
ko...@gmail.com <ko...@gmail.com> #3
<android.support.v4.widget.DrawerLayout xmlns:android="
xmlns:app="
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/header_container"/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/main_nav_header"
android:fitsSystemWindows="true"
app:menu="@menu/main_drawercontent"/>
</android.support.v4.widget.DrawerLayout>
Obviously here the NavigationView is a direct child of the DrawerLayout, which is why the implementation we already have for handling the closing of the navigation drawer works like it does, by checking the NavigationView's parent.
But when using a BottomSheetDialogFragment, we can't rely on the NavigationView being a direct child of the BottomSheetDialogFragment. Since it's mostly a regular Fragment, people may use a layout like this (simplified):
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.BottomDrawerFragment">
<!-- Here we'd have views typically found in the navigation drawer,
such as a user profile picture or their name -->
<com.google.android.material.navigation.NavigationView
android:id="@+id/bottom_drawer_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider"
app:menu="@menu/bottom_drawer_menu" />
</androidx.constraintlayout.widget.ConstraintLayout>
My suggestion wouldn't work with this, as the NavigationView's parent is not the BottomSheetDialogFragment, but the ConstraintLayout. So we can't use the parent to detect when we should dismiss a BottomSheetDialogFragment.
A potential solution would probably have to use a different approach. Maybe in setupWithNavController() you could pass a reference to the BottomSheetDialogFragment directly, in addition to the NavigationView and NavController. Something similar happens already, for example when using a Toolbar that should be kept in sync also, the method call is NavigationUI.setupWithNavController(collapsingToolbarLayout, toolbar, navController) for that.
So we could end up having an implementation of setupWithNavController just for our case with the BottomSheetDialogFragment that goes something like this:
public static void setupWithNavController(
@NonNull BottomSheetDialogFragment bottomSheetDialogFragment,
@NonNull final NavigationView navigationView,
@NonNull final NavController navController) {
navigationView.setNavigationItemSelectedListener(
new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
boolean handled = onNavDestinationSelected(item, navController, true);
if (handled) {
bottomSheetDialogFragment.dismiss();
}
return handled;
}
});
final WeakReference<NavigationView> weakReference = new WeakReference<>(navigationView);
navController.addOnNavigatedListener(new NavController.OnNavigatedListener() {
@Override
public void onNavigated(@NonNull NavController controller,
@NonNull NavDestination destination) {
NavigationView view = weakReference.get();
if (view == null) {
controller.removeOnNavigatedListener(this);
return;
}
Menu menu = view.getMenu();
for (int h = 0, size = menu.size(); h < size; h++) {
MenuItem item = menu.getItem(h);
item.setChecked(matchDestination(destination, item.getItemId()));
}
}
});
}
And we'd use it in our example like so:
public class BottomDrawerFragment extends BottomSheetDialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_bottom_drawer, container, false);
NavigationView navigationView = view.findViewById(R.id.bottom_drawer_navigation);
NavigationUI.setupWithNavController(this, navigationView, Navigation.findNavController(getActivity(), R.id.nav_host_fragment));
return view;
}
}
lf...@google.com <lf...@google.com> #4
ga...@gmail.com <ga...@gmail.com> #5
If you'd always expect it to be hidden, we could use BottomSheetBehavior.from(navigationView) to find the bottom sheet, avoiding the need to create another setup method.
be...@microsoft.com <be...@microsoft.com> #6
Examples for standard bottom sheets are playback controls inside a music player or the location information in Google Maps, while modal bottom sheets provide a set of choices and are an alternative to inline menus.
This makes it pretty clear that modal bottom sheets should be used for any kind of menu, and modal bottom sheets are always dismissed by tapping a menu item or action. That being said, it's not unlikely that someone is going to use a NavigationView inside a standard bottom sheet at some point. While the spec doesn't explicitly prohibit that, it's clearly not the intention, so I wouldn't consider this case in the implementation.
With that in mind, I think using BottomSheetBehavior.from(navigationView) is a good solution.
bo...@google.com <bo...@google.com>
la...@gmail.com <la...@gmail.com> #8
Branch: androidx-master-dev
commit 43e060b8c23a7163673f77ee42e5a1e3cb1f7c14
Author: Ian Lake <ilake@google.com>
Date: Fri Aug 31 14:11:51 2018
Close bottom sheets when tapping a NavigationView
When a NavigationView is contained within a bottom
sheet (such as is the case for the common
BottomAppBar use case), tapping on a menu item that
navigates to a destination will also hide the
bottom sheet.
Test: manual testing
Change-Id: Ia6cf92288988fe160ffd1136de417066b33377f2
Fixes: 112158843
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
sh...@squareup.com <sh...@squareup.com> #9
re...@gmail.com <re...@gmail.com> #10
ma...@gmail.com <ma...@gmail.com> #11
ga...@gmail.com <ga...@gmail.com> #12
li...@gmail.com <li...@gmail.com> #13
if (parent instanceof DrawerLayout) {
((DrawerLayout) parent).closeDrawer(navigationView);
} else {
BottomSheetBehavior bottomSheetBehavior =
BottomSheetBehavior.from((View) navigationView.getParent().getParent());
if (bottomSheetBehavior != null) {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
}
but only
BottomSheetBehavior bottomSheetBehavior =
BottomSheetBehavior.from(navigationView);
would expect, that the navigationView is a direct child of a CoordinatorLayout and would have the app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" attribute. That can't work or did I miss something?
sv...@whisp.de <sv...@whisp.de> #14
rk...@google.com <rk...@google.com> #15
Branch: androidx-master-dev
commit 4fb1acaf8ee002979bc161e362c1e83f89195205
Author: Ian Lake <ilake@google.com>
Date: Tue Sep 18 13:38:07 2018
Fix NavigationUI for use with BottomSheetDialogFragment
Replace using BottomSheetBehavior.from() which
throws IllegalArgumentExceptions to a safe
method that searches up the view hierarchy
for a CoordinatorLayout to determine if the
NavigationView is within a bottom sheet.
Test: example added to the integration-tests/testapp
BUG: 112158843
Change-Id: I774991ef1b23085e075e6bac6fa820ee3e001a31
M navigation/integration-tests/testapp/build.gradle
M navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/HelpActivity.kt
M navigation/integration-tests/testapp/src/main/res/layout/activity_help.xml
A navigation/integration-tests/testapp/src/main/res/layout/bottom_bar_menu.xml
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
rk...@google.com <rk...@google.com> #16
ma...@gmail.com <ma...@gmail.com> #17
Bluetooth audio devices switch operating modes when used as: a) Speaker only (simplex, only supports audio out and up to stereo 48KHz sampling rate) b) Speakers + Microphone (duplex, supports both mono audio in and out at 8 or 16 Khz sampling rate)
Devices are usually by default in mode a, as soon as a sw opens the the microphone they switch to mode b and therefore any audio being reproduced suddenly jumps from 48 to 16khz and the quality gap can be clearly heard. Some drivers even have different volume settings between the 2 modes and when switching mode the volume can suddenly jump up or down.
This is why you can't repro with built in laptop speakers: their sound card is not a bluetooth device and hence doesn't have this peculiar behavior.
rk...@google.com <rk...@google.com> #18
Thank you for the details. To me this sounds like, bluetooth headphones have to switch to 16Khz if we want to use their microphone in the emulator. One way of fixing this is to avoid touching the microphone in the emulator unless we want to record from it. As a quick fix, it is possible to switch the audio input in MacOS to the "Internal microphone" then the running emulator does not affect audio quality.
ma...@gmail.com <ma...@gmail.com> #19
To me this sounds like, bluetooth headphones have to switch to 16Khz if we want to use their microphone in the emulator.
Correct. There’s no way out from here.
One way of fixing this is to avoid touching the microphone in the emulator unless we want to record from it.
Indeed. And closing the mike as soon as finishing recording.
As a quick fix, it is possible to switch the audio input in MacOS to the "Internal microphone" then the running emulator does not affect audio quality.
Yes. This is how most of us are coping with this since years :) but every time you disconnect and reconnect the bt headphones the system automatically reselects them as microphone. So it’s easy to retrigger this unpleasant behavior.
rk...@google.com <rk...@google.com> #20
AUD_open_in
(as well as _out
) is called twice: in
#0 AUD_open_out (card=card@entry=0x7b1f178, sw=sw@entry=0x0, name=0x2759e5 "goldfish_audio", callback_opaque=callback_opaque@entry=0x7b1ed00,
callback_fn=0x1155300 <goldfish_audio_callback>, as=as@entry=0x7fffe03b3fc0) at ../audio/audio_template.h:399
#1 0x0000000001155208 in goldfish_audio_realize (dev=<optimized out>, errp=<optimized out>) at ../hw/audio/goldfish_audio.c:450
#2 0x0000000001176890 in device_set_realized (obj=<optimized out>, value=true, errp=0x7fffe03b4118) at ../hw/core/qdev.c:852
#3 0x0000000001247fdc in property_set_bool (obj=0x7b1ed00, v=<optimized out>, name=<optimized out>, opaque=0x7a4b210, errp=0x7fffe03b4118)
at ../qom/object.c:1923
#4 0x00000000012498ed in object_property_set_qobject (obj=0x7b1f178, value=<optimized out>, name=0x2759e5 "goldfish_audio", errp=0x7b1ed00)
at ../qom/qom-qobject.c:27
#5 0x00000000012467cc in object_property_set_bool (obj=0x7b1f178, value=<optimized out>, name=0x2759e5 "goldfish_audio", errp=0x7b1ed00)
at ../qom/object.c:1188
#6 0x000000000117541f in qdev_init_nofail (dev=dev@entry=0x7b1ed00) at ../hw/core/qdev.c:339
#7 0x0000000001177ef3 in sysbus_create_varargs (name=<optimized out>, addr=addr@entry=4278267904) at ../hw/core/sysbus.c:226
#8 0x0000000001083cf0 in sysbus_create_simple (name=0x7b1f178 " \263\244\a", addr=4278267904, irq=0x2759e5) at ../include/hw/sysbus.h:111
#9 pc_init1 (machine=0x3b25880, host_type=<optimized out>, pci_type=<optimized out>) at ../hw/i386/pc_piix.c:288
#10 0x000000000116fa72 in machine_run_board_init (machine=0x3b25880) at ../hw/core/machine.c:829
#11 0x000000000109b4c5 in main_impl (argc=<optimized out>, argv=<optimized out>,
on_main_loop_done=0x10959a0 <enter_qemu_main_loop(int, char**)::$_4::__invoke()>) at ../vl.c:5533
#12 0x0000000001097746 in run_qemu_main (argc=129102200, argv=0x0, on_main_loop_done=0x2759e5) at ../vl.c:3360
#13 0x0000000001092c3a in enter_qemu_main_loop (argc=112, argv=0x3b24e00) at ../android-qemu2-glue/main.cpp:731
#14 0x00007ffff7320233 in QThreadPrivate::start (arg=0x3a9a420)
at /usr/local/google/home/wdu/build-qt/src/qt-everywhere-src-5.12.1/qtbase/src/corelib/thread/qthread_unix.cpp:361
#15 0x00007ffff79d4d80 in start_thread (arg=0x7fffe03b5640) at pthread_create.c:481
#16 0x00007ffff6396bdf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#0 AUD_open_in (card=card@entry=0x7b1f178, sw=sw@entry=0x0, name=0x392aaf "goldfish_audio_in", callback_opaque=callback_opaque@entry=0x7b1ed00,
callback_fn=0x11554a0 <goldfish_audio_in_callback>, as=as@entry=0x7fffe03b3fc0) at ../audio/audio_template.h:399
#1 0x0000000001155280 in goldfish_audio_realize (dev=<optimized out>, errp=<optimized out>) at ../hw/audio/goldfish_audio.c:471
#2 0x0000000001176890 in device_set_realized (obj=<optimized out>, value=true, errp=0x7fffe03b4118) at ../hw/core/qdev.c:852
#3 0x0000000001247fdc in property_set_bool (obj=0x7b1ed00, v=<optimized out>, name=<optimized out>, opaque=0x7a4b210, errp=0x7fffe03b4118)
at ../qom/object.c:1923
#4 0x00000000012498ed in object_property_set_qobject (obj=0x7b1f178, value=<optimized out>, name=0x392aaf "goldfish_audio_in", errp=0x7b1ed00)
at ../qom/qom-qobject.c:27
#5 0x00000000012467cc in object_property_set_bool (obj=0x7b1f178, value=<optimized out>, name=0x392aaf "goldfish_audio_in", errp=0x7b1ed00)
at ../qom/object.c:1188
#6 0x000000000117541f in qdev_init_nofail (dev=dev@entry=0x7b1ed00) at ../hw/core/qdev.c:339
#7 0x0000000001177ef3 in sysbus_create_varargs (name=<optimized out>, addr=addr@entry=4278267904) at ../hw/core/sysbus.c:226
#8 0x0000000001083cf0 in sysbus_create_simple (name=0x7b1f178 " \263\244\a", addr=4278267904, irq=0x392aaf) at ../include/hw/sysbus.h:111
#9 pc_init1 (machine=0x3b25880, host_type=<optimized out>, pci_type=<optimized out>) at ../hw/i386/pc_piix.c:288
#10 0x000000000116fa72 in machine_run_board_init (machine=0x3b25880) at ../hw/core/machine.c:829
#11 0x000000000109b4c5 in main_impl (argc=<optimized out>, argv=<optimized out>,
on_main_loop_done=0x10959a0 <enter_qemu_main_loop(int, char**)::$_4::__invoke()>) at ../vl.c:5533
#12 0x0000000001097746 in run_qemu_main (argc=129102200, argv=0x0, on_main_loop_done=0x392aaf) at ../vl.c:3360
#13 0x0000000001092c3a in enter_qemu_main_loop (argc=112, argv=0x3b24e00) at ../android-qemu2-glue/main.cpp:731
#14 0x00007ffff7320233 in QThreadPrivate::start (arg=0x3a9a420)
at /usr/local/google/home/wdu/build-qt/src/qt-everywhere-src-5.12.1/qtbase/src/corelib/thread/qthread_unix.cpp:361
#15 0x00007ffff79d4d80 in start_thread (arg=0x7fffe03b5640) at pthread_create.c:481
#16 0x00007ffff6396bdf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#0 AUD_open_out (card=0x5086388, sw=0x0, name=0x2d9383 "dac", callback_opaque=callback_opaque@entry=0x50863a8,
callback_fn=0x1156820 <hda_audio_output_cb>, as=as@entry=0x50863d4) at ../audio/audio_template.h:399
#1 0x000000000115677f in hda_audio_setup (st=0x50863a8) at ../hw/audio/hda-codec.c:288
#2 0x0000000001156c8d in hda_audio_init (hda=hda@entry=0x5086300, desc=<optimized out>) at ../hw/audio/hda-codec.c:520
#3 0x0000000001156e34 in hda_audio_init_duplex (hda=0x5086300) at ../hw/audio/hda-codec.c:640
#4 0x00000000011590c3 in hda_codec_dev_realize (qdev=<optimized out>, errp=0x7fffe03b4288) at ../hw/audio/intel-hda.c:69
#5 0x0000000001176890 in device_set_realized (obj=<optimized out>, value=true, errp=0x7fffe03b4378) at ../hw/core/qdev.c:852
#6 0x0000000001247fdc in property_set_bool (obj=0x5086300, v=<optimized out>, name=<optimized out>, opaque=0x9604650, errp=0x7fffe03b4378)
at ../qom/object.c:1923
#7 0x00000000012498ed in object_property_set_qobject (obj=0x5086388, value=<optimized out>, name=0x2d9383 "dac", errp=0x50863a8)
at ../qom/qom-qobject.c:27
#8 0x00000000012467cc in object_property_set_bool (obj=0x5086388, value=<optimized out>, name=0x2d9383 "dac", errp=0x50863a8)
at ../qom/object.c:1188
#9 0x000000000117541f in qdev_init_nofail (dev=0x5086300) at ../hw/core/qdev.c:339
#10 0x000000000115713c in intel_hda_and_codec_init (bus=<optimized out>) at ../hw/audio/intel-hda.c:1355
#11 0x00000000011594d6 in soundhw_init () at ../hw/audio/soundhw.c:151
#12 0x000000000109b514 in main_impl (argc=<optimized out>, argv=<optimized out>,
on_main_loop_done=0x10959a0 <enter_qemu_main_loop(int, char**)::$_4::__invoke()>) at ../vl.c:5554
#13 0x0000000001097746 in run_qemu_main (argc=84435848, argv=0x0, on_main_loop_done=0x2d9383) at ../vl.c:3360
#14 0x0000000001092c3a in enter_qemu_main_loop (argc=112, argv=0x3b24e00) at ../android-qemu2-glue/main.cpp:731
#15 0x00007ffff7320233 in QThreadPrivate::start (arg=0x3a9a420)
at /usr/local/google/home/wdu/build-qt/src/qt-everywhere-src-5.12.1/qtbase/src/corelib/thread/qthread_unix.cpp:361
#16 0x00007ffff79d4d80 in start_thread (arg=0x7fffe03b5640) at pthread_create.c:481
#17 0x00007ffff6396bdf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#0 AUD_open_in (card=0x5086388, sw=0x0, name=0x392af6 "adc", callback_opaque=callback_opaque@entry=0x50864f8,
callback_fn=0x1155910 <hda_audio_input_cb>, as=as@entry=0x5086524) at ../audio/audio_template.h:399
#1 0x000000000115680c in hda_audio_setup (st=0x50864f8) at ../hw/audio/hda-codec.c:293
#2 0x0000000001156c8d in hda_audio_init (hda=hda@entry=0x5086300, desc=<optimized out>) at ../hw/audio/hda-codec.c:520
#3 0x0000000001156e34 in hda_audio_init_duplex (hda=0x5086300) at ../hw/audio/hda-codec.c:640
#4 0x00000000011590c3 in hda_codec_dev_realize (qdev=<optimized out>, errp=0x7fffe03b4288) at ../hw/audio/intel-hda.c:69
#5 0x0000000001176890 in device_set_realized (obj=<optimized out>, value=true, errp=0x7fffe03b4378) at ../hw/core/qdev.c:852
#6 0x0000000001247fdc in property_set_bool (obj=0x5086300, v=<optimized out>, name=<optimized out>, opaque=0x9604650, errp=0x7fffe03b4378)
at ../qom/object.c:1923
#7 0x00000000012498ed in object_property_set_qobject (obj=0x5086388, value=<optimized out>, name=0x392af6 "adc", errp=0x50864f8)
at ../qom/qom-qobject.c:27
#8 0x00000000012467cc in object_property_set_bool (obj=0x5086388, value=<optimized out>, name=0x392af6 "adc", errp=0x50864f8)
at ../qom/object.c:1188
#9 0x000000000117541f in qdev_init_nofail (dev=0x5086300) at ../hw/core/qdev.c:339
#10 0x000000000115713c in intel_hda_and_codec_init (bus=<optimized out>) at ../hw/audio/intel-hda.c:1355
#11 0x00000000011594d6 in soundhw_init () at ../hw/audio/soundhw.c:151
#12 0x000000000109b514 in main_impl (argc=<optimized out>, argv=<optimized out>,
on_main_loop_done=0x10959a0 <enter_qemu_main_loop(int, char**)::$_4::__invoke()>) at ../vl.c:5554
#13 0x0000000001097746 in run_qemu_main (argc=84435848, argv=0x0, on_main_loop_done=0x392af6) at ../vl.c:3360
#14 0x0000000001092c3a in enter_qemu_main_loop (argc=112, argv=0x3b24e00) at ../android-qemu2-glue/main.cpp:731
#15 0x00007ffff7320233 in QThreadPrivate::start (arg=0x3a9a420)
at /usr/local/google/home/wdu/build-qt/src/qt-everywhere-src-5.12.1/qtbase/src/corelib/thread/qthread_unix.cpp:361
#16 0x00007ffff79d4d80 in start_thread (arg=0x7fffe03b5640) at pthread_create.c:481
#17 0x00007ffff6396bdf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
rk...@google.com <rk...@google.com> #21
BTW, I am migrating us to
ma...@gmail.com <ma...@gmail.com> #22
Not opening the microphone at all is definitely a strategy. I don't think many people actually do record sound with the emulator (but happy to be proven wrong). Or perhaps adding a default-off checkbox in the emulator settings to explicitly enable the microphone only when actually needed could be another way to go.
rk...@google.com <rk...@google.com> #23
I suspect there could be a reason (probably not a very good one) why sound cards are implemented this way. I XRUN
because some global variables compare in a certain way) similar to what I am having in virtio-snd currently. So, I
ma...@gmail.com <ma...@gmail.com> #24
I'm sorry but I only have high level knowledge of this stuff so I can't help much when it comes to linux drivers. But I'll be happy to try out any pre-release should this be of help!
rk...@google.com <rk...@google.com> #25
I believe this is not a kernel, but some weird assumptions in qemu which break if we open a device moments before using it or in a wrong thread. If you happen to have a linux machine and willing to build and play with our emulator, we will be happy to take a patch from you :) From here I will be working on virtio-snd first and then I will try to figure out if we can -no-microphone
.
ad...@linkedin.com <ad...@linkedin.com> #26
This looks like not an easy issue to fix! I also personally dislike fixing race-condition bugs by adding delays as these bugs could resurface back after some time.
Do you think we could disable mic by default and add an option to manually enable it for those who need it? The audio recording isn't a main stream feature for many developers
rk...@google.com <rk...@google.com> #27
This looks like not an easy issue to fix! ... as these bugs could resurface back after some time.
I agree :(
we could disable mic by default
If we go this way, we probably want to add an option to disable it.
ad...@linkedin.com <ad...@linkedin.com> #28
If we go this way, we probably want to add an option to disable it.
This also works, at least we could disable mic manually and have the sound quality back. Do you think you could use it as a short term fix while you are looking for a better solution?
rk...@google.com <rk...@google.com> #29
a short term fix while you are looking for a better solution?
I'll talk about it on our weekly meeting on Tuesday.
dm...@gmail.com <dm...@gmail.com> #30
ad...@linkedin.com <ad...@linkedin.com> #31
rk...@google.com <rk...@google.com> #32
rk...@google.com <rk...@google.com> #33
I figured out how to pass runtime values into virtio-snd
and hda-duplex
, we should be able to avoid opening the microphone in those devices. When I tried the same with goldfish_audio
, the QEMU says -device goldfish_audio,debug=42: Parameter 'driver' expects pluggable device type
. We probably want to retire (not sure if we can just disable it) this device instead of hacking it further.
rk...@google.com <rk...@google.com> #34
I merged a
ma...@gmail.com <ma...@gmail.com> #35
"Sounds like" (pun intended) a very good improvement!
BTW: What decides which audio driver to use (I mean with which logic virtio-snd
or hda-duplex
or goldfish_audio
is used) ?
be...@gmail.com <be...@gmail.com> #36
rk...@google.com <rk...@google.com> #37
What decides which audio driver to use?
virtio-snd is a drop-in replacement for Intel HDA, but the linux driver is required. If
if this fix will apply to me (I'm using an M1 mac) and
Yes, it will apply for Apple M1.
when the fix will go out?
I still need to figure out what to do with goldfish_audio if our leads will not buy my change to disable the microphone permanently on goldfish_audio. One everything is merged, we should release the changes into the canary channel in weeks.
ma...@gmail.com <ma...@gmail.com> #38
Cool thanks!
If the system image says it has the driver, then we use the virtio-snd device
Do you know from which API do system images ship with the linux virtio driver?
rk...@google.com <rk...@google.com> #39
T is the first system image with virtio-snd drivers.
ma...@gmail.com <ma...@gmail.com> #40
Super! To sum it up: with any emu image with at least api26 the mic will obey the hw.audioInput
setting in the .ini file otherwise (for older emu images) the mic will always be disabled. Correct?
rk...@google.com <rk...@google.com> #41
Unfortunately we create the goldfish_audio device unconditionally, it is not even a sound card from the qemu point of view, it just happens to call the audio API. I disabled the microphone in goldfish_audio
rk...@google.com <rk...@google.com> #42
All changes are merged and available in the 8513367 emulator build. I checked our system images, on x86 the microphone issue should be fixed on API23 and later, on arm ones - API29 and later. We will see if we can fix our older arm system images (API28 and older).
rk...@google.com <rk...@google.com> #43
To disable the microphone you want to add hw.audioInput=no
to config.ini
in the AVD folder.
ji...@gmail.com <ji...@gmail.com> #44
Following along from #43, I figured I should mention I recently opensourced the tool I built to quickly enable and disable the hw.audio*
(and other) settings on the various emulators I use for day to day development:
A checkbox just makes life a bit easier than constantly going in and hand editing .ini files.
Thanks for your work on this ticket and #37095756 over the last couple of years, appreciate it.
ma...@gmail.com <ma...@gmail.com> #45
All changes are merged and available in the 8513367 emulator build.
Is this build downloadable somewhere?
Is there a target version in which we can expect this fix to land in (I'm currently using emulator v 31.3.2)?
rk...@google.com <rk...@google.com> #46
Is this build downloadable somewhere?
While there is nothing secret there, I am not sure how to share it with you until we release the usual way.
Is there a target version
I don't know yet. Our emulator version is something like 31.3.7-8408431
, the build number is after the dash.
rk...@google.com <rk...@google.com>
ma...@gmail.com <ma...@gmail.com> #48
Thank you, I was able to access a build and I could verify on my machine that the issue has been resolved. thank you very much everyone again for listening to our comments until here!
ma...@gmail.com <ma...@gmail.com> #49
Hello,
emulator 31.3.8 build 8598121 just landed in the canary channel.
Can you please check if it includes this fix?
Writing hw.audioInput=no
in config.ini
and using an API32 image still produces the BT audio switch when launching the emu.
rk...@google.com <rk...@google.com> #50
Got log says 31.3.8 should include my change to fix this issue. Unfortunately I am out of the office and cannot check this.
rk...@google.com <rk...@google.com> #51
I confirm, 8513367
does not affect BT audio quality, while 8598121
does affect.
rk...@google.com <rk...@google.com> #52
rk...@google.com <rk...@google.com> #53
Here is what happened: the last time we cut a new release was April, 4. Since then we have been doing cherry-picks which I have not requested before. With the cherry-picks requested this fix is available in 31.3.9 which should be published by the end of this week or the next week.
rk...@google.com <rk...@google.com> #54
Ranjit, could you please confirm this fix is available in 31.3.9?
You need bluetooth headphones for it.
- Connect the headphones to the host.
- Start some audio on the host (e.g. a youtube video with good audio quality).
- Coldboot an emulator (you can use any system image, e.g. S), notice host's audio quality drops when the emulator starts.
- Add
hw.audioInput=no
to the AVD'sconfig.ini
. - Coldboot the emulator again, check if host's audio quality is unaffected.
ra...@google.com <ra...@google.com> #55
I verified with steps mentioned on #54 on Mac Intel(macOS Monterey with Version 12.4) and Mac M1(macOS Big Sur with Version 11.6.6)
With hw.audioInput=yes observed the following issues on both Mac machines.
1) When I cold boot AVD the audio on the host stops for a bit and then continues. There is a change in audio quality.
2) When I do wipe data on the AVD the audio on the host breaks for a bit.
After updating hw.audioInput=no to the AVD's config.ini the issues are resolved. I neither see change in the audio quality nor the audio breaks on the host machine.
ma...@gmail.com <ma...@gmail.com> #57
I can confirm 31.3.9 is now available from the canary channel and that it includes this fix. Thanks a lot for making this happen!
bo...@gmail.com <bo...@gmail.com> #58
rk...@google.com <rk...@google.com> #59
The fix should be available on M1 as well, it is in the 31.3.9 version. What is your emulator version?
ma...@gmail.com <ma...@gmail.com> #60
I confirm I've tested it with 31.3.9 on M1 processor and it's working.
ja...@edg.com.au <ja...@edg.com.au> #61
ma...@gmail.com <ma...@gmail.com> #62
Did you tweak the .ini file as it was explained in this long thread?
rk...@google.com <rk...@google.com> #63
Hi Jamie, it should be fixed, please add hw.audioInput=no
to AVD's config.ini
file for API32 and below. It is not required for API33 and above. There are some other quirks there (in API33) as I am learning about QEMU audio API behavior (the QEMU and kernel disagree on how audio is consumed).
sh...@gmail.com <sh...@gmail.com> #64
It is not required for API33 and above
Using API 33 but the sound quality still drops
rk...@google.com <rk...@google.com> #65
shalva258, could you please elaborate? I just created API30 and API33 on Mac and I can hear that API30 affects audio in my bt headphones when the emulator starts and API33 does not. Maybe update the emulator? I tried on 32.1.3.
sh...@gmail.com <sh...@gmail.com> #66
sh...@gmail.com <sh...@gmail.com> #67
rk...@google.com <rk...@google.com> #68
Try installing
> Is not this the version that should have fixed this?
You want at least 31.3.9.
[Deleted User] <[Deleted User]> #69
[Deleted User] <[Deleted User]> #70
حذف الكل
pa...@outlook.com <pa...@outlook.com> #71
It's freaking 2024, the original issue from 2016 that was marked as fixed was definitely not fixed, this one wasn't either. Windows 10, using emulator 34.2.14-11834374 and this beyond intrusive problem is still there. Good luck trying to share your emulator screen on a meeting and keep your audio and mic working without problems, you won't because this insanely dumb bug is still present to this day and it takes over your audio input forcing hour headset into hands-free mode when you don't want to.
rk...@google.com <rk...@google.com> #72
Hi particlecore,
It's freaking 2024, the original issue from 2016 that was marked as fixed
The original issue is fixed.
Good luck trying to share your emulator screen on a meeting and keep your audio and mic working without problems
This is a separate problem which we have never heard before. Please file a new bug (specify which meeting software you use).
Description
OS: macOS 11.2.3 Emulator version: 30.5.3 Image: x86_64 with play store
I use a tool that monitors audio devices activity. I see that it notifies me about my microphone is active
Steps to Reproduce:
Please check the attachments.