Using TSReader with remote SMB

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #1
Hey,

I can't get the TSReader with SMB working on XBMC. It's a remote SMB connection, I have shared the Timeshift and Recorded TV folder and I can on the client, using windows file explorer, access the folder and it's content just fine. The Timeshift folder in Mediaportal is G:\Temp and the shared folder is named "Timeshift" with G:\Temp as it's path. Under XBMCTVServer plugin it's says \\USER\Timeshift\.

When I try to play a channel it just tries to load, and then stops (on a linux box it just results in a loading loop) - in xbmc.log it says:

Quote:20:33:13 T:5492 NOTICE: Creating InputStream
20:33:15 T:5492 NOTICE: AddOnLog: MediaPortal PVR Client: CTsReader::Open(G:\Temp\live3-0.ts.tsbuffer)
20:33:20 T:5492 ERROR: AddOnLog: MediaPortal PVR Client: Cannot find or access file: \\USER\Timeshift\live3-0.ts.tsbuffer. Check share access rights.
20:33:20 T:5492 ERROR: CDVDPlayer::OpenInputStream - error opening [pvr://channels/tv/All TV channels/8.pvr]
20:33:20 T:5492 NOTICE: CDVDPlayer::OnExit()
20:33:20 T:5492 NOTICE: CDVDPlayer::OnExit() deleting input stream
20:33:20 T:5608 NOTICE: CDVDPlayer::CloseFile()

It mentions share access rights, but in file explorer it works fine as mentioned before - it also seems as the G:\Temp is correctly shared as \\USER\Timeshift\ - don't know what's wrong..
When a channel is selected the buffer is created in G:\Temp on the server. Does it think that G:\Temp is a local folder on the client?

There are no problems with the a router, it's directly accessing the internet. Btw when using file explorer I enter the static ip to access the folder, as it's a remote share, not the hostname.

Hope you guys can help Blush
find quote
margro Offline
Fan
Posts: 626
Joined: Oct 2009
Reputation: 21
Location: The Netherlands
Post: #2
The Linux version of the plugin should translate the path from \\USER\Timeshift\live3-0.ts.tsbuffer into smb://username:password@USER/Timeshift/live3-0.ts.tsbuffer which it clearly does not do in your case. I can't tell what is going wrong in your case without a full debug xbmc.log file, but I've seen some problems in this area with Gotham and I've already done some modifications in my development version, but it needs more testing from my side before I will send the update to Team XBMC.

Developer of the MediaPortal PVR addon and the Argus-TV PVR-addon. Unofficial XBMC Windows builds with PVR (Dharma, Eden and Frodo).
http://www.scintilla.utwente.nl/~marcelg/xbmc
(This post was last modified: 2013-07-30 22:54 by margro.)
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #3
The xbmc.log is from the windows client (Frodo 12.2) , maybe haven't clearly mentioned it. I'll try on the linux box (Frodo 12.0) and see what it's xbmc.log says. I can post the logs on xbmclogs.com.
find quote
tommywm22 Offline
Junior Member
Posts: 15
Joined: Jul 2012
Reputation: 0
Post: #4
In Media Portal Server I set my folder path through the network path instead of the local path.

So in Media Portal TV Server\timeshifting\folders I have

\\SERVER\Timeshift

And the XBMC Plugin shows the same path
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #5
Using \\USER\Timeshift gives the same error with G:\Temp being replaces by \\USER\Timeshift. However, if I add a smb share in xbmc (works both in win7 and the linux box) I can play the .ts file directly: smb://username:password@ipaddress/Timeshift/live3-0.ts.tsbuffer. Seems that the plugin (on windows and linux) doesn't really use the ip that's provided (when using TSReader), but rather the hostname (USER) that it gets. Maybe there should be a option to use ip as in \\ipadress\ rather than \\user\ (or rather \\hostname\) when playing.

However the direct playing of the buffer over smb was bad, it stutters, audio dropping every ½-1 second, video slowing down right away then normal for a second (nothing wrong with the internet connection, as I can play using ffmpeg-mode on the computer, however the linux box can't after a minute because of ffmeg/rtsp stuff).
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #6
Hey, an update:

I can get the plugin to work by editing "hosts" file on the client (windows\system32\etc\hosts) so USER is directed to the server ip, which is cool Smile
BUT it buffers every 2 second, and if there is space with 4 seconds without some buffering it stutters as mentioned in the above post..

I can download 1,2mb/s via smb from the server, and the the selected channel is SD so shouldn't be a a connection problem - have tried "wait time after tuning a channel" with 3000 ms, no luck.

I have pasted a complete debug log here:
http://xbmclogs.com/show.php?id=41111

Have changed the server ip in the log as it's on the net, it's obviously not 255.0.255.0 Smile
find quote
margro Offline
Fan
Posts: 626
Joined: Oct 2009
Reputation: 21
Location: The Netherlands
Post: #7
Yes, the hosts file workaround should fix it if XBMC/Windows is not able to access \\USER by name.
A configuration option for overriding the hostname to an IP-address would be a good idea...

Just checked your log file, and the ffmpeg decoding part below indicates some problems with DXVA decoding on you system in combination with the TV stream. Could you disable DXVA and try again to see if DXVA is indeed the problem?
What happens if you record the channel and play the recording in XBMC?

Quote:17:14:19 T:5348 ERROR: Previous line repeats 1 times.
17:14:19 T:5348 ERROR: ffmpeg[14E4]: [h264] Missing reference picture
17:14:19 T:5348 ERROR: ffmpeg[14E4]: [h264] decode_slice_header error
17:14:19 T:5348 ERROR: ffmpeg[14E4]: [h264] hardware accelerator failed to decode picture
17:14:19 T:5348 INFO: ffmpeg[14E4]: [h264] Cannot parallelize deblocking type 1, decoding such frames in sequential order
17:14:19 T:5348 DEBUG: ffmpeg[14E4]: [h264] Increasing reorder buffer to 1
17:14:19 T:5348 ERROR: ffmpeg[14E4]: [h264] hardware accelerator failed to decode picture
17:14:19 T:5348 ERROR: Previous line repeats 1 times.

Developer of the MediaPortal PVR addon and the Argus-TV PVR-addon. Unofficial XBMC Windows builds with PVR (Dharma, Eden and Frodo).
http://www.scintilla.utwente.nl/~marcelg/xbmc
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #8
The same problem with DXVA off - it's buffering every second, to 4-13% then playing for ½ sec, then again buffering 4-13% then playing etc. Have tried pausing for 10 seconds, it plays, then buffers when it reaches - networx's shows 167 kb/s, which is nothing - should be atleast twice for SD - a regular SD .mp4 x264 from the same smb folder plays normally with 300-400 kb/s.

Here is the log: http://xbmclogs.com/show.php?id=41117

I'll try the recording and get back to you, it's dinner time Smile
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #9
Looks like I was using wireless (cable apparently got loose) - with cable the live tv stutters, audio drops and get slowdowns but no buffering, it's showing about 300 kb/s.
Playing a recording it plays well (not perfect, some small audio dropping once in a while) and it gets 500 kb/s. Recording played locally is perfect.

It's odd that when receiving the live buffer it only downloads 300 kb/s when a recorded file 500 kb/s from the same channel (SD)..

Xbmc.log for the live tv now looks like: http://xbmclogs.com/show.php?id=41137

EDIT: I enabled DVXA again.
(This post was last modified: 2013-07-31 19:16 by sizanx.)
find quote
margro Offline
Fan
Posts: 626
Joined: Oct 2009
Reputation: 21
Location: The Netherlands
Post: #10
I've checked your last logfiles and I don't see any errors about buffer underruns in the PVR addon log lines. I still see quite some ffmpeg errors in your log.
I've really no clue why it stutters.

Developer of the MediaPortal PVR addon and the Argus-TV PVR-addon. Unofficial XBMC Windows builds with PVR (Dharma, Eden and Frodo).
http://www.scintilla.utwente.nl/~marcelg/xbmc
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #11
I think it's because of xbmc thinks it's mapped local network drive because of SMB, meaning that "cachemembuffersize" isn't used and increasing it won't affect it.

I have tried setting up a simple ftp server, edited your addon (TSReader.cpp) from opdenkamp's frodo git so changes the timeshift path (\\user\timeshift) to ftp instead, long story short: starting a channel makes the tsbuffer, but it won't play the tsbuffer. The error is a repeat of following:

Code:
19:28:30 T:7904   DEBUG: ------ Window Init (DialogBusy.xml) ------
19:28:32 T:1564    INFO: AddOnLog: MediaPortal PVR Client: Channel stream URL: rtsp://255.0.255.0/stream3.0, timeshift buffer: \\USER\Timeshift\live3-0.ts.tsbuffer
19:28:32 T:1564    INFO: AddOnLog: MediaPortal PVR Client: Creating a new TsReader...
19:28:32 T:1564  NOTICE: AddOnLog: MediaPortal PVR Client: CTsReader::Open(\\USER\Timeshift\live3-0.ts.tsbuffer)
19:28:32 T:1564    INFO: AddOnLog: MediaPortal PVR Client: CTsReader:TranslatePath \\USER\Timeshift\live3-0.ts.tsbuffer -> ftp://user:pass@255.0.255.0:12345/live3-0.ts.tsbuffer
19:28:32 T:1564   DEBUG: AddOnLog: MediaPortal PVR Client: FileReader::OpenFile() Trying to open ftp://user:pass@255.0.255.0:12345/live3-0.ts.tsbuffer
19:28:32 T:1564    INFO: AddOnLog: MediaPortal PVR Client: FileReader::OpenFile() ftp://user:pass@255.0.255.0:12345/live3-0.ts.tsbuffer.
19:28:32 T:1564   DEBUG: CFileCache::Open - opening <live3-0.ts.tsbuffer> using cache
19:28:32 T:1564   DEBUG: CurlFile::Open(085A19D0) ftp://user:pass@255.0.255.0:12345/live3-0.ts.tsbuffer
19:28:32 T:1564    INFO: XCURL::DllLibCurlGlobal::easy_aquire - Created session to ftp://255.0.255.0
19:28:33 T:1564 WARNING: XFILE::CCurlFile::CReadState::FillBuffer: curl failed with code 18
19:28:33 T:1564   ERROR: CCurlFile::CReadState::Open, didn't get any data from stream.
19:28:33 T:1564   ERROR: XFILE::CFileCache::Open - failed to open source <ftp://user:pass@255.0.255.0:12345/live3-0.ts.tsbuffer>

The edited TSReader.cpp is:
http://xbmclogs.com/show.php?id=44050

It's very rough code, it's was just to be a proof of concept before trying to do more if it's works. Any ideas margro?
(This post was last modified: 2013-08-10 20:14 by sizanx.)
find quote
sizanx Offline
Junior Member
Posts: 35
Joined: Jul 2008
Reputation: 0
Post: #12
I compiled xbmc 12.2 and bumped ffmpeg to 1.2, and I use ffmpeg mode instead, had some problems with ffmpeg mode before, this seems to fix it.
find quote