Path Substitution Isn't Working (XBMCBuntu)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #1
So, here's the setup. It's an XBMCBuntu box, it accesses all media over SMB shares for a Windows XBMC box elsewhere. XBMC's SMB client is awful and gives me a LOT of grief, buffering, sudden stops, a lot of that. To work around this the SMB shares are mounted as local folders in Ubuntu, and XBMC thinks that these are local files. However this only works for the 'Master' profile that is my roommate's profile. She only uses a database on that machine alone. I have a secondary profile and it uses MySQL which is hosted on the Windows XBMC box and is accessed remotely. The MySQL database forwards the file locations for itself, as an example:

smb://FLUTTERSHY/Media/Fluttershy Shares/Television Series/The Big Bang Theory/The Big Bang Theory 7x20 The Relationship Diremption.mkv

The problem of course, this leaves XBMCBuntu to use XBMC's SMB Client and I get a bunch of problems. What I ATTEMPTED to setup was a path substitution to the locally mounted folders holding the same SMB shares. So to the xbmcbuntu box, this is also a valid location:

/media/Fluttershy Shares/Television Series/The Big Bang Theory/The Big Bang Theory 7x20 The Relationship Diremption.mkv

However the path substitution is NOT working. This is the code that my advancedsettings.xml has. When I look at the logs, I can see the sub being recognized and it gives no error... Does XBMC even GIVE errors for a pathsub if it's wrong?

<pathsubstitution>
<substitute>
<from>smb://FLUTTERSHY/Media/</from>
<to>/media/Fluttershy Shares/</to>
</substitute>
</pathsubstitution>

I can look at the logs and XBMC is clearly not substituting the path and going straight to it's smb:// locations.

Any ideas where I've gone wrong or any additional info I can provide to assist?
find quote
Kib Offline
Team-Kodi Server Dude
Posts: 3,412
Joined: Jan 2010
Reputation: 54
Location: NL
Post: #2
You forgot the advancedsettings tags?

Link to a full debug log please.

Neon skin - v3.0.8 now available for XBMC 13.x (Gotham)
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #3
Sorry, no, that was only a portion of the AdvancedSetting's file, I'll post the complete file now, it does seem to work correctly, you even see references to the PathSub in the XBMC log, it just doesn't seem to DO anything.


XBMC Debug log, sorry, LazyTV added a lot of 'noise' to the log: http://pastebin.com/nSzpr18h

AdvancedSettings.xml: http://pastebin.com/d4Zj0rHv

Any ideas?
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #4
No one with any ideas? Path substitution seems like a pretty straight forward thing, so I'm guessing I have the 'One thing wrong' problem and I'd really love it if someone could point out where I've gone wrong.
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #5
Here's a question: Can you even USE Path Substitution with a pathway that's being pulled from the MySQL server? All references I've searched up only mention using MySQL, THEN using PathSubs on the thumbnails or other content. None of them refer to pathsubbing the paths for the files as given by the MySQL database. Is what I'm trying to do even something XBMC can DO?
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 20,376
Joined: Jan 2011
Reputation: 258
Location: Arizona, USA
Post: #6
Have you tried just using

<from>smb://FLUTTERSHY/Media/</from>

without the username/password? That's what XBMC is getting hung up on. XBMC doesn't see the two as being the same. I just don't know if it will access your SMB server using passwords.xml or not. If it uses passwords.xml then you shouldn't need the actual username/password in advancedsettings.xml

You can make easy links to the XBMC wiki using double brackets around common XBMC words: debug log = debug log, Video library = Video library, SMB = SMB , userdata = userdata, etc
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #7
(2014-04-23 22:43)Ned Scott Wrote:  Have you tried just using

<from>smb://FLUTTERSHY/Media/</from>

without the username/password? That's what XBMC is getting hung up on. XBMC doesn't see the two as being the same. I just don't know if it will access your SMB server using passwords.xml or not. If it uses passwords.xml then you shouldn't need the actual username/password in advancedsettings.xml

I've actually tried it with and without, same results.

Here's a debug log without it:

http://pastebin.com/i8RMXSir

You clearly see that it is reading the advancedsettings.xml, but then you clearly see this line when I start playback:

17:03:10 T:3037358400 NOTICE: DVDPlayer: Opening: smb://FLUTTERSHY/Media/Television Series/19-2 (2014)/19-2 (2014) 1x07 Lovers.mkv

So no path being substituted. So yeah, is it possible that PathSubs just don't apply to paths provided by a MySQL DB?
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 20,376
Joined: Jan 2011
Reputation: 258
Location: Arizona, USA
Post: #8
I think it's normal for the log to still show the original path like that. It shouldn't make any difference for XBMC to use MySQL or SQLite, and some people have actually done what you're trying to do now and make it appear local when using MySQL. I'm not sure what the issue is, but I still suspect it might have to do with the complication of the SMB password.

If I understand correctly, XBMC uses a sort of path substation for SMB passwords so that those passwords aren't stored in the database. So using path subs on top of another path sub might be the main issue. That's just a guess on my part, though.

You can make easy links to the XBMC wiki using double brackets around common XBMC words: debug log = debug log, Video library = Video library, SMB = SMB , userdata = userdata, etc
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #9
Yes but it's also NOT WORKING. The SMB client in XBMC is kinda terrible, it seems to be the cause of many of 'buffering when streaming over SMB' threads on this forum that go unresolved. Cacheing doesn't seem to help, as whatever the issue is, it causes the cache to stop filling. The work around I found was to mount the SMB shares in the OS itself, then just having XBMC access the mounted shares as local files. Bam, works great. Bullet proof. But on my profile, which usese MySQL, which spits out SMB links which XBMC uses it's own client for, the issue remains. It remains even with the path sub in, so I'm pretty certain that the path is not being substituted.

On that note, I realize that the SMB issue is more than JUST the SMB client. I found that it varies by network hardware and other factors as well. I think it may have to do with latency on wireless networks. On one version of my router's firmware which offered an 'Xbox Mode' (Reduce latency for gaming clients really) the issue went away. But I since switched to DDWRT. That all said, using Ubuntu to mount the shares instead of XBMC also fixes it, so the XBMC SMB client seems to have pretty low tolerances for issues. I hope you can see why I'd like to figure this out.
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 20,376
Joined: Jan 2011
Reputation: 258
Location: Arizona, USA
Post: #10
Oh, I totally understand why you would want to do this. I'm just saying that it's probably because XBMC is trying to handle two levels of path subs for the SMB path, one for the password and one for the redirection to a local path, and it's getting tripped up. Or something.

I'm not a dev, so I'm not sure how to further troubleshoot this, but the only short term solution I can think of is to re-export your library, clear out the existing database, and re-import using a local path. Then add the path subs to the remote instances, rather than the other way around. I have the feeling that XBMC would handle that a lot better, even with passwords for the SMB shares.

You can make easy links to the XBMC wiki using double brackets around common XBMC words: debug log = debug log, Video library = Video library, SMB = SMB , userdata = userdata, etc
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #11
So I reversed that path substitution and then used it on the master account, which uses an SQLite DB and is just straight up pointed at the locally mounted shares as sources. It also didn't work

Here's an idea: Is it possible that having no protocol or drive letter up front, like smb:// or g:\ is making the path I want to substitute too 'vague' for XBMC to figure out for path subbing, even if it is in itself a perfectly viable path?
(This post was last modified: 2014-04-24 21:45 by DJ_Izumi.)
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #12
Yup! That's it. I changed the 'to' value from <to>/media/Fluttershy Shares/</to> to <to>G:/media/Fluttershy Shares/</to>, which is a totally invalid path, but it has a drive letter to give XBMC more to chew on. this instantly 'worked' in that all files were suddenly thought to be 'no longer available' as XBMC is now subbing the paths of every thing to a non-existent path.

Okay, so I found out the PROBLEM. Now... How the hell do I make this folder location more suitable for XBMC ot search out? /media/ as a mount location, without a drive letter or protocol just seems to be too vague. Is there some more 'detailed' path I could use?
find quote
DJ_Izumi Offline
Fan
Posts: 479
Joined: Jul 2007
Reputation: 3
Post: #13
Nope! I actually think you were right Ned, it was the stuff in Passwords.xml effectively doing a pathsub and then that confusing the other pathsub. Because I was able to break the pathway in XBMC by using "/mdia/Fluttershy Shares/" instead of "/media/Fluttershy Shares/". If that typo could break it then it must be working when typed correctly. However there's no evidence of the pathsub in the logs. I suspect that it's usage isn't mentioned in the logs. (I sorta think it should). Right now all I can do play some TV shows and see if the situation now allows playback without SMB issues causing buffering or unexpected end of files.

I also noticed that AFTER passwords.xml was blanked and the pathsub entirely removed from advancedsettings.xml, the locations also broke. Because it didn't know the passwords for them anymore. But with the pathsub in, the locations were playable again, even with no passwords.xml. So I think I have this but I'll report more in a few hours.
find quote