waydroid / waydroid

Waydroid uses a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.
https://waydro.id
GNU General Public License v3.0
7.22k stars 301 forks source link

[BUG] Audio not working with mutter --wayland #1464

Open brokeDude2901 opened 1 week ago

brokeDude2901 commented 1 week ago

Describe the bug

Following https://docs.waydro.id/faq/setting-up-waydroid-only-sessions, I start Waydroid from a Ubuntu Server TTY session:

#!/bin/sh
mutter --wayland &
sleep 5
waydroid show-full-ui

The Audio is not working also prevent Youtube Video from loading properly (very slow, frame by frame) sudo waydroid logcat:

06-18 23:09:52.770    55   832 E audio_hw_primary: Failed to open pcm_out after 100 tries
06-18 23:09:55.791    55   832 E audio_hw_primary: Failed to open pcm_out after 100 tries
06-18 23:09:55.834    94   211 W AudioFlinger: write blocked for 3018 msecs, 118 delayed writes, thread 13
06-18 23:09:55.838   230  3052 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
06-18 23:09:57.819  2994  3174 W DefaultAudioSink: Spurious audio timestamp (system clock mismatch): 0, 23899922932, 23904926700, 170666, 41928, 40992
06-18 23:09:58.328  2994  3174 W DefaultAudioSink: Spurious audio timestamp (system clock mismatch): 0, 23899922932, 23905435218, 170666, 41928, 40992
06-18 23:09:58.834  2994  3174 W DefaultAudioSink: Spurious audio timestamp (system clock mismatch): 0, 23899922932, 23905940986, 170666, 41928, 40992
06-18 23:09:58.865    55   832 E audio_hw_primary: Failed to open pcm_out after 100 tries

Waydroid version

1.4.2

Device

Linux Desktop

Operating System

Ubuntu 24.04 LTS (Server)

Kernel version

6.8.0-35-generic

Desktop Environment

Mutter

GPU

Mesa Intel HD Graphics (CHV)

Logs

/var/lib/waydroid/waydroid.cfg /var/lib/waydroid/waydroid.prop /var/lib/waydroid/waydroid_base.prop /var/lib/waydroid/waydroid.log sudo waydroid shell -- logcat -d | tee logcat.txt sudo dmesg | tee dmesg.txt

/var/lib/waydroid/waydroid.cfg

[waydroid]
arch = x86_64
vendor_type = MAINLINE
system_datetime = 1718414997
vendor_datetime = 1714216970
suspend_action = freeze
mount_overlays = True
auto_adb = True
images_path = /var/lib/waydroid/images
system_ota = https://ota.waydro.id/system/lineage/waydroid_x86_64/GAPPS.json
vendor_ota = https://ota.waydro.id/vendor/waydroid_x86_64/MAINLINE.json
binder = anbox-binder
vndbinder = anbox-vndbinder
hwbinder = anbox-hwbinder
binder_protocol = aidl3
service_manager_protocol = aidl3

[properties]

/var/lib/waydroid/waydroid.prop

sys.use_memfd=true
debug.stagefright.ccodec=0
ro.hardware.gralloc=gbm
ro.hardware.egl=mesa
ro.hardware.vulkan=intel
ro.hardware.camera=v4l2
ro.opengles.version=196609
waydroid.system_ota=https://ota.waydro.id/system/lineage/waydroid_x86_64/GAPPS.json
waydroid.vendor_ota=https://ota.waydro.id/vendor/waydroid_x86_64/MAINLINE.json
waydroid.tools_version=1.4.2
ro.vndk.lite=true
waydroid.host.user=vietanh
waydroid.host.uid=1000
waydroid.host.gid=1000
waydroid.host_data_path=/home/vietanh/.local/share/waydroid/data
waydroid.xdg_runtime_dir=/run/user/1000
waydroid.pulse_runtime_path=/run/user/1000/pulse
waydroid.wayland_display=wayland-0
waydroid.background_start=false
waydroid.stub_sensors_hal=1

/var/lib/waydroid/waydroid_base.prop

sys.use_memfd=true
debug.stagefright.ccodec=0
ro.hardware.gralloc=gbm
ro.hardware.egl=mesa
ro.hardware.vulkan=intel
ro.hardware.camera=v4l2
ro.opengles.version=196609
waydroid.system_ota=https://ota.waydro.id/system/lineage/waydroid_x86_64/GAPPS.json
waydroid.vendor_ota=https://ota.waydro.id/vendor/waydroid_x86_64/MAINLINE.json
waydroid.tools_version=1.4.2
ro.vndk.lite=true

logcat.txt dmesg.txt

electrikjesus commented 1 week ago

Is audio working through your normal GUI session on Linux?

brokeDude2901 commented 1 week ago

Is audio working through your normal GUI session on Linux?

Let me report back in 30 mins, installing ubuntu-desktop-minimal !

brokeDude2901 commented 1 week ago

By installing ubuntu-desktop-minimal and selecting the correct audio output device in Gnome DE fixed it. Also mutter seem to follow the Scaling of Gnome DE (x2 in my case), so instead of setting:

waydroid prop set persist.waydroid.height 1920
waydroid prop set persist.waydroid.width 1200

divide by 2 will fix the wrong resolution

waydroid prop set persist.waydroid.height 960
waydroid prop set persist.waydroid.width 600

Device is a Fujitsu Q507 Arrow Tab image Also I need to apply this to fix the sound beeping freezing issue (only for this device): https://www.reddit.com/r/Ubuntu/comments/ug4xes/fix_for_continuous_steady_beepscreech_on_intel/

electrikjesus commented 1 week ago

I had a feeling it might follow what GNOME setup for audio. It would be a good idea to look deeper into it in order to figure out the bare minimum requirements though

brokeDude2901 commented 1 week ago

I had a feeling it might follow what GNOME setup for audio. It would be a good idea to look deeper into it in order to figure out the bare minimum requirements though

I think the minimum requirements for mutter --wayland should be a running/working Wayland GNOME DE (ubuntu-desktop or ubuntu-desktop-minimal...), because to adjust brightness I still have to switch to Login Screen and use the Brightness slider there (Ctrl + Alt + F1). No need to log in though.