-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement audio timing #1034
base: master
Are you sure you want to change the base?
Implement audio timing #1034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
I will merge as soon as I do a rebuild of the Android image.
Hope to see this merged soon, cause I succ at building this myself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
So when is this getting merged? |
This patch is great, finally making Anbox usable for me. Please merge soon if possible! |
@morphis, I guess the last image has been more than a year then. Please build a new one and merge this! |
please merge this! |
@morphis When are you going to merge this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please don't close this, it has gotten no reaction from the maintainer of Anbox since ages but is still desperately wanted. @morphis please merge this at some point, you already said it looks good. |
+1 for merging this |
This is the only thing that bothers me when playing LDOE on PC |
You mentioned that you wanted to build a new version of android when merging this. What is the status of that? Can we do anything to help? |
@Fincer has a patched image with this PR included: https://fjordtek.com/public/applications/anbox/images/android_7.1.1_r13_patched.img |
I replaced the image and restarted the service, it does not improve the sound delay. |
Yes, and to be more open about the image content itself, as someone may have security concerns: All Android image patch files and rough build process steps I've used for the linked image file are described here: https://fjordtek.com/git/Fincer/anbox-install/src/branch/master/androidOS_files Whoever wants to compile the image him/herself, can do so. The only downside is HUGE size of downloadable AOSP source code, ~300 gigabytes. I want to be very open about the image build process, and which parts of the image file have actually been changed compared to vanilla Anbox Android image file. I fully understand doubts of downloading a image file from non-GitHub location, therefore I absolutely prefer openness in sharing information as much as I can. To be honest, I'd prefer if Anbox project officially could host a patched image file, whoever compiles it. It's not that much effort if the build environment requirements are met. Compiling the image takes ~3-4 hours on my laptop, for instance. That doesn't sound good. For me, the patched image file fixes playback issues of NewPipe YouTube streams. What is your use case, i.e. the Android application you use? |
@Fincer Thank you for your reply, I'm trying to play Last Day On Earth. |
FWIW I've made an automated builder that includes this patchset by default: https://source.puri.sm/sebastian.krzyszkowiak/anbox-image-builder/ It works great for me and it does improve audio latency significantly, but of course you need this patchset to be applied to both the image and Anbox itself. |
oh dear this has a conflict now |
I've built an ArchLinux package that works with this image. Give it a try. You'll need a kernel that supports anbox and lxc version 4.0.6 or older. The patch used in this build is taken from 👇
|
Honestly surprised no one has forked this yet, something as essential and requested as better audio latency for proper video playback and games has been held back by 2 and a half years for no apparent reason. With the announcement that Windows 11 will support Android apps, soon most other popular OS (Windows, Chrome OS and macOS) will have a way of running mobile apps with ease, in an integrated manner. Yet Linux, in which Android is based of, is still missing features as basic as this for Android apps, and most games don't run yet out of the box (and it's not like they can't run, you just need to mess with command line parameters in order to make them work) Anbox is a good project, don't get me wrong, but there hasn't been any noticeable significant improvements for years (just under the hood, minor stuff) while PRs like this have been years in limbo just because. There hasn't even been an official response from the maintainer yet (other than the "will merge after next rebuild" we got years ago). No ETA, no justification, nothing. This PR has been ignored for years and I'm sure many others are facing similar issues. Seeing how many other open source projects have been forked for similar management shenanigans, it really comes as a surprise to me there hasn't been any notable forks yet. |
Just for the sake of it, let's ping @morphis again. |
@TheBITLINK the 938 forks say hi :P this PR was "held back" because the maintainer hasn't found the time to rebuild the images anbox uses to make use of this, building android images can be pretty time consuming process sadly. just cloning the needed files can take up to 100GB! if anything i think that if we can figure out a way to set up a CI for building the image somehow it could help the maintainer greatly when it comes to this |
@Fuseteam Some time ago I've prepared a builder based on Docker to produce Anbox images: https://source.puri.sm/sebastian.krzyszkowiak/anbox-image-builder/ In fact it even allows to effortlessly patch the image and includes this particular MR by default. It does arm64 images because that's all I cared about, but it could be of course adjusted. I haven't used it in last few months though so hopefully it still works ;) |
@dos1 cool maybe you can make a PR to https://github.com/anbox/platform_manifests so that it builds automatically from there using that in a CI or something hehe |
?????????????????? |
I've forked this project and make it work on arch linux x86_64.
The working anbox source code for this image is T2hhbmEK/anbox (niek branch). HOW TO
Done. Enjoy anbox without audio lag. |
Since the anbox project owner does NOT have resources/willingness to build a new image. |
Maybe it's time to deprecate Anbox now that the Waydroid project has matured. I tested audio/video playback and it works fine. The only issue is with nvidia drivers not being supported which can be fixed using software rendering. |
Maybe that's because Waydroid doesn't work with xorg (I wish it did), and nvidia has just started to support Wayland. |
Waydroid is still called |
Waydroid doesn't work on Nvidia because of driver issues :( I wouldn't even be paying attention to this issue if Waydroid worked for me because it seems so much better |
I'm using it with my nvidia gpu using software rendering and honestly it still works better than anbox and feels even smoother. You don't need wayland too, just open a weston window inside your Xorg session and run it in there. |
For those gamers' concern, I'm using Anbox for gaming. I've tried Waydroid. At present, It does not support hardware rendering for my RX 6600 XT. So still waiting for improvements until I can switch to Waydroid. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The changes are still approved, tho it has a conflict now |
@morphis when can we expect this to happen? |
@cobalt2727 Never, all the repositories under the |
Can this patch be reworked to work with Waydroid? Because Waydroid has the same audio latency issues. |
This patch is irrelevant for Waydroid as it implements audio in a completely different way and doesn't suffer from the issue this patch was fixing at all. |
Last time I used Waydroid I remember the audio being a couple seconds late - so it has the same problem as this patch, just in a different way? Are there any issues/PRs open for that? |
|
Totally forgot about that one (looks like I even commented on it last year). Thanks! |
This implements audio timing, although, a little bit in a hacky fashion.
Drastically reduces audio latency from 1-2 seconds to ~46 ms.
(~23 ms playing, the other ~23 ms in buffer, if I'm not mistaken)
Idea is to block the Android audio thread by reading from the socket after submitting the audio data.
The sink after receiving the data, places it into queue and responds to Android.
If queue is full, then it will block until data is written, delaying audio thread for as long as needed.