(deprecated) cross platform tuner sharing, friendly user test

  • Hello,


    please find attached, the first, very alpha, release of cross platform vtuner binaries and source code. The intended audience are people familiar with DVB, Dreamboxes and C programming language.


    Tested combinations so far are:
    - DVB-S, server i686, client DM800
    - DVB-S, server Dbox2, client DM800
    - DVB-S, server DM600PVR, client DM800
    - DVB-C, server i686, client DM800 (reported by H2Deetoo)
    - DVB-S, server DM7020, client DM800 (reported by mamba0815)
    - DVB-S, server DM7025, client DM800 (reported by Homey[GER])
    - DVB-S, server DM500, client DM800 (reported by Zonk2007)
    - DVB-C, server Dbox2, client DM800 (reported by jadne)
    - DVB-T, server DM8000, client DM800 (reported by MartiniB)
    - DVB-T, i686-Server, Client-DM800-S . ( change /etc/vtunerc.conf > DAEMON="/usr/sbin/vtunerct", reported by thatave)
    - DVB-S, server Kathrein UFS-910, client DM800 (reported by muffi_1, binary attached on page 6, built from sources 2009-08-26)
    - DVB-S, server Topfield7700PVR, client DM800 (reported by dampfhns3, using sh4 binaries contributed by muffi_1)
    - DVB-T, server siemens gigaset M740, client unknown (reported by jjskiner, binary and patch attached on page 30)


    If you want to use DVB-C/DVB-T please update to latest DVB Modules in flash (2008-08-20).
    Only DM800 or DM8000 can be used as client (maybe DM500 HD in future).


    Major improvements, compared to the several versions in the wild, are:
    - handling of byte ordering across multiple platforms
    - auto discover of idle servers from clients (no need to give IP address)
    - handling of more than one tuner per server
    - improved "dead client" detection (on power cycle or network failure)
    - client track it's state (frequency, pid list) and reconnect if server fails


    Know Limitations:
    - it's known to work only with very recent experimental images for DMM (Aug 2009 or later)
    - DiSEQ is know to work on all platforms, due to limited feedback I'm not sure to which extend. I can't test this myself. Please report both failure and sucess and include a short description of your DiSEQ equipment and type (eg. rotor, 1.1 switch etc.)
    - scaning is know to work with DVB-S and DVB-T, it can not be supported with DVB-C
    - encrypted channels are not working with dbox2
    - WLAN is likely not to work, this is a draw back of the performance boost implement 2009-08-22


    Know Bugs (only for latest release):
    - none so far :)


    How to start:
    - make sure that the DVB device is idle in your "tuner server" (eg. kill vdr/kaffein/mythbackend or whatever on your PC or enigma/neutrino/zapit on you dbox2)
    - copy vtunerd.i686 to your "tuner server" and execute (EDIT 2009-08-17: vtunerd.ppc is for E1 boxes, vtunerd.db2 fpr DBox2, vtunerd.mipsel for DM8000/DM7025/DM800). By default adapter0/frontend0 .../demux0 .../dvr0 is used. To select a different tuner, or more than one, you can add the following parameters:

    Code
    vtunerd number_of_tuners adapter frontend demux dvr [ adapter frontend demux dvr ]
    eg:
    vtunerd 1 0 0 0 0 #same as default
    vtunerd 2 0 0 0 0 0 3 7 2 #uses /dev/dvb/a0/frontend0,/dev/dvb/a0/demux0, /dev/dvb/a0/dvr1 and /dev/dvb/a0/frontend0,/dev/dvb/a0/demux7, /dev/dvb/a0/dvr2
    
    
    Please do not use demux0 on your DM8000 if you want to run enigma in parallel (most likely you will). As enigma allocates demuxes from bottom up you should use any high numbered demux instead.
    vtunerd 1 0 1 2 0 should be ok

    Please note that dvr isn't used by vtunerd.mipsel but anything must be given (even nonsens)
    - install the latest client package and change /etc/vtunerc.conf as needed. You can find more details about the parameters here: http://code.google.com/p/dreamtuner/source/detail?r=61
    - restart enigma on your DM800/DM8000 (eg. init 4; sleep 10; init 3 )
    - change configuration of "Tuner B" in enigma.


    How to (re)compile:
    - I've added a simple shell script to compile (compile.sh). Most likely you'll have to change several variables to match your local build environment.
    - latest binaries can be found at http://dreamtuner.googlecode.com/svn/trunk/dist/


    How to contribute:
    - source is available at http://dreamtuner.googlecode.com/svn/trunk/. I'll provide write access on request, please send a PM
    - Test, try to reproduce your problem and describe exactly. If you can fix yourself, please post your patch.


    What's missing:
    - integration with enigma, detection of unused tuners (client and server)


    Changes:
    2009-09-13: again revoked, issue with DVB-T/DVB-C
    - several bugfixes
    - pushing status, BER etc, corrected for ppc platforms
    - tuner discovery had several flaws for DVB-T/DVB-S
    - enigma didn't crash/hang anymore if vtunerc can't connect to vtunerd
    2009-09-05: Due to serious flaws, this version has been revoked
    - TS data transport switched from UDP to TCP
    - support for client reconnect/failover
    - status, BER, SNR is now pushed from server to client
    - vtunerd.mipsel needs libvtuner-service.so, either copy this to /lib or set/export LD_LIBRARY_PATH
    2009-08-26: - added support for DiSEQ with i686/mipsel and dbox2 vtunerd
    - minor changes to debug messages
    - implemented MSG_READ_UCBLOCKS call
    2009-08-24: - fixed DVB-T issue (thanks to MartiniB)
    - added a feature to limit packet latency to 100ms, DVB-S scaning is working now
    - added command line options for vtunerd to choose adapter/frontend/demux, as well as support to server more than one frontend
    2009-08-22-B: - fixes for vtunerd for DM8000/DM7025 and DM800, only tested with a simulated client (vtunerc-test.c)
    2009-08-22: - some performance improvements for both vtunerd and vtunerc, thanks to Ghost for the hint and H2Deetoo for the testing
    2009-08-21-B: - copy of TS data is now an independent thread
    - further DVB-C/DVB-T fixes (thanks to H2Deetoo)
    2009-08-21: - fixed PID Handling issue with E1 boxes (tested on DM600PVR)
    2009-08-20: - fixed issue with vtunerd, that caused hang sometimes after switching channel
    - frontend info is now forwarded to client, this is a preparation of upcoming driver release from DMM (DVB-C/DVB-T support)
    2009-08-19: - added debug output for vtunerc
    - several fixes for E1/ppc, support still incomplete
    2009-08-17: - fixed issue in vtuner-network.h


    I'll update this from time to time, with latest information. Please check first, maybe your question is already answered here.

  • Ok, if channel searching isn't going to work then I manually need to add channels to my lamedb.


    What parameter of the lines in lamedb defines the tuner/nim index?


    From my 500C I have the following data:
    ffff0000:0000:01f4
    c 388000:6875:0:0


    c:00007B,p:Ziggo
    1F44:FFFF0000:0000:01F4:1:469
    Ned 1
    p:Ziggo


    How to convert that to a lamedb entry for 2nd (dvb-c) tuner ?



    Rgs H2Deetoo,

  • in lamedb nims index isnt wrote, indexes are in the file /etc/enigma2/settings
    config.Nims.3.terrestrial=1
    config.Nims.2.terrestrial=2



    but there format of transponder parameters are different than in E1 services


    example of lamedb.air_riga

    dm8Ksstt+NN2 dm7020+GP
    1.8m+36E;28E;23E;19E;16E;13E;7E
    1.6m+42E;40/39E;36E
    1.0m+10/9E;5E;1W;8W
    0.8m+4/5W
    1.1m+12W;18W;24W
    1.0m+15W;22W;30W
    1.0m+75E;80E
    1.1m+53E;60E

  • >in lamedb nims index isnt wrote, indexes are in the file /etc/enigma2/settings


    Yes I know.
    My 2nd tuner is configured as:
    config.Nims.1.cable


    But if I add transponder data to lamedb, how to tell enigma2 it should use NIM 1 instead of NIM 0 ?


    Ahhh, wait :


    t 610000000:0:2:0:2:1:2:0:0:0


    You have "t" here (dvb-t) and I have "s" here (dvb-s).
    So I think I sould add "c" to tell enigma2 to use cable tuner.
    (Then, if you have more than 1 cable tuner, how to tell enigma2 which cable tuner to use ?)


    Is the format used in lamedb described somewhere?



    Rgs H2Deetoo,

  • Zitat

    Original von H2Deetoo
    You have "t" here (dvb-t) and I have "s" here (dvb-s).
    So I think I sould add "c" to tell enigma2 to use cable tuner.
    (Then, if you have more than 1 cable tuner, how to tell enigma2 which cable tuner to use ?)


    no need to tell enigma, enigma just chooses one.

  • that parameters more or less are clear
    "s " - DVB-S*
    "c " - DVB-C
    "t " - DVB-T


    others i can only gues


    and dont know how them must look in Enigma1,
    my 7020 have only dvb-s, two dvb-t live in 8k dream

    dm8Ksstt+NN2 dm7020+GP
    1.8m+36E;28E;23E;19E;16E;13E;7E
    1.6m+42E;40/39E;36E
    1.0m+10/9E;5E;1W;8W
    0.8m+4/5W
    1.1m+12W;18W;24W
    1.0m+15W;22W;30W
    1.0m+75E;80E
    1.1m+53E;60E

  • I tried to add 2 channels to my lamedb, but they are "greyed out" in the channellist and when I select them Enigma says: "Service unavailable. Check tuner status!"


    Because they are "greyed out" I think the configuration is not correct.
    Here it is though:


    transponders
    ffff0000:0000:01f4
    c 388000:6875000:2:3:0:0
    /
    ffff0000:001b:01f4
    c 826000:6875000:2:3:0:0
    /


    I have no idea what :2:3:0:0 means.
    For dvb-c I have seen :2:3:3:0 and also :2:3:15:0 and also :1:3:0:0


    services
    00C9:FFFF0000:001B:01F4:1:0
    Ned 1 HD
    p:Ziggo
    1F44:FFFF0000:0000:01F4:1:0
    Ned 1
    p:Ziggo


    I have no idea what :1:0 means.



    So would this be sufficient for Enigma2 to understand that it needs to use the (first?) dvb-c tuner available?



    Rgs H2Deetoo,

  • Hi,



    Did a test myself and it seems the vtuner driver is not correct.
    First of all, after running vtunercc and asking for frontend type (on /dev/dvb/adapter0/frontend1) I get the following:


    ioctl(fe_fd, FE_GET_INFO, &fe_info);
    printf("Frontend Type = %d\n", fe_info.type);


    root@dm800:/# ./vtunerc_test.mipsel
    Frontend Type = 0


    Type 0 means FE_QPSK and not FE_QAM !!
    So this is a bug in the vtuner driver.


    I think there are more issues but I will test it more deeply.


    rmie or Homey, can you inform Ghost about this issue?



    Thanks H2Deetoo,

  • I have also found a bug in vtunerc.
    Using test tool I try to set frontend like this:


    feparm.frequency=388000000;
    feparm.u.qam.symbol_rate=6875000;
    feparm.inversion=INVERSION_AUTO;
    feparm.u.qam.fec_inner=1;
    feparm.u.qam.modulation=2;


    Here is what vtunerc is getting from driver:
    [1727 vtunerc.c:138] info: vtuner message!
    00 69 20 17 02 00 00 00 78 E7 68 00 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


    If we analyze this we see:
    00 69 20 17 = FREQ 388000000
    02 00 00 00 = INVERSION
    78 E7 68 00 = SR 6875000
    01 00 00 00 = FEC
    02 00 00 00 = QAM


    This is OK.
    Now here is what I get when accessing some member variable in vtunerc:


    printf("VTUNER QAM=%d\n", msg.u.vtuner.body.fe_params.u.qam.modulation);


    VTUNER QAM=120


    As you can see the fe_params.u.qam.modulation member is holding value 120 (78h) and this is NOT good. It should be 2.


    I am not sure where this goes wrong, but for sure it is not ok.
    rmie: could you have a look at it also please?



    Thanks,
    H2Deetoo

  • Hmmm, I think the declaration of struct vtuner_message is not correct. If I change it to the following then the member variables seem to be correct!


    typedef struct vtuner_message {
    __s32 type;
    union {
    struct {
    __u32 frequency;
    __u32 inversion;
    union {
    union {
    __u32 symbol_rate;
    __u8 fec_inner;
    } qpsk;
    struct {
    __u32 symbol_rate;
    __u32 fec_inner;
    __u32 modulation;
    } qam;

    union {
    __u8 bandwidth;
    __u8 code_rate_HP;
    __u8 code_rate_LP;
    __u8 constellation;
    __u8 transmission_mode;
    __u8 guard_interval;
    __u8 hierarchy_information;
    } ofdm;
    union {
    __u8 modulation;
    } vsb;
    } u;
    } fe_params;
    __u32 status;
    __u32 ber;
    __u16 ss, snr;
    __u32 ucb;
    __u8 tone;
    __u8 voltage;
    __u8 burst;
    __u16 pidlist[30];
    __u8 pad[60];
    } body;
    } vtuner_message_t;



    So it seems most __u8 variables should really be __u32 and some union's need to be struct's.


    Where can we verify this? Can Ghost do it?



    Rgs H2Deetoo,


  • you are right about the struct, it should be like this:


    typedef struct vtuner_message {
    __s32 type;
    union {
    struct {
    __u32 frequency;
    __u8 inversion;
    union {
    struct {
    __u32 symbol_rate;
    __u8 fec_inner;
    } qpsk;
    struct {
    __u32 symbol_rate;
    __u8 fec_inner;
    __u8 modulation;
    } qam;
    struct {
    __u8 bandwidth;
    __u8 code_rate_HP;
    __u8 code_rate_LP;
    __u8 constellation;
    __u8 transmission_mode;
    __u8 guard_interval;
    __u8 hierarchy_information;
    } ofdm;
    struct {
    __u8 modulation;
    } vsb;
    } u;
    } fe_params;
    __u32 status;
    __u32 ber;
    __u16 ss, snr;
    __u32 ucb;
    __u8 tone;
    __u8 voltage;
    __u8 burst;
    __u16 pidlist[30];
    __u8 pad[60];
    } body;
    } vtuner_message_t;

    vtuner_message_t is derived from the following struct, with the need to avoid dvb_frontend_parameters (for E1 boxes) and the assuption that enum is mapped to __u8.


    struct {
    int type;
    union {
    struct dvb_frontend_parameters dvb_frontend_parameters;
    fe_status_t status;
    __u32 ber;
    __u16 ss, snr;
    __u32 ucb;
    fe_sec_tone_mode_t tone;
    fe_sec_voltage_t voltage;
    fe_sec_mini_cmd_t burst;
    unsigned short pidlist[30];
    unsigned char pad[60];
    } body;
    } msg;

  • Zitat

    Original von rmie
    Hi,


    with the patch above, it was possible to use a DBox2 as server :) Thanks for your tip.


    This means, the good old DBox2 could be used a third tuner for example on my DM7025? Only cable here and willing to test :winking_face:

  • As far as I can see there is still a bug in vtuner for dvb-c.
    But only a DMM developer (like Ghost) can verify this.


    Has onyone here contact with Ghost? And could you show him this topic ?


    But feel free to do some tests yourself and let us know the results.




    Rgs H2Deetoo,

  • >This means, the good old DBox2 could be used a third tuner for example on my DM7025?


    No I am sorry, it seems vtuner support is only available for DM800 and DM8000 at this time. Perhaps later DM500HD will follow but I am not sure if DM7025 will ever come ....



    Rgs H2Deetoo,

  • Hmm, did a same test again with vtunerct (dvb-t) and I got similar issue:


    ioctl(fe_fd, FE_GET_INFO, &fe_info);
    printf("Frontend Type = %d\n", fe_info.type);


    root@dm800:/# ./vtunerc_test.mipsel
    Frontend Type = 0



    Now, ofcourse this is still a bug in vtuner driver, but still it seems dvb-t is working as posted in other topics !?!?
    So I can only conclude that this IOCTL is not used by E2 ....


    Then the only issue I see now is that my manually added dvb-c channels are "greyed out" in channel list.
    This makes E2 not tune to them .....


    I am stuck now :frowning_face:



    Rgs H2Deetoo,

  • Zitat

    Original von kodo


    This means, the good old DBox2 could be used a third tuner for example on my DM7025? Only cable here and willing to test :winking_face:


    no only for DM800 or DM8000, 7025 can only be used as server, but not as client.


  • Can you check the tuner configuration as shown from enigma?


    EDIT: IRC is ok to get in contact with Ghost or tmbinc, pls. check http://www.dream-multimedia-tv…ad&postID=70056#post70056 for more details

  • ok, need to setup an IRC client then.
    From Enigma everything seems fine.


    First here is a log from /proc/bus/nim_sockets :


    root@dm800:~# cat /proc/bus/nim_sockets
    NIM Socket 0:
    Type: DVB-S2
    Name: Alps BSBE2
    Has_Outputs: yes
    NIM Socket 1:
    Type: DVB-C
    Name: VT-192.168.0.12
    Has_Outputs: no
    root@dm800:~#


    Also, if I go to Enigma menu I can see the dvb-c tuner and I can change settings (like scan qam64 yes/no etc.) so that all seems fine.


    Because it seems a channel scan will never be supported they only thing I can do is to manually add channels which I did, but I cannot zap to them (they are grey).


    rmie: if you like you can connect to my server and do some tests ... PM me if you want to.



    Rgs H2Deetoo,

  • hmm, just tried it with dvb-t and added some dvb-t channels.
    Again they are "greyed" in the channellist and when zapping I immediately get an error on screen (tuner configuration failed).


    And vtunerct is not even trying to send any cmds.


    So my big Question is why channels are "greyed" in the list ?



    Rgs H2Deetoo,