Hi,
Thanks for the reply - glad to see that someone else is having similar problems.
I'd like to try some benchmarking to find out exactly where the problems occur with the pi, as it looks like the perfect machine for running TV headend.
Doing a simple test using 'dd' to copy files between a USB connected hard disk shows about 9MB/s using a block size of 1M and 1.7MB/s using a block size of 4k.
dd if=/dev/dvb/adapter0/dvr0 to the hard disk with a block size of 1M shows about 6-8% CPU usage or about 16-20% CPU usage with a block size of 512 bytes. (Very rough benchmark obtained using 'top' on a BBC1 Scotland HD stream).
Unfortunately I can't find something that seems happy to play/analyse H264 encoded TS format files to see if the data is correctly there, but it would appear that dd is probably capable of recording OK which suggests the bottleneck might be in tvheadend - but I'm not sure.
The questions to me are:
- Is there a fundamental limitation of the Pi (e.g. useless USB bus) that means this isn't feasible?
- If the hardware is capable can some easy adjustments be made to the tvheadend code to make it work - e.g. set thread priorities or adjust buffer sizes.
I need find time to look through the code properly and understand it - but would I be correct in saying the reading of DVB is done in dvb/dvb_adapter.c/dvb_adapter_input_dvr() ? I'm not yet sure of the breakdowns between the DVB thread and the DVR thread. Does one thread read from the adapter and another thread writes? Does some men copy take place between reading and writing?
If my look is correct then the dvb_adapter_input_dvr() reads into a buffer of size 10*188 which is presumably 10 transport stream packets. I might increase this number to see what happens.