FritzBox 6490 Support

Support forum for minisatip
Post Reply
Flole
Posts: 3
Joined: Sun Feb 11, 2018 6:18 pm

FritzBox 6490 Support

Post by Flole »

Hello,

I am trying to add support for the FritzBox 6490 to minisatip. However, the FritzBox doesn't use the dvbapi at all. Instead I need to know the frequency and the PIDs so I can call another library which is able to call a callback and pass the received packets to that one. Where would be the best place to implement that? A minimalistic approach would not send a signal strength and other fancy things, so that's what I want to do first. Also I can create up to 4 Streams, so the best is probably a multithreaded approach? I don't want to break anything so I am not sure where exactly I can start to add my code while keeping everything else mostly untouched.

Looking forward to your answers

Flole
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: FritzBox 6490 Support

Post by cata »

Hi,

You mean compile minisatip and run it on the device itself?

If yes a good start is to look at netceiver.c. Also see my last comment on viewtopic.php?f=5&t=466

You just need to add a new C file and implement those methods and then push the stream read from the device to minisatip core components. What CPU speed has 6490?

Thanks
Flole
Posts: 3
Joined: Sun Feb 11, 2018 6:18 pm

Re: FritzBox 6490 Support

Post by Flole »

Yes exactly, running this on the 6490 itself. The 6490 has an x86 CPU with 2 cores at 1,2Ghz. (and also an ARM Core, but that's not relevant for this as the demuxers are running on the x86).

Actually that at least looks more difficult than what I expected. This is the library I have to use https://bitbucket.org/Flole998/ffritz/s ... ew-default
Most of it should be pretty much compatible, so I just have to write a method that calls another method, should be pretty straigth forward. Still there are some things not really clear to me:

When I look at the netceiver.c I don't see where I should send the data to. Also is minisatip multithreaded? Or how would I keep track of the streams? For example I have a handle that I need everytime I want to do something with the stream, for example add or remove pids or stop the stream. A full description (or even better a skeleton) would be really helpful (although it's probably not happening too often that someone is developing a plugin). This plugin can probably even be used as a skeleton because it just forwards every parameter to the library.

Looking forward to your answer

Flole
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: FritzBox 6490 Support

Post by cata »

Hi,

check https://github.com/catalinii/minisatip/ ... iver.c#L80

basically netceiver creates a pipe, one end is in ad->dvr which is read by stream/adapter implementation in minisatip.c and expects the TS packets (188 bytes, starting with 0x47). The other end of the pipe is written with the stream received from the library in your case. Once you write, minisatip will read it on the other end and process it (decrypt, send to the clients, ...).

This implementation is generally attached to a physical device, as adapter.c combines all the streams attached to that device and makes just one call (of adding pids) to the adapter. Each adapter is tuning to a different freq.

Let me know if u need any help...
Flole
Posts: 3
Joined: Sun Feb 11, 2018 6:18 pm

Re: FritzBox 6490 Support

Post by Flole »

Even the netceiver is so loaded with stuff that it's hard to see what's actually needed. I am struggling integrating even the simplest things because there is almost 0 documentation. Where can I store my tuner handle? When should I allocate my stream? What is the commit meant for? Why do I have to store the PIDs and can't add/delete them directly from the tuner? Also I don't see a reason why the tune is not done in the tune part of it? Are things like spectral inversion and symbol rate already set when the open stream function is called? And in what order are the functions called? What of the find_netcv_adapter is actually needed? I am getting the number of tuners from the library, so what do I actually have to do? This is what I have so far, but nothing works.

Code: Select all

		/* initialize signal status info */
		ad->strength = 0;
		ad->status = 0;
		ad->snr = 0;
		ad->ber = 0;

		/* register callback functions in adapter structure */
		ad->open = (Open_device)netcv_open_device;
		ad->set_pid = (Set_pid)netcv_set_pid;
		ad->del_filters = (Del_filters)netcv_del_pid;
		ad->commit = (Adapter_commit)NULL;
		ad->tune = (Tune)netcv_tune;
		ad->delsys = (Dvb_delsys)netcv_delsys;
		ad->post_init = (Adapter_commit)NULL;
		ad->close = (Adapter_commit)netcv_close;
		ad->type = ADAPTER_FRITZBOX;
		ad->sys[0] = SYS_DVBC_ANNEX_A;
This is taking all the fun from this project. If you look at the library I need to interface with, it should be pretty straight forward, but because of the missing documentation it isn't. I don't have time to understand how the entire minisatip works, that's why things like this are usually documented so everyone can develop their own plugin.
cata
Site Admin
Posts: 768
Joined: Tue May 12, 2015 1:01 am

Re: FritzBox 6490 Support

Post by cata »

Where can I store my tuner handle?

You can make a structure like in neceiver.c (where you can store the context):
SNetceiver *sn[MAX_ADAPTERS];
for convenience you can keep the same index in sn (in this case) with the ad->id
#define SN sn[ad->id]

For reference you can see also satipc.c and dvb.c. For you some of the methods do not need to be implemented as they deal with local device (while satipc and netceiver are network clients, so they need to agregate multiple requests into 1).

When should I allocate my stream?

netcv_open_device is when the device is open as it has already a client requesting tune to a specific frequency

What is the commit meant for?

To aggregate multiple addpids, delpids into 1 request, most likely not needed in your case

Why do I have to store the PIDs and can't add/delete them directly from the tuner?

you do not need to store it if you do not use commit, just add it using the library function

Also I don't see a reason why the tune is not done in the tune part of it?

in your case you can do it in the tune (your implementation will be very close to the implementation in dvb.c)

Are things like spectral inversion and symbol rate already set when the open stream function is called?

When the tune is called, the inversion and SR will be part of the transponder structure

And in what order are the functions called?

Generally is find_netcv_adapter which needs to mark an adapter (next avaialbe) as ADAPTER_FRITZBOX. It is important the type of adapter (ad->sys[0] or ad->sys[1] to be detected/set). When get_free_adapter is called it will find an available adapter and initialize it. Then netcv_open_device will be called. When the client (1 or more) request for the stream to be tuned, it will call netcv_tune and then netcv_set_pid / netcv_del_pid. netclient does not have the notion of client streams, is just adding and removing pids.

What of the find_netcv_adapter is actually needed?

check dvb.c#L1501

check also satipc.c#L1203 until 1238 - here it searches for a free device and sets the fields (that is what you need to do).

I am getting the number of tuners from the library, so what do I actually have to do? This is what I have so far, but nothing works.

Make sure you do adapter_alloc() (or use the adapter for which ad->type is 0), then set ad->type = ADAPTER_FRITZBOX, then set the adapter functions as in satipc.c . Then you can allocate your structure and set any private fields.
Do not open a stream to the library function until ad->open is called and you can close it when the ad->close is called.

Whatever you do feel free to push the file to github, as long as it is not enabled in the Makefile, we can continue developing it without impacting the app build.
If you want to add it to the src/Makefile.in, check how DDCI is defined.

Thanks
Post Reply