Author Topic: Wifi android device synching  (Read 429022 times)

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10270
Thanks for the update
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
I have not tested it very well, but I released it in the joy of completion.
Version 2.7.0 was released as an open test for the Google Play Store.
This is the first version that successfully reflects Poweramp playback counts.
It does not take into account any restrictions that the original had put in place regarding rates or playlists.
I have appropriated the original except for the part where I get the values, so I think it works reasonably well.
But as I was writing, I remembered that I did not test it on a device that does not have Poweramp installed.
My stance is that this is still an open test and I would like to fix any problems.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Seems mostly ok but there are a few issues.

1. It doesn't save which player I am using. After I perform a sync and select the "sync more" button, all the options under "from player" are unchecked.
2. Playlists are saved on the device as "playlist.m3u8.m3u" even though I have the selected format in musicbee set to "m3u8". This worked ok in the original app so I think you may have accidentally coded it to append .m3u to the playlist filename.
3. It's been mentioned previously but it errors on album artwork. In device settings in musicbee you need to select "do not copy artwork" and embed artwork in the mp3 file. It throws a mime type error because it's a jpg instead of an audio file. The app has permission for photos and videos so it possibly just requires a check on the format of the file being sent from the musicbee server before trying to save it.
4. When first installing, it asked me to select the stats.xml file which I already had on my phone from playing with gonemad previously. This might cause a problem if the user doesn't have a stats.xml file to select. Or maybe it only popped up that message for me because the file was already there?

Play counts and ratings synced back ok for poweramp but it seems ratings only sync back if the song gets a play count as well. In the original app a play count was not required for ratings to sync back. This could just be poweramp being janky, it has issues that I mentioned in my previous posts. If play counts are even remotely important to you, I would use gonemad, not poweramp.

I only tested it with a few small playlists of half a dozen songs but it handled it ok.

I can't test this with gonemad sorry. My partner uses a paid version but I'm not willing to test it on her phone as her play counts are sacred and I'm just not going there. Only time I'm messing with that is when I have to transfer everything to a new phone!

Good effort so far.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10270
Installed 2.7.0 and the "non-recoverable error..." is gone.

I'm still seeing the pop-up asking for permission to modify a file.


At the completion of the sync, the message "completed with errors" appeared.


Here's a portion of the error log from the app. I'm not sure what the "has no access to content" means, but the files exist.
Code
2024-07-31: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000006359: file=Music/Various Artists/Atlantic R&B/1-24 - Sweet Sixteen.mp3
09:22:40: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000007970: file=Music/The Supremes/Where Did Our Love Go/1 - Where Did Our Love Go.mp3
09:23:00: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018110: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/33 - Duke of Earl.mp3
09:23:11: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018131: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/20 - The Angels Listened In.mp3
09:23:12: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018121: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/35 - A Thousand Miles Away.mp3
09:23:14: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018112: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/23 - I'm so Happy.mp3
09:23:15: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018144: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/21 - Dream On.mp3
09:23:16: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018115: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/25 - What's Your Name.mp3
09:23:17: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018128: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/6 - Over the Mountain, Across the Sea.mp3
09:23:18: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018136: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/44 - My True Story.mp3
09:23:19: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018113: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/3 - A Casual Look.mp3
09:23:20: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018143: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/32 - Zoom, Zoom, Zoom.mp3
09:23:21: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018123: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/34 - P.S. I Love You.mp3

I notice that some of the playlists which should have been synced did not sync. So I tried again and while it did copy some additional songs over to the tablet, it did not copy all of the missing ones. Nor did it copy the playlist files that didn't sync the first time. Nine of twenty-seven playlists did not sync. Before syncing a third time, I did a 'preview' and confirmed that all twenty-seven playlists are showing. Ran the sync and I'm still missing those nine playlists. Note that the second and third syncs did -not- throw any errors.

Later today I will delete all music and playlist files from the tablet and try again.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10270
I have deleted all playlist files and music files from the tablet and started the sync. I assume since no files were being deleted, there was no pop-up asking for permission to modify. At the end of the sync it showed that was successfully completed. But not a single one of the twenty-seven playlist files copied to the tablet. I checked the device settings and MB and twenty-seven playlists were ticked to sync. I did a preview on the tablet and it showed twenty-seven playlists. I started a sync and not a single playlist came over to the tablet.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
1. It doesn't save which player I am using. After I perform a sync and select the "sync more" button, all the options under "from player" are unchecked.
2. Playlists are saved on the device as "playlist.m3u8.m3u" even though I have the selected format in musicbee set to "m3u8". This worked ok in the original app so I think you may have accidentally coded it to append .m3u to the playlist filename.
3. It's been mentioned previously but it errors on album artwork. In device settings in musicbee you need to select "do not copy artwork" and embed artwork in the mp3 file. It throws a mime type error because it's a jpg instead of an audio file. The app has permission for photos and videos so it possibly just requires a check on the format of the file being sent from the musicbee server before trying to save it.
4. When first installing, it asked me to select the stats.xml file which I already had on my phone from playing with gonemad previously. This might cause a problem if the user doesn't have a stats.xml file to select. Or maybe it only popped up that message for me because the file was already there?

Thanks for your tests.

The Playlist extension thing in #2 is not coded that way, but is copied that way when MediaStore.Audio.Playlists is used.
I don't think it's appropriate either, but I can't find a way to copy the playlist files under the Music folder using MediaStore, so I have no choice.
Furthermore, MediaStore.Audio.Playlists is a "deprecated in API level 31." class, so there is no hope for improvement in the future.

For stats.xml (#4), we have added an action of choice to obtain access rights.
The existence of the file is checked first, so this selection window should not open in an environment without GoneMAD.

I will take the test results and make corrections.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I hadn't tried deleting anything so I ran some more tests. If I remove a playlist, it deletes all the songs in that playlist but it doesn't delete the playlist itself. In the show preview window it doesn't specify that it will delete the playlist.

@phred
Definitely a permissions issue. I assume you got the permissions popup when first installing and enabled it, so it might be something weird with that device. It's not allowing access to media even though the app is granted permission.

Does the music sync across or is it just the playlists that are missing?

If nothing syncs across that will be due to lack of permissions. If songs sync and the playlists don't, it could be where your playlist folder is set. I have mine set to Music/playlists

kimt1688

  • Jr. Member
  • **
  • Posts: 109


Here's a portion of the error log from the app. I'm not sure what the "has no access to content" means, but the files exist.
Code
2024-07-31: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000006359: file=Music/Various Artists/Atlantic R&B/1-24 - Sweet Sixteen.mp3
09:22:40: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000007970: file=Music/The Supremes/Where Did Our Love Go/1 - Where Did Our Love Go.mp3
09:23:00: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018110: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/33 - Duke of Earl.mp3
09:23:11: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018131: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/20 - The Angels Listened In.mp3
09:23:12: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018121: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/35 - A Thousand Miles Away.mp3
09:23:14: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018112: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/23 - I'm so Happy.mp3
09:23:15: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018144: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/21 - Dream On.mp3
09:23:16: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018115: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/25 - What's Your Name.mp3
09:23:17: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018128: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/6 - Over the Mountain, Across the Sea.mp3
09:23:18: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018136: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/44 - My True Story.mp3
09:23:19: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018113: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/3 - A Casual Look.mp3
09:23:20: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018143: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/32 - Zoom, Zoom, Zoom.mp3
09:23:21: receiveFile: android.app.RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content://media/d997-3128/audio/media/1000018123: file=Music/Various Artists/Doo Wop Dynamite - A Vocal Spectacular/34 - P.S. I Love You.mp3


"RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content" This error occurs when you go to overwrite or update a file on the device and you do not have access rights.
In my personal testing, I have seen this when trying to update a Wired Sync file on Android 12. Of course it is supported now, but there are conditions to use that support.
I have to delete the app's cache data so that the process only runs when I run it from the initial state.
Since it has to target all files, it cannot be executed frequently, and I have implemented it that way.
The process is executed when the application is started from the initial state and the "Locate Server" button is pressed.
Once you start using the app, this "ritual" is required every time you do a wired sync.
I wish there was a better place to implement this.
However, this is Android 12 so far, and I have not seen this exception in Android 14.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I have to delete the app's cache data so that the process only runs when I run it from the initial state.

There is a good chance this will cause play counts to be duplicated unless you also clear the database in the music player of choice.

Furthermore, MediaStore.Audio.Playlists is a "deprecated in API level 31." class, so there is no hope for improvement in the future.

Google don't like to make things easy do they. I can't see the logic in removing that functionality.

Just a heads up for anyone changing to this version of the app when you have existing playlists on your device, because of the m3u issue it will double up your playlists. Your playlists folder will contain
playlist 1.m3u8
playlist 1.m3u8.m3u
playlist 2.m3u8
playlist 2.m3u8.m3u

You will need to manually delete the playlists ending in m3u8. Also I guess it won't matter what playlist format you set in musicbee as it will always be saved as .m3u

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10270
@phred
Definitely a permissions issue. I assume you got the permissions popup when first installing and enabled it, so it might be something weird with that device. It's not allowing access to media even though the app is granted permission.

Does the music sync across or is it just the playlists that are missing?

If nothing syncs across that will be due to lack of permissions. If songs sync and the playlists don't, it could be where your playlist folder is set. I have mine set to Music/playlists
I have checked the app's permissions on the tablet and "music and audio" and "photos and videos" are allowed. There are "no permissions denied." So something else is going on here.

Yes, the music files sync across. It's just the playlists that to not appear.

My music and my playlists are on the SD card. Music files are at SM-T220\Card and the playlists are at Playlists.

"RecoverableSecurityException: kim.tkland.musicbeewifisync has no access to content" This error occurs when you go to overwrite or update a file on the device and you do not have access rights.
In my personal testing, I have seen this when trying to update a Wired Sync file on Android 12. Of course it is supported now, but there are conditions to use that support.
The app has permission to access the files. This happened on a WiFi sync. On Android 14.
Last Edit: August 01, 2024, 12:55:41 PM by phred
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Yes, the music files sync across. Iit just the playlists that to not appear.
My music and my playlists are on the SD card. Music files are at SM-T220\Card and the playlists are at Playlists.

Do you mean SD card/music and SD Card/playlists?

Maybe try putting the playlist folder inside the music folder and change the device settings in musicbee to reflect this and see if that works.

It is strange it can write the music but not delete it.

kimt1688

  • Jr. Member
  • **
  • Posts: 109
The app has permission to access the files. This happened on a WiFi sync. On Android 14.

This is what I wanted to hear.
The response I'm putting in now only works on Android 12 because I didn't get any reports up in the closed test environment, and I thought it was a symptom specific to Android 12.
I will make a version 2.7.1 that makes it run regardless of version and upload it ASAP.

This is a permissions issue, but there is a "Scoped Storage" permissions issue that only occurs under certain circumstances, such as when a file is written in Wired Sync and the MusicBee Wifi Sync app tries to update it. It seems that there is an environment in which the act of updating a file written in Wired Sync with the MusicBee Wifi Sync app is judged as a permission violation.
Therefore, I have put in code to scan all files under the Music folder and make them accessible so that they can be used in certain situations.
Please wait as we will change the process so that it is also done when Android 14 starts (after clearing data and cache).

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10270
I have uninstalled the app and reinstalled it. Same thing - no playlists are copied to the device.

I'll wait until the next version and see what it does. If the playlists still do not copy over, then I'll move the playlists folder to be under the music folder and test again.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

BoringName

  • Sr. Member
  • ****
  • Posts: 916
The app has permission to access the files. This happened on a WiFi sync. On Android 14.

This is what I wanted to hear.
The response I'm putting in now only works on Android 12 because I didn't get any reports up in the closed test environment, and I thought it was a symptom specific to Android 12.
I will make a version 2.7.1 that makes it run regardless of version and upload it ASAP.

This is a permissions issue, but there is a "Scoped Storage" permissions issue that only occurs under certain circumstances, such as when a file is written in Wired Sync and the MusicBee Wifi Sync app tries to update it. It seems that there is an environment in which the act of updating a file written in Wired Sync with the MusicBee Wifi Sync app is judged as a permission violation.
Therefore, I have put in code to scan all files under the Music folder and make them accessible so that they can be used in certain situations.
Please wait as we will change the process so that it is also done when Android 14 starts (after clearing data and cache).

I'm testing on Android 14 and having no issues other than what I previously specified.

As a test I just synced some songs via a wired sync. Unplugged the phone, unticked the playlist in musicbee and synced via the app. It deleted all the songs from that playlist off the device without any problems.

It might be related to the music being stored on an SD card.

Easy enough test would be for Phred to change to the music folder on internal storage and just sync a small playlist of songs to it then untick it and see if it deletes ok. That would at least highlight if it's something to do with SD card storage.

edit: and I'd be careful coding anything to scan the whole music folder. That might be fine for small libraries but some people have over 200gb of music on their device. The old isyncr app used to work that way and it killed the battery and just bogged down the phone for ages.
Last Edit: August 01, 2024, 04:58:51 AM by BoringName

kimt1688

  • Jr. Member
  • **
  • Posts: 109
Version 2.7.1 is now in the store. Install this on the device with the error and run it initially.
The start and end of the process will be indicated by Toast.
It is a full scan, which I know is not a light process. And it is an all storage scan because it runs before storage selection.
The test was done on my Android 12 device with a music library of over 10,000 FLAC and ALAC files on the SD card, over 300GB.
It didn't take long to finish, but it is a heavy process, so I made it so that it only runs once when the app starts up from the initial state.