Hi!
Now that I have a spare DVB-S2 tuner (TechniSat SkyStar USB HD (adapter2); the others on this box are atm Hauppauge Nova-TD model 1172 (adapter 0+1) and TechnoTrend S2-3600 (adapter3) - all USB) I decided to play with vdr device bonding. I discovered three things: (still using vdr 1.7.29, I know I should upgrade... :)
1. The LNB setup OSD menu causes bonding to fail (it's trying to bond a DVB-T tuner) if I set the two DVB-S2 tuners as "connected to sat cable 1"; it works with "sat cable 2". Maybe it somehow thinks of (one of?) the DVB-T tuner(s) as cable 1 too?
2. The infosatepg plugin doesn't check MaySwitchTransponder() and thus grabs a bonded device when it shouldn't, I just patched that in the FreeBSD port: (plugin maintainer Cc'd)
http://svnweb.freebsd.org/ports/head/multimedia/vdr-plugin-infosatepg/files/...
3. Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } } - else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) + else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) { + bondMutex.Unlock(); BondedMaster->SetChannel(Channel); + } } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel)) @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (GetBondedMaster() != this) { +#if 1 + if (bondedTuner && !bondedMaster) +#else + if (GetBondedMaster() != this) +#endif + { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Thanx, Juergen
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (GetBondedMaster() != this) { +#if 1 + if (bondedTuner && !bondedMaster) +#else + if (GetBondedMaster() != this) +#endif + { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, Juergen
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Stupid typos... Juergen
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) { - if (GetBondedMaster() == this) { + if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false; @@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (GetBondedMaster() != this) { + if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Klaus
On 19.02.2013 11:19, Klaus Schmidinger wrote:
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, that was a mistake. Try this one, please:
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) { - if (GetBondedMaster() == this) { + if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false; @@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (GetBondedMaster() != this) { + if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Klaus
In article 51235356.60901@tvdr.de you write:
On 19.02.2013 11:19, Klaus Schmidinger wrote:
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, that was a mistake. Try this one, please:
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Yeah that's the same as I had it (other than that I ignored the diseqc case), so it should work (testing now.)
Thanx! :) Juergen
On 19.02.2013 21:32, Juergen Lock wrote:
In article 51235356.60901@tvdr.de you write:
On 19.02.2013 11:19, Klaus Schmidinger wrote:
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote:
Hi!
[...]
- Running with these four tuners (dual DVB-T and the bonded two DVB-S2) I get two different deadlocks waiting for cDvbTuner::bondMutex after live viewing a DVB-T(!) channel for longer (OSD doesn't react anymore and attaching gdb reveals two threads waiting for bondMutex) - the following two changes make it work but there probably is a better fix: (patch may apply with offsets; one of the problems I think is a lock order reversal with cDvbTuner::mutex and bondMutex when cDvbTuner::SetChannel calls back into itself with bondMutex held.)
--- dvbdevice.c.orig +++ dvbdevice.c @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne t->SetChannel(NULL); } }
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0)
else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) {
bondMutex.Unlock(); BondedMaster->SetChannel(Channel);
} } cMutexLock MutexLock(&mutex); if (!IsTunedTo(Channel))
@@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, that was a mistake. Try this one, please:
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Yeah that's the same as I had it
Absolutely! I thought it would work in a simpler manner, but I was wrong. Didn't mean to "steal" your idea ;-).
(other than that I ignored the diseqc case), so it should work (testing now.)
I just systematically replaced all calls to GetBondedMaster() that were just checks with the appropriate use of bondedTuner and bondedMaster. Maybe I'll even put this into a function
bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; }
Klaus
In article 5123EAD9.7050808@tvdr.de you write:
On 19.02.2013 21:32, Juergen Lock wrote:
In article 51235356.60901@tvdr.de you write:
On 19.02.2013 11:19, Klaus Schmidinger wrote:
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote:
On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote: > Hi! > > [...]
> 3. Running with these four tuners (dual DVB-T and the bonded two DVB-S2) > I get two different deadlocks waiting for cDvbTuner::bondMutex > after live viewing a DVB-T(!) channel for longer (OSD doesn't > react anymore and attaching gdb reveals two threads waiting for > bondMutex) - the following two changes make it work but there > probably is a better fix: (patch may apply with offsets; one > of the problems I think is a lock order reversal with cDvbTuner::mutex > and bondMutex when cDvbTuner::SetChannel calls back into itself > with bondMutex held.) > > --- dvbdevice.c.orig > +++ dvbdevice.c > @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne > t->SetChannel(NULL); > } > } > - else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) > + else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) { > + bondMutex.Unlock(); > BondedMaster->SetChannel(Channel); > + } > } > cMutexLock MutexLock(&mutex); > if (!IsTunedTo(Channel)) > @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) > tone = SEC_TONE_ON; > } > int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; > - if (GetBondedMaster() != this) { > +#if 1 > + if (bondedTuner && !bondedMaster) > +#else > + if (GetBondedMaster() != this) > +#endif > + { > tone = SEC_TONE_OFF; > volt = SEC_VOLTAGE_13; > } >
Hmm looks like I posted too soon, the first hunk is actually too much and causes other deadlocks (like when trying to play a DVB-S channel via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
becomes:
--- dvbdevice.c.orig +++ dvbdevice.c @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
+#if 1
if (bondedTuner && !bondedMaster)
+#else
if (GetBondedMaster() != this)
+#endif
{ tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, that was a mistake. Try this one, please:
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Yeah that's the same as I had it
Absolutely! I thought it would work in a simpler manner, but I was wrong. Didn't mean to "steal" your idea ;-).
(other than that I ignored the diseqc case), so it should work (testing now.)
I just systematically replaced all calls to GetBondedMaster() that were just checks with the appropriate use of bondedTuner and bondedMaster. Maybe I'll even put this into a function
bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; }
Hmm were these the only two places that were just these checks or were there more? If there were other places too then in those cases the master may not be determined yet...
Just thinking, :) Juergen
On 19.02.2013 23:14, Juergen Lock wrote:
In article 5123EAD9.7050808@tvdr.de you write:
On 19.02.2013 21:32, Juergen Lock wrote:
In article 51235356.60901@tvdr.de you write:
On 19.02.2013 11:19, Klaus Schmidinger wrote:
On 18.02.2013 23:51, Juergen Lock wrote:
On Sun, Feb 17, 2013 at 04:34:25PM +0100, Juergen Lock wrote: > On Sat, Feb 16, 2013 at 04:46:36PM +0100, Juergen Lock wrote: >> Hi! >> >> [...] > >> 3. Running with these four tuners (dual DVB-T and the bonded two DVB-S2) >> I get two different deadlocks waiting for cDvbTuner::bondMutex >> after live viewing a DVB-T(!) channel for longer (OSD doesn't >> react anymore and attaching gdb reveals two threads waiting for >> bondMutex) - the following two changes make it work but there >> probably is a better fix: (patch may apply with offsets; one >> of the problems I think is a lock order reversal with cDvbTuner::mutex >> and bondMutex when cDvbTuner::SetChannel calls back into itself >> with bondMutex held.) >> >> --- dvbdevice.c.orig >> +++ dvbdevice.c >> @@ -476,8 +476,10 @@ void cDvbTuner::SetChannel(const cChanne >> t->SetChannel(NULL); >> } >> } >> - else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) >> + else if (strcmp(GetBondingParams(Channel), BondedMaster->GetBondingParams()) != 0) { >> + bondMutex.Unlock(); >> BondedMaster->SetChannel(Channel); >> + } >> } >> cMutexLock MutexLock(&mutex); >> if (!IsTunedTo(Channel)) >> @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) >> tone = SEC_TONE_ON; >> } >> int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; >> - if (GetBondedMaster() != this) { >> +#if 1 >> + if (bondedTuner && !bondedMaster) >> +#else >> + if (GetBondedMaster() != this) >> +#endif >> + { >> tone = SEC_TONE_OFF; >> volt = SEC_VOLTAGE_13; >> } >> > > Hmm looks like I posted too soon, the first hunk is actually too much > and causes other deadlocks (like when trying to play a DVB-S channel > via streamdev while live viewing another), so the patch I'm not testing
.. I'm _now_ testing...
> becomes: > > --- dvbdevice.c.orig > +++ dvbdevice.c > @@ -761,7 +773,12 @@ bool cDvbTuner::SetFrontend(void) > tone = SEC_TONE_ON; > } > int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; > - if (GetBondedMaster() != this) { > +#if 1 > + if (bondedTuner && !bondedMaster) > +#else > + if (GetBondedMaster() != this) > +#endif > + { > tone = SEC_TONE_OFF; > volt = SEC_VOLTAGE_13; > } >
Can you please test whether this one works just as well?
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:18:08 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (!bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Sorry, that was a mistake. Try this one, please:
--- dvbdevice.c 2013/02/17 13:17:33 2.80 +++ dvbdevice.c 2013/02/19 10:24:39 @@ -742,7 +742,7 @@ if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, channel.Source(), frequency, dtp.Polarization(), &scr)) { frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr()) {
if (GetBondedMaster() == this) {
if (!bondedTuner || bondedMaster) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false;
@@ -768,7 +768,7 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
if (GetBondedMaster() != this) {
if (bondedTuner && !bondedMaster) { tone = SEC_TONE_OFF; volt = SEC_VOLTAGE_13; }
Yeah that's the same as I had it
Absolutely! I thought it would work in a simpler manner, but I was wrong. Didn't mean to "steal" your idea ;-).
(other than that I ignored the diseqc case), so it should work (testing now.)
I just systematically replaced all calls to GetBondedMaster() that were just checks with the appropriate use of bondedTuner and bondedMaster. Maybe I'll even put this into a function
bool IsBondedMaster(void) const { return !bondedTuner || bondedMaster; }
Hmm were these the only two places that were just these checks or were there more? If there were other places too then in those cases the master may not be determined yet...
Yes, those were the only two places where this function was called purely to check whether this is the master. I've even made GetBondedMaster() private within cDvbTuner now. It is called from cDvbTuner::SetChannel(), which should be enough.
Klaus
On 16.02.2013 16:46, Juergen Lock wrote:
Hi!
Now that I have a spare DVB-S2 tuner (TechniSat SkyStar USB HD (adapter2); the others on this box are atm Hauppauge Nova-TD model 1172 (adapter 0+1) and TechnoTrend S2-3600 (adapter3) - all USB) I decided to play with vdr device bonding. I discovered three things: (still using vdr 1.7.29, I know I should upgrade... :)
- The LNB setup OSD menu causes bonding to fail (it's trying to bond a DVB-T tuner) if I set the two DVB-S2 tuners as "connected to sat cable 1"; it works with "sat cable 2". Maybe it somehow thinks of (one of?) the DVB-T tuner(s) as cable 1 too?
What does the "Setup/LNB" menu look like on your system? Does it list only the two DVB-S devices, or all four of them? Which device numbers does it display?
What does the "DeviceBondings = ..." line in setup.conf look like in both cases (working/not working)?
You wrote that your DVB-S2 device is "adapter2". Does this mean it is actually "adaper2/frontend0" and "adapter2/frontend1"?
Have you appliead any patches to VDR? If so, what happens without them? Same for plugins.
Klaus
In article 5121FBA4.2050108@tvdr.de you write:
On 16.02.2013 16:46, Juergen Lock wrote:
Hi!
Now that I have a spare DVB-S2 tuner (TechniSat SkyStar USB HD (adapter2); the others on this box are atm Hauppauge Nova-TD model 1172 (adapter 0+1) and TechnoTrend S2-3600 (adapter3) - all USB) I decided to play with vdr device bonding. I discovered three things: (still using vdr 1.7.29, I know I should upgrade... :)
- The LNB setup OSD menu causes bonding to fail (it's trying to bond a DVB-T tuner) if I set the two DVB-S2 tuners as "connected to sat cable 1"; it works with "sat cable 2". Maybe it somehow thinks of (one of?) the DVB-T tuner(s) as cable 1 too?
What does the "Setup/LNB" menu look like on your system? Does it list only the two DVB-S devices, or all four of them? Which device numbers does it display?
What does the "DeviceBondings = ..." line in setup.conf look like in both cases (working/not working)?
working:
Einstellungen - LNB
DiSEqC benutzen: nein SLOF (MHz): 11700 Untere LNB-Frequenz (MHz): 9750 Obere LNB-Frequenz (MHz): 10600 Device 3 angeschlossen an Sat-Kabel: 2 Device 4 angeschlossen an Sat-Kabel: 2
-> DeviceBondings = 1 0 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
broken:
Einstellungen - LNB
DiSEqC benutzen: nein SLOF (MHz): 11700 Untere LNB-Frequenz (MHz): 9750 Obere LNB-Frequenz (MHz): 10600 Device 3 angeschlossen an Sat-Kabel: 1 Device 4 angeschlossen an Sat-Kabel: 1
-> DeviceBondings = 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
You wrote that your DVB-S2 device is "adapter2". Does this mean it is actually "adaper2/frontend0" and "adapter2/frontend1"?
No the other DVB-S2 tuner is adapter3 (TechnoTrend S2-3600), all four only have frontend0 no frontend1.
Have you appliead any patches to VDR?
Currently the two patches belonging to the iptv and ttxtsubs plugins and my stb0899 signal strength patch, and of course the FreeBSD portability patches.
If so, what happens without them?
I will have to check that later tho I guess they are unrelated...
Same for plugins.
I just started vdr with just the xineliboutput plugin (I don't have an ff card) and got the same
DeviceBondings = 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
when setting both DVB-S2 tuners as ".. connected to sat cable 1".
I wonder, could this be a result of me running vdr with only the DVB-S2 tuners once and the first 1 in DeviceBondings that I may have set then simply doesn't get reset when the first two tuners became DVB-T?
Klaus
Thanx! Juergen