[Marshmallow] Write to USB
#1
I just updated my Sony to Android TV Marshmallow. Now it is not possible anymore to use an USB pen drive as timeshift buffer for the DVBViewer PVR Add-on anymore. I also tried to set it up as adoptable storage but fail to find the path via Kodi file browser.

How can Kodi write to a USB pen drive using Android Marshmallow?
Reply
#2
Only in app's own folder; for Kodi it is Android/data/org.xbmc.kodi/files/.kodi/ so try creating these folders on your USB drive
Reply
#3
as you know, MM broke some things. But.......
Adoptable storage path is just like before actualy, select Home or SD card 0 on ES file explorer, then Android/data/org.xbmc.kodi/files/.kodi/
The problem is that adoptable storage tend to go missing from time to time so if you transfered things after formating as internal storage things get broken prety easily. I lost my "sd card" a couple of times already since MM (a little bit more than 24h).

Another thing.... We can't write to non internal drives, you also figured that out. But at the same time, each time you plug a disk, the system will create Android folder (with data and obb) in root directory. And one of the apps there is also Kodi. And this gets created every time if you delete that folder on your PC so try to point to that location instead of SD card (adopted/internal storage). And also makes me wonder why do we even need adoptabe/internal storage if data and obbs can be placed on regular external disk HuhHuhHuh
Reply
#4
Quote:Another thing.... We can't write to non internal drives, you also figured that out. But at the same time, each time you plug a disk, the system will create Android folder (with data and obb) in root directory. And one of the apps there is also Kodi. And this gets created every time if you delete that folder on your PC so try to point to that location instead of SD card (adopted/internal storage). And also makes me wonder why do we even need adoptabe/internal storage if data and obbs can be placed on regular external disk HuhHuhHuh
Thanks Kinggo. You just saved my evening. That indeed works.
Reply
#5
Only problem will be that storage ID will change with every re-plug and reboot I assume. Path is:
Code:
/storage/{some-id}/Android/data/org.xbmc.kodi/
Reply
#6
No, it won't. I just tried and I got the same ID after reboot and after replugging. Even that USBxxxx number is the same. I didn't try different port but this will do anyway.
Reply
#7
(2017-02-24, 21:27)kinggo Wrote: Another thing.... We can't write to non internal drives, you also figured that out. But at the same time, each time you plug a disk, the system will create Android folder (with data and obb) in root directory. And one of the apps there is also Kodi. And this gets created every time if you delete that folder on your PC so try to point to that location instead of SD card (adopted/internal storage). And also makes me wonder why do we even need adoptabe/internal storage if data and obbs can be placed on regular external disk HuhHuhHuh

First, data and obb are not on external (non-adopted) storage.

This is how storage, from Android 6.0 and above works. If you adopt storage and migrate your data, then all data is stored on the adopted storage and it is treated just like internal. That means that the path /Android/data will be the same even though it is not on the internal storage.

With non-adopted storage you can only write to the apps folder created on the storage. This is done after you plug in the drive and only after the app is launched, only then will it create the apps folder in /Android/data on that drive. This is only meant for write access to that drive by the app, it does not store any app data other than what you set for that app to write to that location. So for Kodi, you have full access to your_drive /Android/data/org.xbmc.kodi/, but only to this folder on non-adopted external storage.

You can also write to non-adopted external storage if the app ask for permission first, which is not something that Kodi does, but most file explorers do. If an app asks for permission then you can write to any folder or even the root of the drive.

And I don't know how many more times it needs to be stated, but DO NOT USE ES FILE EXPLORER. Not only is it just bloatware, it's know to cause issues with external drives. If you need a file explorer use X-Plore.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply
#8
Thanks for this TW - nice explanation - suggestion - link that post above into one of your Page #1 Shield threads. Smile

Reply
#9
Quote:With non-adopted storage you can only write to the apps folder created on the storage. This is done after you plug in the drive and only after the app is launched, only then will it create the apps folder in /Android/data on that drive. This is only meant for write access to that drive by the app, it does not store any app data other than what you set for that app to write to that location. So for Kodi, you have full access to your_drive /Android/data/org.xbmc.kodi/, but only to this folder on non-adopted external storage.
That's perfectly enough for the timeshift buffer written by the DVBViewer PVR add-on Smile .

I also realized that the storage ID is stable upon reboot.

Quote:And I don't know how many more times it needs to be stated, but DO NOT USE ES FILE EXPLORER. Not only is it just bloatware, it's know to cause issues with external drives. If you need a file explorer use X-Plore.
So far, I couldn't get X-Plore to write to non-adoptable storage. I probably have to reinstall the app under Marshmallow? There is a configuration setting called:

Allow USB access
Allow X-plore to access USB devices directly to work with USB OTG.


Afterwards I could not access the USB pen drive anymore though.
Reply
#10
Yes, that's a bug in Marshmallow, for full write access you'll probably need to use Total Commander. You may not be able to install it directly for the Play Store app, but you should be able to push it to your TV by going to the Play Store from a browser.

It was the only file explorer that could properly access external drives on the Shield with Marshmallow and not unmount drives.

Thankfully it's fixed in Nougat but there's no telling when or if Sony will push that update out.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply
#11
(2017-02-25, 05:50)Tinwarble Wrote: With non-adopted storage you can only write to the apps folder created on the storage. This is done after you plug in the drive and only after the app is launched, only then will it create the apps folder in /Android/data on that drive. This is only meant for write access to that drive by the app, it does not store any app data other than what you set for that app to write to that location. So for Kodi, you have full access to your_drive /Android/data/org.xbmc.kodi/, but only to this folder on non-adopted external storage.
I know. But that was exactly what he needed.

(2017-02-25, 05:50)Tinwarble Wrote: You can also write to non-adopted external storage if the app ask for permission first, which is not something that Kodi does, but most file explorers do. If an app asks for permission then you can write to any folder or even the root of the drive.
Unfortunately, after MM on SONY TV you can't Sad
(2017-02-25, 05:50)Tinwarble Wrote: And I don't know how many more times it needs to be stated, but DO NOT USE ES FILE EXPLORER. Not only is it just bloatware, it's know to cause issues with external drives. If you need a file explorer use X-Plore.
I use ES PRO, zero bloatware there and never had any issues whit it and I use it on tablet also and worked great on TV with lollipop.
(2017-02-25, 05:50)Tinwarble Wrote: Yes, that's a bug in Marshmallow, for full write access you'll probably need to use Total Commander. You may not be able to install it directly for the Play Store app, but you should be able to push it to your TV by going to the Play Store from a browser.

It was the only file explorer that could properly access external drives on the Shield with Marshmallow and not unmount drives.
Not even total commander. I tried 764378 file managers and something is claerly broken because non of them can write to non internal disk. You are never presented with that chooser where you need to select root of SD card. And this is the only meaningfull error I got
"no activity found to handle intent {act=android.intent.action.open_document_tree (has extras)}"
Reply
#12
I would add that currently the only method I found to copy a file from the internal storage to an external storage is to use the Kodi file manager and copy the file in the created /Android/data/org.xbmc.kodi directory.

The ES file manager does not create their own external data dir and do not allow the copy.

Another point in favour to Kodi.
Reply
#13
(2017-02-24, 21:27)kinggo Wrote: as you know, MM broke some things. But.......
Adoptable storage path is just like before actualy, select Home or SD card 0 on ES file explorer, then Android/data/org.xbmc.kodi/files/.kodi/
The problem is that adoptable storage tend to go missing from time to time so if you transfered things after formating as internal storage things get broken prety easily. I lost my "sd card" a couple of times already since MM (a little bit more than 24h).

Another thing.... We can't write to non internal drives, you also figured that out. But at the same time, each time you plug a disk, the system will create Android folder (with data and obb) in root directory. And one of the apps there is also Kodi. And this gets created every time if you delete that folder on your PC so try to point to that location instead of SD card (adopted/internal storage). And also makes me wonder why do we even need adoptabe/internal storage if data and obbs can be placed on regular external disk HuhHuhHuh
Android MM does grant write permission to "file managers."  I use Astro, but ES and File Manager all are able to write and delete files on external storage. Since Kodi has file management features, it should be possible to modify Android or Kodi so they are installed as "File Managers" like Astro.  If that is possible, we should be able to rename and delete media files on a USB media source.

I'm not technical enough to even root an android media player, so this will require someone with more expertise than I have to do it.  But I cannot see why this is not a viable solution.

Anyone have any suggestions on how to do this?
Reply
#14
(2017-12-22, 22:20)ezriderz Wrote: Android MM does grant write permission to "file managers."  I use Astro, but ES and File Manager all are able to write and delete files on external storage. Since Kodi has file management features, it should be possible to modify Android or Kodi so they are installed as "File Managers" like Astro.  If that is possible, we should be able to rename and delete media files on a USB media source.

I'm not technical enough to even root an android media player, so this will require someone with more expertise than I have to do it.  But I cannot see why this is not a viable solution.

Anyone have any suggestions on how to do this? 

MM does grant access to file managers, you can use Xplore and it will give you full access to external drives.  But it does it in a way that is not easily enabled.

Kodi does not implement the access permission, especially on MM since it does not have Scoped Directory Access and would require you to go out of Kodi to get permission. But there is currently no plans on enabling write access to external drives in Kodi.
Forum Rules (wiki) | Banned add-ons (wiki) | Wiki (wiki) | Quick start guide (wiki)
Reply
#15
(2017-12-22, 22:20)ezriderz Wrote: Android MM does grant write permission to "file managers."  I use Astro, but ES and File Manager all are able to write and delete files on external storage. Since Kodi has file management features, it should be possible to modify Android or Kodi so they are installed as "File Managers" like Astro.  If that is possible, we should be able to rename and delete media files on a USB media source.

I'm not technical enough to even root an android media player, so this will require someone with more expertise than I have to do it.  But I cannot see why this is not a viable solution.

Anyone have any suggestions on how to do this? 
Again. You are never presented with that chooser where you need to select root of SD card.
So, you'll see this as a hint in X-plorer
Image
But the system in SONY TV will never show you that dialog to choose root and grant permission.
And this is the only meaningfull error I got
"no activity found to handle intent {act=android.intent.action.open_document_tree (has extras)}"
It's not the problem of file managers.
Reply

Logout Mark Read Team Forum Stats Members Help
[Marshmallow] Write to USB0
This forum uses Lukasz Tkacz MyBB addons.