recording on USB sticks (pendrives) using PVR+

Here are software that related with Samsung B series TVs. Like hex editors, new version of BusyBox or internal software, app programs that will run in your TV hardware.:!:This forum is NOT FOR USER QUESTIONS or Problems.
Post Reply

geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

recording on USB sticks (pendrives) using PVR+

Post by geo650 »

Hello!

Can you help me with recording on USB-sticks (pendrives) using PVR+? I've noticed, that recording even on fast pendrives is almost imppossible.

Recording is started without problems, then after STOP keypress PVR+ is still flushing buffered data to TS-file during several minutes (you can see gray icon in PVR+). You can use FTP or telnet connection to see TS-file is growing and growing unless the buffer is empty. During this period you actually can't do anything.

First thought: input-output buffer is too big. So I was thinkg about this function:

Code: Select all

void set_io_buffer_size(unsigned val)
{
   static unsigned *pvr_recinstance;

   if (val > 0)
   {
      spIPvr_GetRecInstance(0, &pvr_recinstance);
      if (pvr_recinstance) *(pvr_recinstance + 0x2C/4) = val;
   }
}
and tried to record using different values. No success. Even with val=0.
I don't really know what is going on. Recording on HDD works perfect. So recording using LAN. But recording on USB flash memony is not good.
Any ideas?
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: recording on USB sticks (pendrives) using PVR+

Post by sbav1 »

I wonder what chunk size is Samsung PVR code using typically for write(fd, ...) calls. And how is it related to PVR buffer size?

Underlying problem here (pure speculation/ just IMO) is: removable drives are mounted with 'sync' option by default. In that mode write speeds on Samsung B650 tends to be really bad for pendrives/flash devices.
E.g., here are write speed test results for my Cruzer Contour 16GB ("dd if=/dev/zero bs=..", file sizes 20-100MB):

Code: Select all

bs=188: 60kB/s (TS packet length)
bs=512: 160kB/s
bs=1k: 264kB/s
bs=2k: 420kB/s
bs=8k: 700kB/s
bs=16k: 850kB/s
bs=32k: 1.1MB/s
bs=1M: 1.1MB/s
For the same pendrive, remounted with no 'sync' option (busybox mount -o remount,async /dtv/usb/sda1 ), I'm getting 4 MB/s average write speed (dd, bs=188|1k|32k|1M, including time required for doing 'sync; sync; sync' manually). Write performance penalty for small block sizes is virtually unnoticeable..
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: recording on USB sticks (pendrives) using PVR+

Post by geo650 »

sbav1 wrote:I wonder what chunk size is Samsung PVR code using typically for write(fd, ...) calls. And how is it related to PVR buffer size?

Underlying problem here (pure speculation/ just IMO) is: removable drives are mounted with 'sync' option by default. In that mode write speeds on Samsung B650 tends to be really bad for pendrives/flash devices.
...
For the same pendrive, remounted with no 'sync' option (busybox mount -o remount,async /dtv/usb/sda1 ), I'm getting 4 MB/s average write speed (dd, bs=188|1k|32k|1M, including time required for doing 'sync; sync; sync' manually). Write performance penalty for small block sizes is virtually unnoticeable..
Thank you. I have made some tests with my pendrive and the results were similar. After remounting it with 'async' flag it performed much better. Well... it is time to add one more option to PVR+ ;) I think it will be better than making custom pre-recording scripts. So please expect new PVR+ 2.0 with an option for remounting external USB drives (/dtv/usb/*) with 'async' mode (set to YES by default).

BTW, the same phenomenon (low performance) also occurred with NTFS-3G driver.

P.S. About relationship of chunk size to the buffer size value: it seems to require much more tracing and examining. I think the problem is solved for now, so we can leave this particular question unanswered. Thanks.

Post Reply

Return to “[B] Software”