This is a reincarnation of https://github.com/ankidroid/Anki-Android/issues/1729
Audio always plays to the end
A small portion of audio at the end is sometimes cut off. Audio always plays completely when started manually.
AnkiDroid Version = 2.8.4
Android Version = 9
ACRA UUID = 52d6fd21-45ad-4229-834b-b16c62882197
Collection with a bunch of cards for which I've seen this bug: Ankidroid_sound_bug.zip
Sony Xperia XZ2 Compact 2018 (Android 9) - reproducible
Moto X 2013 (Android 5.1) - could not reproduce
Nexus 7 tablet 2013 (Android 6.0.1) - could not reproduce
Moto G6 2018 (Android 8.0.0) - reproducible
Enter an [ x ] character to confirm the points below:
[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
[ x ] I have checked the manual and the FAQ and could not find a solution to my issue
[ x ] I have searched for similar existing issues here and on the user forum
Thanks for reporting this - we have had a lot of difficulty reproducing these in the past. I suspect that it may even be device-specific making it almost impossible... To isolate it, can I ask for a couple extra steps? Can you try to reproduce this on any other device if you have access to one? Possibly at the same time, if you could isolate it to some media files that work and some that don't, and attach a collection export with those files here so we have a test case we can try to reproduce it here.
Results for a few other devices:
Moto X 2013 (Android 5.1) - could not reproduce
Nexus 7 tablet 2013 (Android 6.0.1) - could not reproduce
Moto G6 2018 (Android 8.0.0) - reproducible
Will make a collection with some media files tomorrow.
Thanks @mighty-cthulhu - you can see why these are hard to nail down :-). Ideally it's then an Android 8.0.0 thing and the problem shows up on the emulator - if it's a Motorola + Android 8.0.0 thing, it's going to be really hard because I don't have that handset
Not just Motorola, also Sony Xperia XZ2 with Android 9 (mentioned in the first message of this thread)
Ah yes - sorry! That gives me more hope. Maybe it's Android >= 8.0.0 - as soon as you post a collection I'll check it real quick to see
and note that github won't take an '.anki2' file, but they're actually just zip files and if you just rename it collection.zip or whatever and it works fine for me
Here's a bunch of cards with audio files that had this issue:
Ankidroid_sound_bug.zip
I was not able to reproduce this in either an API27 (8.1) or API28 (9) emulator :-(
I haven't tried on my handset (OnePlus 5, API27) or tablet (Samsung S2, API27) yet.
Also having this issue on a Pixel 2 XL running Android 9, AnkiDroid 2.8.4.
I can also create a zip of a few notes with the issue if that would be helpful.
Sure - we are having trouble reproducing so more examoles can help
Here you go, hope it helps. Also I tend to notice that this happens more often with my shortest audio files.
ankidroid sound issue.zip
I also have this issue, Pixel 2 (non XL), AnkiDroid 2.8.4.
I have definitely seen this happen on my Pixel 2 (non XL) before but it has been a while and it was _very_ infrequent. I'm on 2.8.4 now but I doubt I've ever run into this while I've been on that version. Seems like it's been weeks/months.
This may be a long shot but.. it was a few months ago that I started a new deck that I did _not_ want to play audio automatically so I had to create a new option group for it which has that option disabled, while my main deck still has it enabled under the Default option group. It's possible I haven't seen the problem since then.
Might be worth a try for someone who can reliably reproduce this to:
Would be weird if that fixed it but I've seen stranger things and it might help provide a lead as to the root cause.
Tried this, no different. First card I opened after unchecking autoplay in the new deck cut short again. As another commenter noted, it seems to happen only with shorter audio files.
I'm also having this issue on One Plus 6 (ankidroid) and on the desktop using the Japanese 2k/6k core deck.
I have this issue with AnkiDroid on One Plus 6T. I am also using the Japanese 2k/6k core deck, specifically this one
I am unable to reproduce the issue on dekstop. The issue began to appear after a system update in late december last year. Before this, the app worked as expected with no issues.
The issue seems to be more prominent when using bluetooth headphones, however it also appears when using the internal speaker, although not as often. The issue also seems to only trigger on certain cards, and the audio cuts off at the same point every time.
I am also unable to reproduce the issue on my Honor 7 Lite (Model number NEM-L21, android version 7.0).
I am willing to do more testing in order to aid in resolving this issue.
Edit:
Upon closer inspection of the month during which the issue began to appear, it would seem that it was right after updating my smartphone to Android 10.
The issue does not appear when using the same bluetooth headphones on either desktop or the Honor 7 lite device.
Playing music or other forms of audio in the background as if to keep the connection to the headphones active completely throughout the sentence does not fix the issue.
@ovilers
Adding a few more debug log statements (Timber.d) around the area would probably be my first port of call, as then we'll be able to compare the differences between a known good, and a problematic implementation.
My first guess would be that you should try setting OnErrorListener and see if any errors are caught which stop playback early: https://stackoverflow.com/a/38474407
Our getting started guide may be useful: https://github.com/ankidroid/Anki-Android/wiki/Development-Guide
Thanks for taking an interest :)
Thanks for replying @david-allison-1
Unfortunately my knowledge on writing code is very poor, and i'm not quite certain i understand what exactly you want me to do. I'm guessing you're suggesting i compile a version of the app with added debug functions around the audio?
@ovilers Okay, understood. It'd be best if you could come to discord (https://discord.gg/EUcWp9) and we can work out the best way to move forwards. Feel free to email me via gmail: davidallisongithub if you'd prefer to find an alternate method of communication.
Hello 馃憢, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like _still searching for solutions_ and if you found one, please open a pull request! You have 7 days until this gets closed automatically
It'd be great if we could get a repro on the Samsung test lab: https://developer.samsung.com/remote-test-lab
Interesting thought: does this occur over bluetooth? Does adding silence before/after fix the problem: https://github.com/anars/blank-audio
I think most of these are bluetooth because until very very very recently (read as: all modern hardware) bluetooth sound was terrible about stopping and starting and timing, in personal experience
AnkiDroid Version = 2.12.1
Android Version = 10
ACRA UUID = b914fef6-716a-4f97-949a-bf5632484f1a
I want to listen to the same audio file repeatedly. For this reason I copied the audio button 19 times ('{{Audio}}{{Audio}}{{Audio}}'). Sometimes this error occurs. Then any subsequent repitition stops prematurely at the same time.
Stopping the repeating audio and pressong 'Replay audio' may fix the issue locally though it may happen again.
I already suspected the issue to occur more often if bluetooth is activated, though it definetely also occurs if it is not activated.
@Rupestris I'm not sure this will have the same root cause, either way could you reproduce with 2.13.2 (current stable?) - there have been lots of changes since 2.12.1
@mikehardy Thank you. I updated and could reproduce it.
AnkiDroid Version = 2.13.2
Android Version = 10
ACRA UUID = b914fef6-716a-4f97-949a-bf5632484f1a
Scheduler = std