From a4fb0b111a0468f1c5c3954fb6c1437d5786887b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 23 Mar 2016 12:09:58 +0100 Subject: [PATCH] update minisatip.md - free inputs mode --- Makefile | 31 ++- dist/minisatip.md | 42 +++ patches/minisatip-axe.patch | 4 +- patches/minisatip5-axe.patch | 495 +++++++++++++++++++++-------------- 4 files changed, 366 insertions(+), 206 deletions(-) diff --git a/Makefile b/Makefile index af267f3c..2e964fc6 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ KMODULES = drivers/usb/serial/cp210x.ko \ drivers/usb/serial/oti6858.ko MINISATIP_COMMIT=54df9348e7bd7e6075f54f1b93ec4ad36429abe0 -MINISATIP5_COMMIT=ddd4796b2c759292f6db1d1be84bbeb5bd57ed03 +MINISATIP5_COMMIT=b53758b1b1b91ffc31597c319a706f350784400a BUSYBOX=busybox-1.24.1 @@ -324,12 +324,18 @@ apps/minisatip5/axe.h: patches/minisatip5-axe.patch cd apps/minisatip5; patch -p1 < ../../patches/minisatip5-axe.patch apps/minisatip5/minisatip: apps/minisatip5/axe.h + cd apps/minisatip5 && ./configure \ + --disable-dvbca \ + --disable-dvbcsa \ + --disable-dvbaes \ + --disable-netceiver make -C apps/minisatip5 \ DVBCSA= \ DVBCA= \ CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \ CFLAGS="-O2 -DAXE=1 -DSYS_DVBT2=16 \ - -DDISABLE_DVBCSA -DDISABLE_DVBCA -DDISABLE_TABLES -DDISABLE_NETCVCLIENT \ + -DDISABLE_DVBAPI -DDISABLE_DVBCSA -DDISABLE_DVBCA \ + -DDISABLE_TABLES -DDISABLE_NETCVCLIENT \ -I$(CURDIR)/kernel/include" .PHONY: minisatip5 @@ -339,6 +345,27 @@ minisatip5: apps/minisatip5/minisatip minisatip5-clean: rm -rf apps/minisatip5 +# +# minisatip package +# + +dist/packages/minisatip-$(VERSION).tar.gz: minisatip minisatip5 + rm -rf fs/usr/share/minisatip + mkdir -p fs/usr/share/minisatip/icons/ fs/usr/share/minisatip/html/ + install -m 755 apps/minisatip/minisatip fs/sbin/minisatip + install -m 644 apps/minisatip/icons/* fs/usr/share/minisatip/icons/ + install -m 755 apps/minisatip5/minisatip fs/sbin/minisatip5 + install -m 644 apps/minisatip5/html/* fs/usr/share/minisatip/html/ + tar cvz -C fs -f dist/packages/minisatip-$(VERSION).tar.gz \ + sbin/minisatip \ + sbin/minisatip5 \ + usr/share/minisatip/icons \ + usr/share/minisatip/html + ls -la dist/packages/minisatip* + +.PHONY: minisatip-package +minisatip-package: dist/packages/minisatip-$(VERSION).tar.gz + # # busybox # diff --git a/dist/minisatip.md b/dist/minisatip.md index 8c95f8cf..27c60255 100644 --- a/dist/minisatip.md +++ b/dist/minisatip.md @@ -28,6 +28,48 @@ before the power is turned off. Depending on the coaxial wiring and used reception components, the independent input power down might affect the signal quality during the power down phase. +Free inputs +----------- + +This mode is most powerful but requires a client which known +the limitations like tvheadend. In this mode all sources (src=) +defined by the SAT>IP specification are absolute (shared for +all tuners). So any tuner can use any position but with +physical restrictions. + +### Example: '-A 0:0:0,0:1:0,1:0:1,1:1:1,2:2:0,3:2:1' + +The first number defines the SAT>IP source minus one (0-max). +The second number defines the physical input (0-3). The third +number defines the diseqc position (0-31). You may configure +the diseqc more through -q and -d options. The adapter number +is like input number for them. + +Back to the example, the input configuration is like this: + +- input 0 + - src=1: diseqc position 0 - 23.5E (configuration 0:0:0) + - src=2: diseqc position 1 - 1W (configuration 1:0:1) +- input 1 + - src=1: diseqc position 0 - 23.5E (configuration 0:1:0) + - src=2: diseqc position 1 - 1W (configuration 1:1:1) +- input 2: + - src=3: diseqc position 0 - 28.2E (configuration 2:2:0) + - src=4: diseqc position 1 - 19.2E (configuration 3:2:1) + +So, four satellite positions, for 23.5E and 1W, there are +2 shared inputs, for rest, only one input is available. + +TVheadend can define network limits and network groups. +In this case, we have 2 groups of inputs (23.5E/1W) and +(28.2E/19.2E) and limits 2 for 23.5E/1W and 1 for rest. + +Tvheadend should be configured like this (for all tuners): + +- assign S23.5E to position 1, network limit 2, network group 1 +- assign 1W to position 2, network limit 2, network group 1 +- assign 28.2E to position 3, network limit 1, network group 2 +- assign 19.2E to position 4, network limit 1, network group 2 Linked inputs ------------- diff --git a/patches/minisatip-axe.patch b/patches/minisatip-axe.patch index ccc876f5..e329e77c 100644 --- a/patches/minisatip-axe.patch +++ b/patches/minisatip-axe.patch @@ -669,7 +669,7 @@ index 0000000..cfc1927 diff --git a/dvb.c b/dvb.c old mode 100755 new mode 100644 -index 5701bd2..60efc28 +index 5701bd2..58d8f1a --- a/dvb.c +++ b/dvb.c @@ -41,6 +41,10 @@ @@ -1024,7 +1024,7 @@ index 5701bd2..60efc28 + + if (axe_dmxts_add_pid(a->dvr, i_pid) < 0) + { -+ LOG ("failed setting filter on %d (%s)", i_pid, strerror (errno)); ++ LOG ("failed setting filter on PID %d (%s) for ADAPTER %d", i_pid, strerror (errno), hw); + return -1; + } + LOG ("setting filter on PID %d for ADAPTER %d", i_pid, a->pa); diff --git a/patches/minisatip5-axe.patch b/patches/minisatip5-axe.patch index a39a270e..189f8aa4 100644 --- a/patches/minisatip5-axe.patch +++ b/patches/minisatip5-axe.patch @@ -1,8 +1,8 @@ diff --git a/adapter.c b/adapter.c -index cd5d8f5..7af67d4 100644 +index 2ab5270..adf3c60 100644 --- a/adapter.c +++ b/adapter.c -@@ -117,6 +117,7 @@ int adapter_timeout(sockets *s) +@@ -118,6 +118,7 @@ int adapter_timeout(sockets *s) return 0; } @@ -10,7 +10,7 @@ index cd5d8f5..7af67d4 100644 if (opts.no_threads) { for (i = 0; i < MAX_ADAPTERS; i++) -@@ -133,6 +134,7 @@ int adapter_timeout(sockets *s) +@@ -134,6 +135,7 @@ int adapter_timeout(sockets *s) s->sid, do_close, max_close); if (!do_close) s->rtime = max_close; @@ -18,15 +18,55 @@ index cd5d8f5..7af67d4 100644 return do_close; } -@@ -322,6 +324,7 @@ void close_adapter(int na) - ad->ca_mask = 0; - ad->fe = 0; - ad->dvr = 0; -+ ad->sock = -1; +@@ -326,9 +328,12 @@ void close_adapter(int na) + ad->sock = -1; ad->strength = 0; ad->snr = 0; ++#ifndef AXE ad->old_diseqc = -1; -@@ -617,6 +620,7 @@ int tune(int aid, int sid) + ad->old_hiband = -1; + ad->old_pol = -1; ++#endif ++ mutex_unlock(&ad->mutex); + mutex_destroy(&ad->mutex); + // if(a[na]->buf)free1(a[na]->buf);a[na]->buf=NULL; + LOG("done closing adapter %d", na); +@@ -543,6 +548,19 @@ int set_adapter_for_stream(int sid, int aid) + return 0; + } + ++#ifdef AXE ++static void free_axe_input(adapter *ad) ++{ ++ int aid; ++ adapter *ad2; ++ ++ for (aid = 0; aid < 4; aid++) { ++ ad2 = get_adapter2(aid); ++ ad2->axe_used &= ~(1 << ad->id); ++ } ++} ++#endif ++ + void close_adapter_for_stream(int sid, int aid) + { + adapter *ad; +@@ -561,9 +579,12 @@ void close_adapter_for_stream(int sid, int aid) + LOG("closed adapter %d for stream %d m:%d s:%d", aid, sid, ad->master_sid, + ad->sid_cnt); + // delete the attached PIDs as well +- if (ad->sid_cnt == 0) ++ if (ad->sid_cnt == 0) { + mark_pids_deleted(aid, -1, NULL); +- else ++#ifdef AXE ++ free_axe_input(ad); ++#endif ++ } else + mark_pids_deleted(aid, sid, NULL); + update_pids(aid); + // if (a[aid]->sid_cnt == 0) +@@ -659,6 +680,7 @@ int tune(int aid, int sid) ad->status = -1; ad->status_cnt = 0; set_socket_pos(ad->sock, 0); // flush the existing buffer @@ -34,7 +74,7 @@ index cd5d8f5..7af67d4 100644 ad->rlen = 0; if (ad->sid_cnt > 1) // the master changed the frequency { -@@ -935,6 +939,18 @@ get_adapter1(int aid, char *file, int line) +@@ -977,6 +999,18 @@ get_adapter1(int aid, char *file, int line) return a[aid]; } @@ -53,7 +93,7 @@ index cd5d8f5..7af67d4 100644 char* get_stream_pids(int s_id, char *dest, int max_size); char * describe_adapter(int sid, int aid, char *dad, int ld) -@@ -1304,6 +1320,53 @@ void set_slave_adapters(char *o) +@@ -1346,6 +1380,93 @@ void set_slave_adapters(char *o) } } @@ -76,11 +116,51 @@ index cd5d8f5..7af67d4 100644 + continue; + b_id=map_intd(sep1 + 1, NULL, -1); + if (b_id < 0 || b_id >= MAX_ADAPTERS) -+ continue;; -+ if (a_id == b_id || a[a_id]->slave) + continue; -+ a[a_id]->slave = a_id + 1; -+ LOG("Setting adapter %d as master for adapter %d", a_id, b_id); ++ if (a_id == b_id || (a[a_id] && a[a_id]->slave)) ++ continue; ++ if (!a[b_id]) ++ a[b_id] = adapter_alloc(); ++ a[b_id]->slave = a_id + 1; ++ LOGL(0, "Setting adapter %d as master for adapter %d", a_id, b_id); ++ } ++} ++ ++extern int absolute_switch; ++extern int absolute_table[32][4]; ++ ++void set_absolute_src(char *o) ++{ ++ int i, la, src, inp, pos; ++ char buf[100], *arg[20], *inps, *poss; ++ ++ strncpy(buf, o, sizeof(buf)-1); ++ buf[sizeof(buf)-1] = '\0'; ++ la = split(arg, buf, sizeof(arg), ','); ++ for (i=0; i 31) ++ continue; ++ if (inp < 0 || inp > 3) ++ continue; ++ if (pos < 0 || pos >= 15) ++ continue; ++ LOGL(0, "Setting source %d (src=%d) to input %d position %d", src, src + 1, inp, pos); ++ absolute_table[src][inp] = pos + 1; ++ absolute_switch = 1; + } +} + @@ -100,7 +180,7 @@ index cd5d8f5..7af67d4 100644 + input = input2; + } + opts.axe_unicinp[i] = input; -+ LOG("Setting input %d for unicable adapter %d", input, i); ++ LOGL(0, "Setting input %d for unicable adapter %d", input, i); + } +} + @@ -108,7 +188,7 @@ index cd5d8f5..7af67d4 100644 void set_adapters_delsys(char *o) { diff --git a/adapter.h b/adapter.h -index 39d4d5f..2d19b7d 100644 +index 72f61c8..07268ba 100644 --- a/adapter.h +++ b/adapter.h @@ -6,7 +6,11 @@ @@ -132,7 +212,7 @@ index 39d4d5f..2d19b7d 100644 int pa, fn; // physical adapter, physical frontend number fe_delivery_system_t sys[MAX_DELSYS]; -@@ -85,6 +89,8 @@ typedef struct struct_adapter +@@ -86,6 +90,8 @@ typedef struct struct_adapter uint16_t strength, snr, max_strength, max_snr; uint32_t pid_err, dec_err; // detect pids received but not part of any stream, decrypt errors diseqc diseqc_param; @@ -141,7 +221,7 @@ index 39d4d5f..2d19b7d 100644 int old_diseqc; int old_hiband; int old_pol; -@@ -122,6 +128,7 @@ int update_pids(int aid); +@@ -123,6 +129,7 @@ int update_pids(int aid); int tune(int aid, int sid); SPid *find_pid(int aid, int p); adapter * get_adapter1(int aid, char *file, int line); @@ -149,16 +229,17 @@ index 39d4d5f..2d19b7d 100644 char *describe_adapter(int sid, int aid, char *dad, int ld); void dump_pids(int aid); void sort_pids(int aid); -@@ -131,6 +138,8 @@ void set_diseqc_adapters(char *o); +@@ -132,6 +139,9 @@ void set_diseqc_adapters(char *o); void set_diseqc_timing(char *o); void set_slave_adapters(char *o); void set_adapter_dmxsource(char *o); +void set_link_adapters(char *o); ++void set_absolute_src(char *o); +void set_unicable_input(char *o); void reset_pids_type(int aid, int clear_pat); void reset_ecm_type_for_key(int aid, int key); int delsys_match(adapter *ad, int del_sys); -@@ -143,6 +152,7 @@ void set_adapters_delsys(char *o); +@@ -145,6 +155,7 @@ void set_adapters_delsys(char *o); int signal_thread(sockets *s); #define get_adapter(a) get_adapter1(a, __FILE__, __LINE__) @@ -322,7 +403,7 @@ index 0000000..d8b06bc + +#endif diff --git a/dvb.c b/dvb.c -index 74124fc..8282a06 100644 +index f7f8b0f..fbcd22e 100644 --- a/dvb.c +++ b/dvb.c @@ -42,6 +42,11 @@ @@ -379,8 +460,8 @@ index 74124fc..8282a06 100644 if (ioctl(ad->dvr, DMX_SET_BUFFER_SIZE, opts.dvr_buffer) < 0) LOG("couldn't set DVR buffer size error %d: %s", errno, strerror(errno)) else -@@ -367,7 +387,7 @@ int dvb_open_device(adapter *ad) - LOG("Set DMX_SET_SOURCE for adapter %d to %d", ad->id, ad->dmx_source); +@@ -369,7 +389,7 @@ int dvb_open_device(adapter *ad) + ad->dmx_source); } - @@ -388,7 +469,7 @@ index 74124fc..8282a06 100644 return 0; } -@@ -393,6 +413,46 @@ void diseqc_cmd(int fd, int times, char *str, struct dvb_diseqc_master_cmd *cmd, +@@ -395,6 +415,46 @@ void diseqc_cmd(int fd, int times, char *str, struct dvb_diseqc_master_cmd *cmd, } @@ -435,7 +516,7 @@ index 74124fc..8282a06 100644 int send_diseqc(int fd, int pos, int pos_change, int pol, int hiband, diseqc *d) { int committed_no = d->committed_no; -@@ -428,6 +488,9 @@ int send_diseqc(int fd, int pos, int pos_change, int pol, int hiband, diseqc *d) +@@ -430,6 +490,9 @@ int send_diseqc(int fd, int pos, int pos_change, int pol, int hiband, diseqc *d) LOGL(3, "send_diseqc fd %d, pos = %d (c %d u %d), pol = %d, hiband = %d", fd, pos, posc, posu, pol, hiband); @@ -445,7 +526,7 @@ index 74124fc..8282a06 100644 if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) == -1) LOG("send_diseqc: FE_SET_TONE failed for fd %d: %s", fd, strerror(errno)); -@@ -490,6 +553,9 @@ int send_unicable(int fd, int freq, int pos, int pol, int hiband, diseqc *d) +@@ -492,6 +555,9 @@ int send_unicable(int fd, int freq, int pos, int pol, int hiband, diseqc *d) "send_unicable fd %d, freq %d, ufreq %d, pos = %d, pol = %d, hiband = %d, slot %d, diseqc => %02x %02x %02x %02x %02x", fd, freq, d->ufreq, pos, pol, hiband, d->uslot, cmd.msg[0], cmd.msg[1], cmd.msg[2], cmd.msg[3], cmd.msg[4]); @@ -455,7 +536,7 @@ index 74124fc..8282a06 100644 if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13) == -1) LOG("send_unicable: pre voltage SEC_VOLTAGE_13 failed for fd %d: %s", fd, strerror(errno)); -@@ -537,6 +603,9 @@ int send_jess(int fd, int freq, int pos, int pol, int hiband, diseqc *d) +@@ -539,6 +605,9 @@ int send_jess(int fd, int freq, int pos, int pol, int hiband, diseqc *d) fd, freq, d->ufreq, pos, pol, hiband, d->uslot, cmd.msg[0], cmd.msg[1], cmd.msg[2], cmd.msg[3], cmd.msg[4]); @@ -465,7 +546,7 @@ index 74124fc..8282a06 100644 if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13) == -1) LOG("send_jess: pre voltage SEC_VOLTAGE_13 failed for fd %d: %s", fd, strerror(errno)); -@@ -559,6 +628,39 @@ int send_jess(int fd, int freq, int pos, int pol, int hiband, diseqc *d) +@@ -561,6 +630,55 @@ int send_jess(int fd, int freq, int pos, int pol, int hiband, diseqc *d) return d->ufreq * 1000; } @@ -500,18 +581,34 @@ index 74124fc..8282a06 100644 + } + return ad; +} ++ ++int tune_check(adapter *ad, int pol, int hiband, int diseqc) ++{ ++ LOGL(3, "axe: tune check for adapter %d, pol %d/%d, hiband %d/%d, diseqc %d/%d", ++ ad->id, ad->old_pol, pol, ad->old_hiband, hiband, ad->old_diseqc, diseqc); ++ if (ad->old_pol != pol) ++ return 0; ++ if (ad->old_hiband != hiband) ++ return 0; ++ if (ad->old_diseqc != diseqc) ++ return 0; ++ return 1; ++} ++ ++int absolute_switch; ++int absolute_table[32][4]; +#endif + int setup_switch(int frontend_fd, adapter *ad, transponder *tp) { int hiband = 0; -@@ -582,15 +684,107 @@ int setup_switch(int frontend_fd, adapter *ad, transponder *tp) +@@ -584,15 +702,145 @@ int setup_switch(int frontend_fd, adapter *ad, transponder *tp) hiband = 1; } +#ifdef AXE + adapter *ad2, *adm; -+ int input = 0, aid, equattro = 0; ++ int input = 0, src, aid, pos = 0, equattro = 0, master = -1; + + if (tp->diseqc_param.switch_type != SWITCH_UNICABLE && + tp->diseqc_param.switch_type != SWITCH_JESS) { @@ -519,31 +616,68 @@ index 74124fc..8282a06 100644 + if (!opts.quattro || extra_quattro(input, diseqc, &equattro)) { + if (equattro > 0) + diseqc = equattro - 1; -+ adm = use_adapter(ad->slave ? ad->slave - 1 : ad->pa); -+ if (adm == NULL) { -+ LOG("axe_fe: unknown master adapter %d", input); -+ return 0; -+ } -+ if (adm->old_pol >= 0) { ++ if (absolute_switch && diseqc >= 0 && diseqc < 32) { ++ /* reuse input */ + for (aid = 0; aid < 4; aid++) { -+ ad2 = get_adapter(aid); -+ if (!ad2 || ad == ad2) continue; -+ if (ad2->slave && ad2->slave - 1 != adm->pa) continue; -+ if (!ad2->slave && ad2 != adm) continue; -+ if (ad2->sid_cnt > 0) break; ++ pos = absolute_table[diseqc][aid]; ++ if (pos <= 0) continue; ++ pos--; ++ ad2 = get_adapter2(aid); ++ if (!ad2) continue; ++ if (ad2->fe2 <= 0) continue; ++ if ((ad2->axe_used & ~(1 << ad->id)) == 0) continue; ++ if (!tune_check(ad2, pol, hiband, pos)) continue; ++ break; + } -+ if (adm != ad && aid < 4 && -+ (adm->old_pol != pol || -+ adm->old_hiband != hiband || -+ adm->old_diseqc != diseqc)) ++ /* find free input */ ++ if (aid >= 4) { ++ for (aid = 0; aid < 4; aid++) { ++ pos = absolute_table[diseqc][aid]; ++ if (pos <= 0) continue; ++ pos--; ++ ad2 = get_adapter2(aid); ++ if (!ad2) continue; ++ LOGL(3, "axe: checking %d used 0x%x in %d", ad->id, ad2->axe_used, ad2->id); ++ if (ad2->axe_used & ~(1 << ad->id)) continue; ++ break; ++ } ++ } ++ if (aid >= 4) { ++ LOGL(0, "unable to find input for diseqc %d (absolute switch), adapter %d", diseqc, input); + return 0; ++ } ++ diseqc = pos; ++ master = aid; ++ adm = use_adapter(master); ++ if (adm == NULL) { ++ LOG("axe_fe: unknown master adapter for input %d", input); ++ return 0; ++ } ++ } else { ++ master = ad->slave ? ad->slave - 1 : ad->pa; ++ adm = use_adapter(master); ++ if (adm == NULL) { ++ LOG("axe_fe: unknown master adapter for input %d", input); ++ return 0; ++ } ++ if (adm->old_pol >= 0) { ++ for (aid = 0; aid < 4; aid++) { ++ ad2 = get_adapter2(aid); ++ if (!ad2 || ad2->fe2 <= 0 || ad == ad2) continue; ++ if (ad2->slave && ad2->slave - 1 != adm->pa) continue; ++ if (!ad2->slave && ad2 != adm) continue; ++ if (ad2->sid_cnt > 0) break; ++ } ++ if (adm != ad && aid < 4 && !tune_check(adm, pol, hiband, diseqc)) { ++ LOGL(0, "unable to use slave adapter %d (master %d)", input, adm->pa); ++ return 0; ++ } ++ } + } -+ adm->axe_used |= (1 << input); -+ if (ad->slave) { -+ input = ad->slave - 1; -+ if(adm->old_pol != pol || -+ adm->old_hiband != hiband || -+ adm->old_diseqc != diseqc) { ++ adm->axe_used |= (1 << ad->id); ++ if (master >= 0) { ++ input = master; ++ if (!tune_check(adm, pol, hiband, diseqc)) { + send_diseqc(adm->fe2, diseqc, adm->old_diseqc != diseqc, + pol, hiband, &tp->diseqc_param); + adm->old_pol = pol; @@ -567,12 +701,13 @@ index 74124fc..8282a06 100644 + LOG("axe_fe: unknown master adapter %d", input); + return 0; + } -+ if(adm->old_pol != pol || adm->old_hiband != hiband) { ++ adm->old_diseqc = diseqc = 0; ++ if(!tune_check(adm, pol, hiband, 0)) { + send_diseqc(adm->fe2, 0, 0, pol, hiband, + &tp->diseqc_param); + adm->old_pol = pol; + adm->old_hiband = hiband; -+ adm->old_diseqc = diseqc = 0; ++ adm->old_diseqc = 0; + } + adm->axe_used |= (1 << ad->id); + goto axe; @@ -617,13 +752,19 @@ index 74124fc..8282a06 100644 } else if (tp->diseqc_param.switch_type == SWITCH_SLAVE) { -@@ -609,6 +803,17 @@ int setup_switch(int frontend_fd, adapter *ad, transponder *tp) - diseqc); - } +@@ -615,6 +863,23 @@ int setup_switch(int frontend_fd, adapter *ad, transponder *tp) + ad->old_hiband = hiband; + ad->old_diseqc = diseqc; +#ifdef AXE +axe: -+ LOGL(3, "axe_fe: reset for fd %d adapter %d input %d", frontend_fd, ad ? ad->pa : -1, input); ++ for (aid = 0; aid < 4; aid++) { ++ ad2 = get_adapter2(aid); ++ if (ad2) ++ LOGL(3, "axe_fe: used[%d] = 0x%x, pol=%d, hiband=%d, diseqc=%d", ++ aid, ad2->axe_used, ad2->old_pol, ad2->old_hiband, ad2->old_diseqc); ++ } ++ LOGL(3, "axe_fe: reset for fd %d adapter %d input %d diseqc %d", frontend_fd, ad ? ad->pa : -1, input, diseqc); + if (axe_fe_reset(frontend_fd) < 0) + LOG("axe_fe: RESET failed for fd %d: %s", frontend_fd, strerror(errno)); + if (axe_fe_input(frontend_fd, input)) @@ -632,10 +773,10 @@ index 74124fc..8282a06 100644 + return freq; +#endif + - ad->old_pol = pol; - ad->old_hiband = hiband; - ad->old_diseqc = diseqc; -@@ -644,6 +849,14 @@ int dvb_tune(int aid, transponder * tp) + return freq; + } + +@@ -647,6 +912,14 @@ int dvb_tune(int aid, transponder * tp) memset(p_cmd, 0, sizeof(p_cmd)); bclear = getTick(); @@ -650,7 +791,7 @@ index 74124fc..8282a06 100644 if ((ioctl(fd_frontend, FE_SET_PROPERTY, &cmdseq_clear)) == -1) { LOG("FE_SET_PROPERTY DTV_CLEAR failed for fd %d: %s", fd_frontend, -@@ -663,8 +876,10 @@ int dvb_tune(int aid, transponder * tp) +@@ -666,8 +939,10 @@ int dvb_tune(int aid, transponder * tp) ADD_PROP(DTV_SYMBOL_RATE, tp->sr) ADD_PROP(DTV_INNER_FEC, tp->fec) @@ -661,8 +802,8 @@ index 74124fc..8282a06 100644 #if DVBAPIVERSION >= 0x0502 ADD_PROP(DTV_STREAM_ID, tp->plp) #endif -@@ -673,7 +888,12 @@ int dvb_tune(int aid, transponder * tp) - "tuning to %d(%d) pol: %s (%d) sr:%d fec:%s delsys:%s mod:%s rolloff:%s pilot:%s, ts clear=%d, ts pol=%d", +@@ -676,7 +951,12 @@ int dvb_tune(int aid, transponder * tp) + "tuning to %d(%d) pol: %s (%d) sr:%d fec:%s delsys:%s mod:%s rolloff:%s pilot:%s, ts clear=%jd, ts pol=%jd", tp->freq, freq, get_pol(tp->pol), tp->pol, tp->sr, fe_fec[tp->fec], fe_delsys[tp->sys], fe_modulation[tp->mtype], - fe_rolloff[tp->ro], fe_pilot[tp->plts], bclear, bpol) @@ -675,7 +816,7 @@ index 74124fc..8282a06 100644 break; case SYS_DVBT: -@@ -774,29 +994,46 @@ int dvb_tune(int aid, transponder * tp) +@@ -777,29 +1057,46 @@ int dvb_tune(int aid, transponder * tp) if (ioctl(fd_frontend, FE_SET_PROPERTY, &p) == -1) { LOG("dvb_tune: set property failed %d %s", errno, strerror(errno)); @@ -727,7 +868,7 @@ index 74124fc..8282a06 100644 return -1; } -@@ -822,10 +1059,22 @@ int dvb_set_pid(adapter *a, uint16_t i_pid) +@@ -825,10 +1122,22 @@ int dvb_set_pid(adapter *a, uint16_t i_pid) LOG("setting filter on PID %d for fd %d", i_pid, fd); return fd; @@ -750,7 +891,7 @@ index 74124fc..8282a06 100644 if (fd < 0) LOG_AND_RETURN(0, "DMX_STOP on an invalid handle %d, pid %d", fd, pid); if (ioctl(fd, DMX_STOP, NULL) < 0) -@@ -834,10 +1083,20 @@ int dvb_del_filters(int fd, int pid) +@@ -837,10 +1146,20 @@ int dvb_del_filters(int fd, int pid) LOG("clearing filter on PID %d FD %d", pid, fd); close(fd); return 0; @@ -771,7 +912,7 @@ index 74124fc..8282a06 100644 int i, res, rv = 0; struct dvb_frontend_info fe_info; -@@ -926,6 +1185,7 @@ fe_delivery_system_t dvb_delsys(int aid, int fd, fe_delivery_system_t *sys) +@@ -929,6 +1248,7 @@ fe_delivery_system_t dvb_delsys(int aid, int fd, fe_delivery_system_t *sys) fe_delsys[sys[i]], sys[i]); return (fe_delivery_system_t) rv; @@ -779,30 +920,30 @@ index 74124fc..8282a06 100644 } -@@ -1037,6 +1297,7 @@ void dvb_get_signal(adapter *ad) - ad->max_strength = (ad->strength > 0) ? ad->strength : 1; - if (ad->max_snr <= ad->snr) - ad->max_snr = (ad->snr > 0) ? ad->snr : 1; +@@ -1041,6 +1361,7 @@ void dvb_get_signal(adapter *ad) + ad->max_strength = (strength > 0) ? strength : 1; + if (ad->max_snr <= snr) + ad->max_snr = (snr > 0) ? snr : 1; +#ifndef AXE - if (ad->snr > 4096) + if (snr > 4096) new_gs = 0; if (new_gs) -@@ -1049,6 +1310,14 @@ void dvb_get_signal(adapter *ad) - ad->strength = ad->strength >> 8; - ad->snr = ad->snr >> 8; +@@ -1053,6 +1374,14 @@ void dvb_get_signal(adapter *ad) + strength = strength >> 8; + snr = snr >> 8; } +#else -+ ad->strength = ad->strength * 240 / 24000; -+ if (ad->strength > 240) -+ ad->strength = 240; -+ ad->snr = ad->snr * 15 / 54000; -+ if (ad->snr > 15) -+ ad->snr = 15; ++ strength = strength * 240 / 24000; ++ if (strength > 240) ++ strength = 240; ++ snr = snr * 15 / 54000; ++ if (snr > 15) ++ snr = 15; +#endif - } - - void dvb_commit(adapter *a) -@@ -1056,12 +1325,51 @@ void dvb_commit(adapter *a) + // keep the assignment at the end for the signal thread to get the right values as no locking is done on the adapter + ad->snr = snr; + ad->strength = strength; +@@ -1065,12 +1394,51 @@ void dvb_commit(adapter *a) return; } @@ -856,7 +997,7 @@ index 74124fc..8282a06 100644 } void find_dvb_adapter(adapter **a) -@@ -1072,9 +1380,21 @@ void find_dvb_adapter(adapter **a) +@@ -1081,9 +1449,21 @@ void find_dvb_adapter(adapter **a) int i = 0, j = 0; adapter *ad; @@ -878,7 +1019,7 @@ index 74124fc..8282a06 100644 sprintf(buf, "/dev/dvb/adapter%d/frontend%d", i, j); fd = open(buf, O_RDONLY | O_NONBLOCK); if (fd < 0) -@@ -1082,7 +1402,8 @@ void find_dvb_adapter(adapter **a) +@@ -1091,7 +1471,8 @@ void find_dvb_adapter(adapter **a) sprintf(buf, "/dev/dvb/adapter%d/ca%d", i, j); fd = open(buf, O_RDONLY | O_NONBLOCK); } @@ -888,7 +1029,7 @@ index 74124fc..8282a06 100644 if (fd >= 0) { // if (is_adapter_disabled(na)) -@@ -1113,6 +1434,14 @@ void find_dvb_adapter(adapter **a) +@@ -1122,6 +1503,14 @@ void find_dvb_adapter(adapter **a) if (na == MAX_ADAPTERS) return; } @@ -903,61 +1044,17 @@ index 74124fc..8282a06 100644 } for (; na < MAX_ADAPTERS; na++) if (a[na]) -diff --git a/html/status.html b/html/status.html -index 15dc0fa..01fe57f 100644 ---- a/html/status.html -+++ b/html/status.html -@@ -16,6 +16,10 @@ - font-family: Tahoma, Geneva, sans-serif; - font-size: 1em; - } -+ .level { -+ display: inline; -+ white-space: nowrap; -+ } - /* - .enabled { - color: green; -@@ -33,12 +37,8 @@ - - - --This page will refresh every 5 seconds.
- -