Streaming HDTV from DVB-S2 USB tuner?

Ideas and dreaming will go this forum

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby marcelru » Thu Mar 10, 2011 12:38 pm

Just a quick update on my progress,

1 Buy a linuxtv compatible USB DVB-S2 tuner/receiver (with or without smartcard reader). Terratec has some of these (S2 and S7 models).

Bought the terratec S7, it has a CA module slot and has full-fledged linux support. Downloaded the firmware and driver code from http://linux.terratec.de, installed the firmware on my fedora 14 box, plugged it in and it works just like that, good.
2 Compile the driver and v4l(2) software layer for it.

This took a bit longer. I made a dedicated development environment for the kernel modules (vanilla 2.6.18 kernel with approximately the same configuration as my tv's kernel (2.6.18-SELP-ARM)) I downloaded the v4l-dvb backport from linuxtv.org, and copied it piecemeal into the main linux source tree. This backport features DVB API version 5.0, while the 2.6.18 kernel only supports 3.1 (or 2, don't remember exactly). Because the dvb stack is only very loosely coupled to the main linux kernel tree, this was fairly easy, just a few patches were needed to make things work. This does not mean that everything is without glitches, but sufficient for TV reception.

After testing I compiled all required modules (7 of them!) for samsung ARM. It was a clean build, no problems.
3 Do the settings for the receiver through the TV, over USB, via some injected code.

To be done.
4 Set the tuner/receiver to spit out a Samsung tv compatible videostream over USB.

So far, I borrowed a satellite dish from a colleague of mine, single LNB, for Astra east 19.2. No decryption module installed yet.
With the software available from linuxtv (dvb-apps) I can scan for channels and control the tuner. Will probably compile for ARM without too much trouble.

The FTA channels all emit MPEG_TS streams (mpeg transport stream, multiplexed mpeg 2 video, mpeg layer 3 audio and a vbi (teletext) channel). This is the same format as .VOB used on DVDs. These .VOBs, when renamed to .mpg play flawlessly on my TV, so I don't expect anything nasty there. HDTV hasn't been tested yet.

5 Open a pipe for video data collection, from USB.

6 Readout the pipe as if it is a USB pendrive.

7 Play the video stream as if it is a movie on a pendrive

I tested these steps on my development box, works like a charm.
8 Live happily ever after.

Will do that anyway ...

Things to be done:

Rootfs upgrade:
The installation of the kernel modules on my TV is easy, all required modules load, just the root file system needs two more mount points:
/dev/dvb and /lib/firmware (and possibly others). Work in progress. squashfs is not very friendly when it comes to portability across different software versions. If anyone could tell me what the easiest way of upgrading a root filesystem is, it will save me a lot of time.

Build scanning/zapping code for ARM:
Just a few hours work I guess. The scanning software (w_scan) has a full GNU implementation ( ./configure --host=xxx && make && make install). the zapping code needs some extras in the makefiles for cross compilation. Just things to be done, nothing seriously difficult.

Do channel hopping from the TV:
This will require injected code and some automated way of switching to movie playback, I have no experience there, so any advice will be more than welcome.


marcelr
marcelru
Official SamyGO Developer
 
Posts: 171
Joined: Thu Oct 01, 2009 7:27 am

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby juzis » Thu Mar 10, 2011 3:06 pm

Great!

You could mount --bind at autostart instead editing rootfs - no deal with unfriendly squashfs. Could you give a link for info about DVB-S2 USB tuner you got?
LE40B653T5W,UE40D6750
Have questions? Read SamyGO Wiki, Search on forum first!
[B] FFB (v0.8), [B] FFB for CI+ . Get root on: C series, D series, E series, F series, exeDSP/exeTV patches[C/D/E/F]

DO NOT EVER INSTALL FIRMWARE UPGRADE
User avatar
juzis
SamyGO Moderator
 
Posts: 8320
Joined: Sun Mar 07, 2010 6:20 pm

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby marcelru » Thu Mar 10, 2011 7:16 pm

Hi all,

I found the code for the rootfs squashfs version, 3.1. So building the rootfs as such is not a big issue. I made a new version, flashed it onto a usb stick and it mounts properly. The question concerning the flashing of it is really what works best.

When I copy the rootfs image onto some partition, can I just use bml.restore to flash it? Does this particular program load the complete image into memory and then start the flash, or is it not that simple?

Edit: You can't really safely flash a mounted filesystem. Unmounting the root filesystem leaves you with nothing, so I guess I'll have to explore the possibilities of booting the TV over the network, and then flash the (not-mounted) rootfs). It's been years since I booted a machine over network, bootp and all, have to delve deep into my memory for that ;-).

Or can I use the standard firmware upgrade route for the root fs (encrypt the image, write a validinfo.txt etc and then let the TV do the rest)?

The mount --bind method is a bit quirkier, because the root fs holds all device special files and therefore I expect quite some trouble there. Furthermore, an updated root fs will be a lot faster for startup than doing all this stuff after exeDSP has started.

BTW, the terratec s7 is made by a German company:
http://www.terratec.net/en/products/TER ... 83208.html

grtz,

marcelr
Last edited by marcelru on Fri Mar 11, 2011 12:41 pm, edited 1 time in total.
Reason: new info
marcelru
Official SamyGO Developer
 
Posts: 171
Joined: Thu Oct 01, 2009 7:27 am

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby arris69 » Sun Mar 13, 2011 3:46 pm

marcelru wrote:Hi all,

...

Or can I use the standard firmware upgrade route for the root fs (encrypt the image, write a validinfo.txt etc and then let the TV do the rest)?

...


think this is the smartest way, also maybe not required to encrypt it, boot.img is also acctepted without it by the firmware update function.
but maybe /.version needs to be cahanged to higher version??

don't forget also to make /tmp, /var/run and /usr/share directories too, makes later life easier ;-)

hth
arris
User avatar
arris69
SamyGO Moderator
 
Posts: 1674
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby arris69 » Sun Mar 13, 2011 3:52 pm

marcelru wrote:...

Rootfs upgrade:
The installation of the kernel modules on my TV is easy, all required modules load, just the root file system needs two more mount points:
/dev/dvb and /lib/firmware (and possibly others). Work in progress. squashfs is not very friendly when it comes to portability across different software versions. If anyone could tell me what the easiest way of upgrading a root filesystem is, it will save me a lot of time.
...


so looks like you also need a new kernel with firmware loading support (request_firmware funktion is not in stok kernel)

hth
arris
User avatar
arris69
SamyGO Moderator
 
Posts: 1674
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby marcelru » Sun Mar 13, 2011 4:53 pm

Hi arris,

The modules I need to load are: (excerpt from the load script)

insmod $MODULE_PATH/base/firmware_class.ko
insmod $MODULE_PATH/media/dvb/dvb-core/dvb-core.ko
insmod $MODULE_PATH/i2c/i2c-core.ko
insmod $MODULE_PATH/media/dvb/dvb-usb/dvb-usb.ko
insmod $MODULE_PATH/media/dvb/frontends/stb0899.ko
insmod $MODULE_PATH/media/dvb/frontends/stb6100.ko
insmod $MODULE_PATH/media/dvb/dvb-usb/dvb-usb-az6027.ko

Funny enough, the i2c-core module does not interfere with Samsung's i2c code. In the hardware I don't expect i2c collisions, both busses are completely decoupled.

The firmware loading stuff resides in firmware_class.ko. It tries to load a firmware file from /lib/firmware (which doesn't exist), but otherwise I don't expect trouble there.

The upgrade:
through Samsung's own method: A bump of the version number was not necessary a year and a bit ago for the exe and appdata images. Don't expect that for the rootfs either.
uboot method: Today I played around with the boot loader, get the TV to boot from USB. I think I prefer the manual upgrade of the rootfs, makes me feel a bit more in control :-). Use bml.restore and the likes.

About the other directories: good tips. /usr/share already exists, so will need to add further subdirs. /var is not there, but is always good to have, just as /tmp is. Everything mounted to it preferably goes in ramdisks, or at least non-tv flash memory.

BTW just finished the zapping code for ARM as well. Piece of cake, as expected.

In case someone's interested, I also started working on a wiki page (on my laptop, not in samygo.tv yet).

grtz,

marcelr
marcelru
Official SamyGO Developer
 
Posts: 171
Joined: Thu Oct 01, 2009 7:27 am

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby marcelru » Mon Apr 11, 2011 10:13 pm

Yet another update.

With quite a long private discussion with arris69, I managed to get the kernel modules and firmware upload working WITHOUT change of the root filesystem. Samsung actively suppresses automated firmware upload in their kernel code (kobject_uevent.c in /lib is crippled on purpose), but with some time spent with google, I made a bunch of scripts that do the job. My expectation for not encountering much trouble here was quite wrong. The scripts are not production level yet, but works-for-me. Also replacement of busybox is no longer necessary, so the complete base install will be fairly straightforward. No flashing whatsoever required.

The next (test)step would be to direct the dvr output to a pipe, and then play the stream from that pipe through the movie player menu. Unfortunately, the movie player discards pipes the minute they are encountered in e.g., /mtd_wiselink, so that didn't work.
When I route the video stream to a file in /mtd_wiselink, play it with the movieplayer, it shows on the screen. Aspect ratio is an issue (I never bothered to install the ARfix ;-) ). As a side product, PVR comes standard with this approach.
I'm looking into other playback options now. With only 800MB of /mtd_wiselink, the partition will fill up quite fast. Didn't try an NFS disk yet.

Stuff to be done:

stream playback without the need of large amounts of (disk)space.

aspect ratio issues

immediate display of satellite channels, not through the media play menu.

channel zapping with/through the native tv remote (reaper7's mybuttons?).

popups that show what you do (also reaper7's mybuttons code with some changes?)


That's it for now. to be continued.
marcelru
Official SamyGO Developer
 
Posts: 171
Joined: Thu Oct 01, 2009 7:27 am

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby erdem_ua » Mon Apr 11, 2011 10:23 pm

marcelru wrote:As a side product, PVR comes standard with this approach.

:lol: :lol: :lol:
User avatar
erdem_ua
SamyGO Admin
 
Posts: 2979
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby marcelru » Sun Jul 10, 2011 4:35 pm

Just a quick update again.

It's been quite busy in the last quarter of the academic year, that's the main reason why you haven't heard from me for quite a spell. Won't bother you with that, now it's time to get back on track.

The main change since last time is the DVB-S2 hardware. While the guys from Terratec boast about the linux DVB-S2 support for their S7 usb box, it actually doesn't exist. And the development of the linux drivers is not something they do, so I got a bit lost there, mainly because there isn't a single useful description for the tuner/decoder chipset in that device to be found anywhere.

So I am reverting to another box: the TBS5980, a USB DVB-S2 tuner with CI slot. New on the market since april or so, cheaper than the Terratec. When ordered through the internet it took those guys just three days to get it from China to my doorstep in The Netherlands. The linux driver is actively supported, DVB-S and DVB-S2 reception work out of the box, now only the CI module is still a bit of a problem. FTA channels all work. This week I will backport the drivers to kernel 2.6.18-SELP-ARM.

I have a new dish firmly mounted on my roof (a triplesat, 45 cm dish, reception of Astra 19.2 east, 23.5 east and 28.2 east. Over 2000 channels in total ;-) )

The wiki will have to wait a little, the last (automatic) update of my mediawiki installation effectively ruined my wiki database. Nothing that can't be salvaged, but it will take some time and priority level changes to get everything back.

Oh, and in the meantime my video display driver burned out. Just nicely coloured bars and stripes on the screen, nothing worth looking at, similar to some pictures I've seen in this forum, can't remember the thread just now. The service company asked me to upgrade the firmware, but with a little explanation they could be convinced that it was purely a hardware issue. I had it repaired (still with warranty). The service guy showed up with a complete new display, which was heavy bent, so I had him replace just the video board and not the entire display. He also offered to upgrade the firmware, but I politely refused that service ;-).

Small issue: ARFix installed, works.

Interesting: The brainstorm by arris69 and sbav1, on RC usage without code injection. Will follow that thread with great interest.


grtz,

marcelr
Last edited by marcelru on Sun Jul 10, 2011 5:00 pm, edited 1 time in total.
Reason: typo's
marcelru
Official SamyGO Developer
 
Posts: 171
Joined: Thu Oct 01, 2009 7:27 am

Re: Streaming HDTV from DVB-S2 USB tuner?

Postby eman » Thu Oct 06, 2011 11:18 am

I hate to have a bunch of remotes floating around in my living room

suggestion: What about an DVB-S2 tuner with HDMI-CEC (AnyNet) feature (->wiki/HDMI#CEC)
=> so it should be possible to control the tuner via the Samsung TV-remote (like you can control the later Sony-PS3s over the Samsung remote)

regards,
eman
eman
 
Posts: 2
Joined: Sun Oct 02, 2011 2:40 pm

PreviousNext

Return to [B] Brainstorm

Who is online

Users browsing this forum: No registered users and 2 guests