Kodi Community Forum

Full Version: Synology to Android
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I downloaded XBMC for the first time, and got it working on my Windows 7 PC with no problems. When I was able to play a .iso file with no conversion, I thought it was the coolest thing ever.

Following instructions I found on the web, I set up my Synology NAS to host all my music and video files. This consisted of some setup on the Synology, and then the creation of two files on my PC, in the userdata folder:

1. advancedsettings.xml which contains:

Code:
<advancedsettings>
    <loglevel>0</loglevel>
    <videodatabase>
        <type>mysql</type>
        <host>192.168.0.197</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xxxxxxxx</pass>
        <name>xbmc_video</name>
    </videodatabase>
    <musicdatabase>
        <type>mysql</type>
        <host>192.168.0.197</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xxxxxxxx</pass>
        <name>xbmc_music</name>
    </musicdatabase>
    <pathsubstitution>
        <substitute>
            <from>special://masterprofile/Thumbnails/</from>
            <to>smb://192.168.0.197/media/Thumbnails/</to>
        </substitute>
    </pathsubstitution>
</advancedsettings>

2. sources.xml which contains:

Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Video-Movies</name>
            <path pathversion="1">smb://192.168.0.197/video/Movies/</path>
        </source>
        <source>
            <name>Video-Series</name>
            <path pathversion="1">smb://192.168.0.197/video/Series/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">smb://192.168.0.197/music/</path>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
        <source>
            <name>Photos</name>
            <path pathversion="1">smb://192.168.0.197/photo/</path>
        </source>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

All this was working just fine on my PC. But the main point of all this was to be able to watch videos on my TV. So I bought a Minix Neo x5 and hooked it up. I installed XBMC, put a music file into the local file system, added a link to that folder, and was able to play it with no problems. I found the userdata folder, and copied the advancedsettings.xml and sources.xml files into it. I ran XBMC and went to the video section. It showed me a list of the two subdirectories I have (Video-Movies and Video-Series). But when I clicked on Video-Movies, an error popped up that said "Operation not permitted". I clicked on OK, and another message popped up that said "Could not connect to network sever".

I opened a file explorer application that I have, and navigated to the same folder using SMB. When it prompted me for a username and password, I entered the sames ones that are in the advancedsettings.xml file, and it worked as expected. I was able to see the files, so that is not the problem.

Then I started reading through this forum. The first reply to every post is, "get the log file". On my Windows PC, this is as easy as could be. You just navigate to the right folder, and there it is. On Android, this turned into a complete nightmare. Apparently, the location of the log file can be any one of 3 different locations:

/Android/data/org.xbmc.xbmc/cache/temp/xbmc.log
/sdcard/Android/data/org.xbmc.xbmc/cache/temp/xbmc.log
/data/data/org.xbmc.xbmc/cache/temp/xbmc.log

Since my userfolder was at /Android/data/org.xbmc.xbmc/files/.xbmc/userdata/, I figured my log file would be at /Android/data/org.xbmc.xbmc/cache/temp/xbmc.log, but it's not. There is no "cache" folder inside /Android/data/org.xbmc.xbmc/. I tried to find the other folders, but couldn't find them either. (Yes, I have "show hidden folders" enabled.)

I changed the log level in the advancedsettings.xml file to 1, but it made no difference.

Then I saw a post about using an adb command to get the log file, because the folder it's in is a specially hidden folder. I don't know what that means (obviously, I am not an Android expert), I don't even know how/where I would enter an adb command. (I also don't understand why you would put a log file into a place that is so hard to get to.)

Then I read about XBMC Log Uploader. Seemed like a lot of trouble just to be able to look at a log file, but OK. I got it downloaded, installed it, and configured it with my email address and enabled it. When I went to Programs and ran it, a message came up that just said "Script error: addon.py".

So, I'm pretty much out of ideas. I don't know why there is a problem accessing my media files, and no matter what I do, I can't seem to get a hold of the log file that would help figure it out.

Can anybody offer a suggestion as to how I can proceed?

Thanks

Tom
The XBMC log file is under /data/data/org.xbmc.xbmc I believe. Its stored in the app data area of android and not on the sd card.

Reading through the rest of your post it sounds like you have a password setup for samba but in your sources.xml it is not setup to have a user/password combo. I you can specify it in sources.xml by updating the smb URL to smb://user:password@ip/path/to/files (the path is from memory, may need some tweaking) to get XBMC to auto-authenticate to samba.
With my Synology 1511+ I set user permissions for my media folders (using DSM) to "everyone" and avoid this problem.

If you have a folder, or set of folders, you want to password protect to keep kids from accessing it or something there's an option for that inside XBMC, see "locking" in the Wiki: http://wiki.xbmc.org/index.php?title=Media_sources

On another note, keep in mind Android XBMC is still very much in it's infancy and you should expect issues to crop up that you wouldn't see in other versions.

Also, are you sure the Minix Neo reliably supports hardware video decoding? I've read that it it's not quite there yet. You'll be limited to SD and perhaps some 720p (if the dual core A9 can handle it in software) until it does. I also strongly recommend a wired setup as the wireless in all these little devices tends to be weak, though of course your mileage may vary.

Basically, XBMC for Android is in the "tinker" stage now - if you are just looking for a cheap, quiet, low-power little box you can stick under the TV that just works and can be used by the whole family (and who isn't) then you are in for a wait. If you don't mind reporting bugs, posting logs, and generally treating the thing like a fun experiment then you are in the right place.

If it's the former, then you can still get little Atom-powered NVidia ION boxes for under $200 from the likes of Zotac - they are a little bigger (though still quite small), and some of them are louder (though not that loud) but they work perfectly with XBMCBuntu or the Windows build and play everything, even BD rips. I have three - I'm fooling around with an Android build/box now but I expect it'll be 6 months or more before it'll be ready to replace my Atom PC's.
Thanks to both of you for responding, I've made some progress....
(2012-12-30, 18:22)kemonine96 Wrote: [ -> ]The XBMC log file is under /data/data/org.xbmc.xbmc I believe. Its stored in the app data area of android and not on the sd card.
Using my file explorer, I can go to the root folder, and I see a folder called "data". But when I click on it, it tells me that I need to have root permissions to be able to go there. Is that normal? Is there some other way I can navigate to the folder where the log file is? Or, is there some easy way to copy the file to a folder I can access? Or better yet, is it possible to tell XBMC to put the log file in a different location?
(2012-12-30, 18:22)kemonine96 Wrote: [ -> ]Reading through the rest of your post it sounds like you have a password setup for samba but in your sources.xml it is not setup to have a user/password combo. I you can specify it in sources.xml by updating the smb URL to smb://user:password@ip/path/to/files (the path is from memory, may need some tweaking) to get XBMC to auto-authenticate to samba.
The main good news is that you were right on the money about this! I did that, and now I can access the lists of music and video files. The example I saw didn't do that, so I didn't think it was required. Anyway, I can now navigate to a music file, click on it, and it plays, which is excellent. However, when I try to do the same with a .iso video file, I get a popup that there was an error, and I should see the log file for more details. Which I would love to be able to do :-) I know the .iso file itself is valid because I was able to play it using XBMC on my PC.
(2012-12-30, 20:04)ixian Wrote: [ -> ]With my Synology 1511+ I set user permissions for my media folders (using DSM) to "everyone" and avoid this problem.
Actually, that is what I wanted to do. I went to File Station, and selected "Create New Shared Folder" from the Create menu. If I now look at the "Privileges setup" tab, and select "Local users", I see "admin", "tom", and "guest". Should I see one named "everyone" here? If instead of "Local users" I select "Local groups", I see "administrators" and "users". Even when I had all the users and all the groups set to Read/Write, I was still not able to access the files without specifying a username and password. Is there something else I can do to give "everyone" access?

In case it matters, my Synology NAS is model DS110j, and I have DSM version 4.1.
(2012-12-30, 20:04)ixian Wrote: [ -> ]On another note, keep in mind Android XBMC is still very much in it's infancy and you should expect issues to crop up that you wouldn't see in other versions.

Also, are you sure the Minix Neo reliably supports hardware video decoding? I've read that it it's not quite there yet. You'll be limited to SD and perhaps some 720p (if the dual core A9 can handle it in software) until it does. I also strongly recommend a wired setup as the wireless in all these little devices tends to be weak, though of course your mileage may vary.

Basically, XBMC for Android is in the "tinker" stage now - if you are just looking for a cheap, quiet, low-power little box you can stick under the TV that just works and can be used by the whole family (and who isn't) then you are in for a wait. If you don't mind reporting bugs, posting logs, and generally treating the thing like a fun experiment then you are in the right place.

If it's the former, then you can still get little Atom-powered NVidia ION boxes for under $200 from the likes of Zotac - they are a little bigger (though still quite small), and some of them are louder (though not that loud) but they work perfectly with XBMCBuntu or the Windows build and play everything, even BD rips. I have three - I'm fooling around with an Android build/box now but I expect it'll be 6 months or more before it'll be ready to replace my Atom PC's.
The specs for the x5 say, "Flash supports hardware decoding technology with the FTR". Does that tell us what we need to know?

My x5 is connected through an ethernet cable, I am not relying on a wireless connection.

I don't mind reporting bugs or posting logs, if I could just get at them! :-) But I definitely want to make this work on an Android device. I like the x5, but I seem to be having a lot of issues with it. It hangs and reboots a lot, and not just when using XBMC. So I think I am going to RMA it. I was going to get another x5, and hope for a better unit. Is there a better candidate device I should try to get for being able to run XBMC?

Thanks again, and happy new year!

Tom
(2013-01-01, 23:55)TomWardAtl Wrote: [ -> ]Using my file explorer, I can go to the root folder, and I see a folder called "data". But when I click on it, it tells me that I need to have root permissions to be able to go there. Is that normal? Is there some other way I can navigate to the folder where the log file is? Or, is there some easy way to copy the file to a folder I can access? Or better yet, is it possible to tell XBMC to put the log file in a different location?

You may be able to use logcat (from the android sdk) to pull the /data/data/org.xbmc.xbmc folder, but it is unlikely given you cannot navigate to this folder using your file explorer. If your device is rooted you can use adb shell and su (to get root) to pull the directory.

If you have root you can also use a file explorer such as ES File Explorer and enable the "Root access" mode. This should let you get to the file you are looking for.

There may be a way to store the log in another location, but I am not sure how to do this. Perhaps someone else can weigh in on it?
(2012-12-30, 20:04)ixian Wrote: [ -> ]With my Synology 1511+ I set user permissions for my media folders (using DSM) to "everyone" and avoid this problem.
One mystery solved: Although I had given the "guest" account read-only access to all the folders, it turns out the guest account itself was disabled (I think by default). So I enabled the account, removed all the username/passwords from the sources.xml file, and it's able to access the files.

So I can play music, which is great, but videos don't work at all, and I can't figure out how to get to the log file.
(2013-01-02, 00:02)kemonine96 Wrote: [ -> ]You may be able to use logcat (from the android sdk) to pull the /data/data/org.xbmc.xbmc folder, but it is unlikely given you cannot navigate to this folder using your file explorer. If your device is rooted you can use adb shell and su (to get root) to pull the directory.

If you have root you can also use a file explorer such as ES File Explorer and enable the "Root access" mode. This should let you get to the file you are looking for.

There may be a way to store the log in another location, but I am not sure how to do this. Perhaps someone else can weigh in on it?
I don't have root.

I'm trying to understand... Wouldn't it make more sense to write the log file to a location that's readily accessible to any user, something like /Android/data/org.xbmc.xbmc/files/.xbmc/logs/?

Tom
I'm probably out of my league here but a bit familiar with Synology.

Is there some reason your using custom XML files instead of just adding the files normally through XBMC's windows network browser ?

Normally for paths on Synology NAS it has be something like smb://192.168.0.197/volume1/video/
(2013-01-02, 00:02)kemonine96 Wrote: [ -> ]
(2013-01-01, 23:55)TomWardAtl Wrote: [ -> ]Using my file explorer, I can go to the root folder, and I see a folder called "data". But when I click on it, it tells me that I need to have root permissions to be able to go there. Is that normal? Is there some other way I can navigate to the folder where the log file is? Or, is there some easy way to copy the file to a folder I can access? Or better yet, is it possible to tell XBMC to put the log file in a different location?

You may be able to use logcat (from the android sdk) to pull the /data/data/org.xbmc.xbmc folder, but it is unlikely given you cannot navigate to this folder using your file explorer. If your device is rooted you can use adb shell and su (to get root) to pull the directory.

If you have root you can also use a file explorer such as ES File Explorer and enable the "Root access" mode. This should let you get to the file you are looking for.

There may be a way to store the log in another location, but I am not sure how to do this. Perhaps someone else can weigh in on it?

I've spotted this before. The problem is that the /data directory has execute access for "other", but not read access. So it's possible to pull objects out of it, provided you know the object name, but it's not possible to read the directory, and find out the object names (/data/data has the same permissions). It's certainly possible to use adb to pull files out, provided you use the full pathname. Similarly, if you get a local command prompt (I'm using ConnectBot), then you can use cd to go directly to /data/data/org.xbmc.xbmc and then have a look around, but you can't get directory listings for the two data directories.

It's this inability to get directory listings that's breaking the file explorer.
(2013-01-02, 19:02)Starstream Wrote: [ -> ]I'm probably out of my league here but a bit familiar with Synology.

Is there some reason your using custom XML files instead of just adding the files normally through XBMC's windows network browser ?

Normally for paths on Synology NAS it has be something like smb://192.168.0.197/volume1/video/
I might be out of my league as well :-)

I was just following the instructions I found online for creating a centralized location for all of your XBMC media. It said if you do it this way, you can share everything (content, thumbnails, etc.) across all the devices on which you run XBMC. It stressed that on all the devices, the sources.xml file must be exactly the same. The site provided some sample files, so I just downloaded them and then modified them on my desktop. When I was sure it was working, I copied them to my X5 box, rather than trying to add the libraries through the UI.

Tom
(2013-01-02, 19:19)wimble Wrote: [ -> ]I've spotted this before. The problem is that the /data directory has execute access for "other", but not read access. So it's possible to pull objects out of it, provided you know the object name, but it's not possible to read the directory, and find out the object names (/data/data has the same permissions). It's certainly possible to use adb to pull files out, provided you use the full pathname. Similarly, if you get a local command prompt (I'm using ConnectBot), then you can use cd to go directly to /data/data/org.xbmc.xbmc and then have a look around, but you can't get directory listings for the two data directories.

It's this inability to get directory listings that's breaking the file explorer.
I will download ConnectBot. Will I be able to use it without root? Once I open ConnectBot, can you please tell me the exact command(s) I'll have to use to copy my log file to somewhere that I can get at it?

Hmmm, now that I think about it.... Is there an Android equivalent to a Windows .bat file? If so, I could make one called GetXBMCLog that contains just the required commands. Then I could just run it whenever I want to see the latest log. If that's doable, it might be helpful to others as well.

Thanks.

Tom
I installed ConnectBot, ran it, and after some trial and error got this command to work:

cat /data/data/org.xbmc.xbmc/cache/temp/xbmc.log > xbmc.log

So at least now I have a log file! Then I did a little reading, probably just enough to be dangerous :-) I created a text file called GetXBMCLog which contains:

Code:
#!/bin/bash
cat /data/data/org.xbmc.xbmc/cache/temp/xbmc.log > xbmc.log

Based on what I read, in order to be able to execute this file, I tried the following:

chmod 755 GetXBMCLog

But when I do that, I get an "operation not permitted" error. Is this (again) because I don't have root? If so, why do I need root to set permissions on a file I just created?

I installed ES File Explorer and tried there (and in my other file explorer) to find a way to set permissions on a file, but no luck there.

If I type:

ls -l

it shows:

-rwxrwxr-x GetXBMCLog

Shouldn't that mean that it can be executed by anyone? But if I try ./GetXBMCLog it says:

/system/bin/sh: ./GetXBMCLog: cannot execute - Permission denied

I sure am confused :-)

Tom
(2013-01-03, 07:02)TomWardAtl Wrote: [ -> ]-rwxrwxr-x GetXBMCLog

Shouldn't that mean that it can be executed by anyone? But if I try ./GetXBMCLog it says:

/system/bin/sh: ./GetXBMCLog: cannot execute - Permission denied

I sure am confused :-)

Tom

If you placed the script on your sd card you won't be able to execute it most likely. There are limits to what you can execute on the sd card in android (and it differs from rom to rom sometimes). Try running sh /path/to/GetXBMCLog instead. That should work for you.

(2013-01-03, 07:02)TomWardAtl Wrote: [ -> ]I installed ConnectBot, ran it, and after some trial and error got this command to work:

cat /data/data/org.xbmc.xbmc/cache/temp/xbmc.log > xbmc.log

So at least now I have a log file! Then I did a little reading, probably just enough to be dangerous :-) I created a text file called GetXBMCLog which contains:

Code:
#!/bin/bash
cat /data/data/org.xbmc.xbmc/cache/temp/xbmc.log > xbmc.log
Genius! It never actually occurred to me to create a script to grab the file.
Quote:Based on what I read, in order to be able to execute this file, I tried the following:

chmod 755 GetXBMCLog

But when I do that, I get an "operation not permitted" error. Is this (again) because I don't have root? If so, why do I need root to set permissions on a file I just created?
I've just tried this, on the root of my sdcard, and the permissions are:
Code:
-rwxrwxr-x system   sdcard_rw ...
So it's owned by system in group sdcard_rw. I have no idea how that happened, because my current username is "app_124" (because that's the username that ConnectBot got installed under: Android gives each app its own unique username, to assist in keeping them in their own sandboxes).

So that's why the chmod is failing: I don't have the correct userid. Why it's like that, I don't know, but Android does have some pecularities: it's *not* linux, it just looks a lot like it.
Quote:I installed ES File Explorer and tried there (and in my other file explorer) to find a way to set permissions on a file, but no luck there.

If I type:

ls -l

it shows:

-rwxrwxr-x GetXBMCLog

Shouldn't that mean that it can be executed by anyone?
You're absolutely right. It can. Which is quite convenient, given I don't understand how the permissions got set in the first place.
Quote: But if I try ./GetXBMCLog it says:

/system/bin/sh: ./GetXBMCLog: cannot execute - Permission denied
I've done a bit of poking, and it's actually complaining about:
Code:
#!/bin/bash
because, not being linux, there's no /bin/bash file, so it can't execute it. In fact, there isn't even a /bin directory. On my phone, the full path to sh is /system/bin/sh (Android is not Linux Wink but that also gives the same error, which I still don't understand, but I'll see if I can figure it out.

However if you invoke sh directly, so
Code:
sh GetXBMCLog
then the hash-bang line is ignored, and it'll fetch the file nicely.

Quote:I sure am confused :-)

Tom
You're not the only one, now. But at least it *does* work. I'll take that, even with the mild confusion ;-)
I can access all files (included hidden files and folders) on my Android phone, but I can't seem to find the log-file anywhere.

I am also trying to connect my Android XBMC install with my Synology SMB server. For the record, I have no issue accessing my server files through ES File Explorer and also retreiving the database isn't an issue. When I try to play a movie it gives a "File not found" error and prompts me to remove the file from the database, which is crazy, because I just watched it on my HTPC.

Any ideas where I could find the log-file, so I can figure this thing out?
Try the debug log uploader add-on under "Programs" in the XBMC.org add-on repo.