Android: Ringtones disappear from sounds and tones

Created on 20 Dec 2019  Â·  56Comments  Â·  Source: nextcloud/android

Actual behavior

Ringtones disapper from under sounds and tones as soon as an autoupload completes successfully from the nextcloud app. The sounds come back if the phone is re started, and they disapper again after any auto upload. This causes phone not to ring at all because there are no sounds/tones available under the sounds options

Expected behaviour

  • The sounds should not disappear after every automatic upload to the server.

Steps to reproduce

  1. Turn on auto upload for camera photos
  2. Click a photo, and wait for auto upload to complete
  3. Check under sounds and tones, you should see none.

Environment data

Android version: 10

Device model: Oneplus GM1901

Stock or customized system: Oxygen OS 10.0.1.GM57AA

Nextcloud app version: 3.9.2

Nextcloud server version: 17

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

approved bug

Most helpful comment

Thanks for testing.
I finally also found an emulator where I can reproduce it.
Sadly, when I move a file while uploading it is not shown in gallery, so I have to find a way to replace the old media scanner for newer Android versions…

All 56 comments

Verified. I can reproduce the same behaviour in my OnePlus 7t with 10.0.7.HD65BA Oxygen OS version.

Ringtones and notification tones are missing when Next loud app syncs.

Quick fix to recover ringtones and notification tones: reboot system (but it is not a valid solution)

Cc @tobiasKaminsky since I think this is a false conclusion. We as an app don't touch anything near your ringtones so I'd rather think you hit an OxygenOS bug we can do nothing about.

What do you think @tobiasKaminsky?

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

The issue still persists, the ringtones disappear everytime there is an automatic upload from nextcloud app

Regards,

Jivesh Vashist


From: stale[bot] notifications@github.com
Sent: Thursday, February 6, 2020 4:17:23 PM
To: nextcloud/android android@noreply.github.com
Cc: jv2007 jivesh.vashist@hotmail.com; Author author@noreply.github.com
Subject: Re: [nextcloud/android] Ringtones disappear from sounds and tones (#5039)

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/nextcloud/android/issues/5039?email_source=notifications&email_token=AOCV3USU7C3F4DFISRAISS3RBSD7HA5CNFSM4J5UHWT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELA7YAA#issuecomment-583138304, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOCV3UXPZJW32ZLW2F3B2TLRBSD7HANCNFSM4J5UHWTQ.

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

Any questions or updates?

Regards,

Jivesh Vashist


From: stale[bot] notifications@github.com
Sent: Thursday, March 5, 2020 5:21:25 PM
To: nextcloud/android android@noreply.github.com
Cc: jv2007 jivesh.vashist@hotmail.com; Author author@noreply.github.com
Subject: Re: [nextcloud/android] Ringtones disappear from sounds and tones (#5039)

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/nextcloud/android/issues/5039?email_source=notifications&email_token=AOCV3UTCEKEMDFLTJOSQ3PDRGAXXLA5CNFSM4J5UHWT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN7IRAI#issuecomment-595495041, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOCV3UQY23KQK2YVAGJ6C43RGAXXLANCNFSM4J5UHWTQ.

I appreciate it's tough to identify whether it's OxygenOS, Android 10 or NextCloud that needs changing but I can confirm that it's been happening on my device since last month's update to Android 10 (previously Android 9).

I've had to disable photo uploads which is obviously a large part of what makes the NextCloud app useful so it would be good to at least identify what the cause of the problem is so we can supply relevant information/logs to the right people.

I've got hundreds of apps installed and this very specific behaviour of the NextCloud app is the only thing that triggers the problem so even if it's an OxygenOS bug, I hope that someone familiar with the relevant NextCloud code could hypothesise what might be going on.

I've only been able to reproduce the problem with InstantUploads. The Notes sync app and automatic contacts backup work fine.

Android version: 10 (SDK 29)
Device model: Oneplus A6003
Stock or customized system: Oxygen OS 10.3.1
Nextcloud app version: 3.10.1
Nextcloud server version: 17.0.3

Looping in @tobiasKaminsky @ezaquarii @ArisuOngaku since you folks might have an idea if/why such a behavior might get triggered. 🤞

This is super weird. Is it happening only on OnePlus devices?

It might be related to scoped storage (pure guess); someone who can reproduce the issue please send a log file (stripped out of sensitive data).

I'm happy to provide some logs but I can't work out how to find them. Please can someone direct me to the menu option to copy the logs or some instructions to help me find them?

@luckyrat A quick look in the code got me to think it was removed from the main app; @AndyScherzinger can you confirm? In this case I would ask you to reproduce this with the dev version of the app, then get the logs in the "More" category of the settings.

I confirm I am experiencing the same behavior, in similar conditions. Oneplus 6 running OxygenOS 10.3.2 (latest available update). I started experiencing this problem as soon as Android was updated from v9 to v10 on my device.
I may also add this piece of information: I have customized notifications for Whatsapp and Telegram (both private and group messages), using built-in notification sounds (stock OxygenOS sounds). As soon as the ringtone problem occurs, all these app-specific notifications get also set to strange, non-existent values. For instance, I get a number like "2617" where I used to see "Ding" as the notification sound, or "2622" where I had "Light". Of course this means I hear no sound at all, unless I manually re-set the notification sounds.
At the same time, system-wide notification sounds like SMS tone, which I have set to an audio file I stored in internal memory, or all those apps configured with the default system-wide notification sound, don't get changed. So apparently only app-specific notifications get changed (and the phone ringtone)

@luckyrat the easiest way to obtain the logs is to use the dev version of the app. Then find it in settings > more > logs

@nitefood thanks for your input. If this is possible, please share the logs of the app by reproducing the bug with the dev version of the app then grabing the file from settings > more > logs. Don't forget to strip out sensitive data if any (instance address, usernames...).

This is super weird. Is it happening only on OnePlus devices?

No, not only my Oneplus 7 Pro is affected, but also the Google Pixel 3A of my girlfriend.

With the oneplus 7 I am able to restart the phone every night and only upload the photos when the phone is charging in the evening, but with the Pixel 3A I cannot do that unfortunately.

I have the same with Android 10 and LineageOS.
Not sure what/why/if we are causing this…

I am debugging this right now.
One observation is that custom ringtones/notification sounds seem not be affected, e.g. I set it to one mp3 within my NC and it is still there, although all other built-in sounds are removed.

I have been fighting this issue since I purchased my OnePlus 7T about a month ago.
Latest update to Oxygen OS 10.0.9.HD65AA last night and problem still persist.

I really think that this is a bug out of scope of any app.
Imagine that any malicious app could change notification/ringtone sound, this would be a big problem…

I have this same problem on 2 phones in my family. Both are Motorola One Hyper running Android 10. After a photo is auto uploaded, ringtones/notifications show up as numbers instead of names, except custom mp3's. Manually uploading a photo works fine. Have to disable auto upload for now. I did change the default destination upload folder if that matters.

kernel 4.14.117-perf+

1 Wed Feb 12 08:28:43 CST 2020

What I do not get is the connection to AutoUpload, as this is mainly doing the same like upload

  • uploads a file
  • shows a notification

So if the notification would be the problem, it should also occur on manual file upload.

Then only difference is that auto upload is started as as background job…

I set my tones to a custom one and since then it works for me.
Can you verify this?

For my Oneplus this doesn’t work.

This seems to work for me. I rebooted phone and verify my normal ringtones/notifications are set properly. Take a picture, it auto-uploads, I get notifications in my status bar while it's happening (but no sound notification - not sure if this is normal), then check notification settings - they all show numbers instead of the real names. Trying to change them shows a list with nothing in it. Rebooting makes the list populate w/ all the default notification names and all is back to normal (until the next auto-upload). Again, manually uploading doesn't seem to trigger this.

If I set notifications to a mp3 from the internet, all of the above is still true, except there are no numbers listed, and trying to select another ringtone shows an empty list again except for the mp3 I previously set.

So it seems like wherever the storage for the default system notifications is is getting messed up, or some cache, or media scan, or something. Let me know if you have other experiments to try or want to gather logs somehow.

I added our findings to the google issue tracker: https://issuetracker.google.com/issues/139255464

@nateyoung can you go to app settings -> notifications and disable "upload channel" and see if the sound is still vanishing?
If yes, then please disable all other channels and try it again.

Thanks for testing!

Went to Settings -> Apps & Notifications -> Nextcloud -> Notifications

From here, I disabled "Upload notification channel", then auto-uploaded a photo - still fails.

Rebooted (back to normal), then disabled "Show notifications" to disable all notifications from Nextcloud, then auto-uploaded a photo - still fails.

wow, did not expected this :S
On Monday I'll try to all sound related calls in notifications and provide a test version.

A couple of other datapoints:

-I happened to be trying to recreate this and managed to create a conflict upload. I resolved it manually and the picture uploaded with notifications, but this didn't break the notification sound selection as above.

-After recreating the failure mode in another test, I rebooted and immediately went in to notification settings. They were still broken for a few seconds but then something refreshed and they were all back. I haven't figured out how to manually refresh this though. It's like the default system notification storage loses an index or cache or something.

Thanks for you sharing your findings.

It's like the default system notification storage loses an index or cache or something.

Well, this then sounds even more like a bug on Android, which accidently triggered by us.

I did figure out a workaround: using ES File Explorer, I copied all tones from Phone Storage -> product -> media -> audio -> alarms/notifications/ringtones to Internal Storage -> Alarms/Notifications/Ringtones. Then Android will show duplicates when selecting a tone, but after a Nextcloud auto upload, only the new copies are left behind. Select from these, and they persist after auto upload, reboot, etc. Duplicates come back after reboot but disappear after the first auto upload.

@nateyoung thanks for sharing this workaround.
So it proves that only the built-in notifications are affected…

@nateyoung Thanks for posting that workaround. I'll try it as well.

Checking in here with the same issue. OnePlus 7T running OxygenOS 10.0.9.HD65AA. Bootloader unlocked and rooted with Magisk. No further system modifications other than some Magisk modules that were installed after I first observed this issue.

I've had to keep auto uploads turned off, but I can confirm that this issue presented itself yesterday upon a MANUAL upload.

Side note, Nextcloud-connected apps are working fine without triggering this issue: DAVx5, Notes, and PhoneTrack

Please let me know how I can help.

OnePlus 7T, US unlocked, OxygenOS 10.0.9.HD65AA, bootloader unlocked, rooted with Magisk

I downloaded the Dev build 20200415 from F-Droid, and performed the following actions:

  • 2020-04-29T09:01:03.559-0400 Log in, with TOTP
  • 2020-04-29T09:03:20.829-0400 Upload an 8 KB .csv file
  • Check Android Sound & vibration settings: All ringtones OK
  • 2020-04-29T09:03:56.619-0400 Upload a 252 KB .jpg file
  • Check Android Sound & vibration settings: All ringtones MISSING
  • Save Nextcloud Dev debug log

logs-redacted.txt

This appears to only be related to uploading image files? Something to do with thumbnail generation perhaps?

Following from above:

  • 2020-04-29T09:28:18.802-0400 Upload the same 8 KB .csv file, now to root folder on Nextcloud
  • Check Sound & vibration settings: All ringtones OK
  • 2020-04-29T09:28:50.817-0400 Upload 70 B .xml file to same folder
  • Check Sound & vibration settings: All ringtones OK
  • 2020-04-29T09:29:51.422-0400 Upload 7.4 MB .apk file to same folder
  • All ringtones OK
  • 2020-04-29T09:30:23.278-0400 Upload 159 KB .jpg file to same folder
  • All ringtones MISSING

logs2-redacted.txt

Apologies for multiple comments in a row.

Hm, not that easy to implement as there is no real doc how to use this…

Anyway: https://github.com/nextcloud/android/pull/5969 simply removes media scanner on Android 10.
Soon there will be an APK which you can install.
Can you test it with this?

Downside might be that the media scanner is not triggered and thus the new image is not shown in gallery. But this is first to test if the ringtones remain…

@tobiasKaminsky I can install and test with that! Where can I find the new APK? Does it get attached to that pull request after it's done building?

And which gallery are you referring to? Android's systemwide gallery? I think that if a user uploads an image to Nextcloud, that image would already be in their gallery anyway, wouldn't it?

Does it get attached to that pull request after it's done building?

Yes.

Android's systemwide gallery?

Yes

I think that if a user uploads an image to Nextcloud, that image would already be in their gallery anyway, wouldn't it?

If you choose to upload & move file into NC, it might be that the file is in gallery, but the location is not updated and thus it would be still shown in DCIM/Camera.

If you choose to upload & move file into NC, it might be that the file is in gallery, but the location is not updated and thus it would be still shown in DCIM/Camera.

I see, that makes sense.

I'll stand by for the build to finish. Thanks for doing this!

Here is the apk to test:
https://github.com/nextcloud/android/pull/5969#issuecomment-621353022

I fear that you have to disable/remove the official version so that you can make sure that it is working.

@tobiasKaminsky Thanks for that change. At first attempt, #5969 seems to have fixed the issue! I'll play with it some more this evening and tomorrow and see if I can break it.

@elektrikfisch is the uploaded file then shown in correct location in gallery app?
(as we now do not trigger media scanner)

@tobiasKaminsky When I upload with the "Keep file in source folder" option, the Gallery doesn't change. When I upload with the options "Delete file from source folder" or "Move file to #SITENAME# folder", the image immediately disappears from the Gallery app.

I've always uploaded using the keep in source folder option, so I'm not sure exactly what the normal behavior is for the other options on the current stable release.

When I upload with the options "Delete file from source folder" or "Move file to #SITENAME# folder", the image immediately disappears from the Gallery app.

And is the image then appearing in the folderName of NC?
So if you upload it to /instantUpload/2020/04 there should be a folder "04" with the uploaded image in gallery

@tobiasKaminsky when I use the Delete or Move options, the photo disappears from the Gallery app. It does not re-appear in the Gallery app under a different location. Gallery has a list of "App Collections" which is populated by Download, Discord, and Telegram. Nextcloud is not present. Keep in mind, this is OnePlus' take on the Gallery. Not sure if it works any different from AOSP on the back end.

But this is interesting... I reinstalled the stable release to see how it behaves differently. The uploaded photo still does not display in the Gallery if I use the Move or Delete options. However, this issue also does not appear to be triggered when I use those options.

@tobiasKaminsky So I cleaned up to run another test scenario. Uninstalled QA and stable. Installed dev, logged in, and rebooted (to clear the missing ringtone state).

  • Take 3 new photos
  • Upload first photo with Delete option. Ringtones OK. Photo missing from Gallery and Camera apps.
  • Upload second photo with Move option. Ringtones OK. Photo missing from Gallery and Camera apps.
  • Upload third photo with Keep option. Ringtones MISSING. Photo remains in Gallery and Camera apps.

To maybe find a different view into the gallery, I opened up Solid Explorer and opened Photos, and found a folder titled #USER#@#HOST#? The second photo (uploaded with Move option) is within that folder. Actual path to file is /storage/emulated/0/Android/media/com.nextcloud.android.beta/nextcloud/#USER#@#HOST#/IMG_20200430_073549.jpg . I'm not sure if this is reading from the Android gallery, or if Solid Explorer finds photos independently. Is there anything else I should try?

Log attached: logs3-redacted.txt

Thanks for testing.
I finally also found an emulator where I can reproduce it.
Sadly, when I move a file while uploading it is not shown in gallery, so I have to find a way to replace the old media scanner for newer Android versions…

@tobiasKaminsky Hello,

Let me know if you need me to do any testing i have a OnePlus 7 Pro on Android 10 Im currently Running 3.12.0 RC1 and still having the issue for now i stoped auto uploads but i even did a manual upload and still the same issue

Confirming @axheli . Manual upload on OnePlus 7T OxygenOS latest build. Both manual and auto-upload to local server remove built-in ringtone sounds from system.

It looks like the CI/CD is holding up the fix in #5969. Anything I can do there?

@skeletor-spills What dose that mean CI/CD ?

@axheli, I should have mentioned the developer/maintainer on the CI/CD thing (Continuous Integration / Continuous Delivery).

Some of the automatic tests for gplay are failing according to the referenced issue.

@tobiasKaminsky , is this because it needs to rescan media?

BTW Thanks a ton for maintaining some of this huge project and working through this issue.

@skeletor-Thank you very much :)

@tobiasKaminsky Yes, at agree with @skeletor-spills thank you so much :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThaDaVos picture ThaDaVos  Â·  3Comments

markbryanduncan picture markbryanduncan  Â·  3Comments

ikke-t picture ikke-t  Â·  3Comments

JSoko picture JSoko  Â·  3Comments

Tie-fighter picture Tie-fighter  Â·  3Comments