Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: [ANNOUNCE] bitstreamout plugin 0.61 (sound loop throughsound card)



Dr. Werner Fink wrote:

Please remove _all_ occurence of LOCK_THREAD within the sources
of bitstreamout sources and the occurence of HOLD(thread) within
spdif.c of bitstreamout.

Werner


Werner,

I am not a programmer but I am familiar with mcedit ;-), so I did it in 2 steps:

1) Just commenting out the appropriate _lines_ with //
a) LOCK_THREAD (found in channels.c and replay.c)
b) HOLD(thread) in spdif.c

Test: same problem is still there

2) commenting out everything "around" LOCK_THREAD or HOLD(thread)
(see below please, just to be sure it is alright)

Test: There is tone on the startup channel. Switching is possible, sound dis-
appears on first switch (bitstreamout seems to die?). Shutting down vdr stops
somewhere in the process. Bufferoverflows appear.

CU Norbert

The log for case 2)
==========================================================================================================
Jun 10 16:44:19 amd64 vdr[8134]: bso(instream): Forwarding bitstream thread started (pid=8134, tid=114696)
== here I get sound (no matter wether this channel is pcm or ac3)
Jun 10 16:44:21 amd64 vdr[8129]: CAM: Irdeto SE , 01, 06FF, 06FF
Jun 10 16:44:55 amd64 vdr[8127]: channel 4 (RTL,RTL Television) event 16:45 'Dirty Dancing' status 4
Jun 10 16:45:03 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:03 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:04 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:05 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:05 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:05 amd64 vdr[8133]: Bufferoverlow
Jun 10 16:45:05 amd64 vdr[8123]: switching to channel 10
Jun 10 16:45:05 amd64 vdr[8133]: receiver on device 1 thread ended (pid=8133, tid=98311)
Jun 10 16:45:07 amd64 vdr[8123]: INSTREAM: Forwarding bitstream thread was broken
Jun 10 16:45:07 amd64 vdr[8230]: receiver on device 1 thread started (pid=8230, tid=131079)
== here I can continue switching, but without sound
Jun 10 16:45:20 amd64 vdr[8123]: caught signal 2
Jun 10 16:45:20 amd64 vdr[8123]: saved setup to /etc/vdr/dev//setup.conf
Jun 10 16:45:20 amd64 vdr[8126]: tuner on device 1 thread ended (pid=8126, tid=16386)
Jun 10 16:45:20 amd64 vdr[8230]: receiver on device 1 thread ended (pid=8230, tid=131079)
Jun 10 16:45:20 amd64 vdr[8127]: Section handler thread ended (pid=8127, tid=32771)
Jun 10 16:45:20 amd64 vdr[8129]: tuner on device 2 thread ended (pid=8129, tid=49156)
Jun 10 16:45:21 amd64 vdr[8130]: Section handler thread ended (pid=8130, tid=65541)
Jun 10 16:45:21 amd64 vdr[8123]: stopping plugin: bitstreamout
== here the vdr shutdown stops


==============================================================================
=== channels.c - LOCK_THREAD
==============================================================================

if (test_flag(RUNNING) || Active()) {
esyslog("INSTREAM: Forwarding bitstream thread was broken");
usleep(1000);
// if (stream) { // thread broken
// LOCK_THREAD;
// spdifDev->Close();
// clear_flag(BOUNDARY);
// stream->Reset();
// bounce->leaveio();
// }
clear_flag(RUNNING); // Should not happen
}

=====================================================================

if (test_setup(MUTE)) {
// if (!test_flag(WASMUTED)) {
// LOCK_THREAD;
// spdifDev->Clear();
// clear_flag(BOUNDARY);
// bounce->flush();
// tmp->Clear();
// }
set_flag(WASMUTED);
}

if (!spdifDev->Synchronize(bounce)) // Wait on bounce->signal()
break;

if (!test_flag(ACTIVE)) {
debug_chl("%s %d\n", __FUNCTION__, __LINE__);
break;
}

if (test_setup(MUTE)) {
// if (!test_flag(WASMUTED)) {
// LOCK_THREAD;
// spdifDev->Clear();
// clear_flag(BOUNDARY);
// bounce->flush();
// tmp->Clear();
// }
set_flag(WASMUTED);
continue;
}

==============================================================================
=== replay.c - LOCK_THREAD
==============================================================================

while (test_flag(ACTIVE)) {
ssize_t len;

if (test_setup(MUTE)) {
// if (!test_flag(WASMUTED)) {
// LOCK_THREAD;
// spdifDev->Clear();
// clear_flag(BOUNDARY);
// bounce->flush();
// tmp->Clear();
// }
set_flag(WASMUTED);
}

if (!spdifDev->Synchronize(bounce)) // Wait on bounce->signal()
break;

if (!test_flag(ACTIVE))
break;

if (test_setup(MUTE)) {
// if (!test_flag(WASMUTED)) {
// LOCK_THREAD;
// spdifDev->Clear();
// clear_flag(BOUNDARY);
// bounce->flush();
// tmp->Clear();
// }
set_flag(WASMUTED);
continue;
}

if ((len = bounce->fetch(pesdata, spdifDev->Available(TRANSFER_MEM))))
spdifDev->Forward(pesdata, len, bounce);

}

=================================================================================

void cReplayOutSPDif::Mute(bool onoff)
{
debug("cReplayOutSPDif::Mute(%d) called\n", onoff);
if ((test_setup(MUTE) ? true : false) == onoff)
goto out;

clear_setup(STILLPIC);
// if (onoff) {
// cDevice *PrimaryDevice = cDevice::PrimaryDevice();
// LOCK_THREAD;
// iec60958* tmp = stream;
//
// set_setup(MUTE);
// if (PrimaryDevice && !PrimaryDevice->IsMute())
// set_setup(STILLPIC);
// spdifDev->Pause(onoff);
// if (tmp)
// tmp->Clear();
// bounce->flush();
// bounce->signal();
// clear_flag(BOUNDARY);
// } else
clear_setup(MUTE);
out:
if (SPDIFmute) { // Normal TV mode
char *cmd = NULL;
asprintf(&cmd, "%s %s 2> /dev/null", SPDIFmute, test_setup(MUTE) ? "mute" : "unmute");
if (cmd) {
if (test_setup(MP2ENABLE) && test_setup(ACTIVE))
setenv("loop", "off", 1);
else
setenv("loop", "on", 1);
system(cmd);
free(cmd);
cmd = NULL;
}
}
return;
}

void cReplayOutSPDif::Clear(void)
{
cDevice *PrimaryDevice = cDevice::PrimaryDevice();

debug("cReplayOutSPDif::Clear() called\n");
(void)Activate(false);
// {
// LOCK_THREAD;
// stream = NULL;
// bounce->flush();
// bounce->signal();
// clear_flag(BOUNDARY);
// clear_setup(STILLPIC);
// }
if (PrimaryDevice)
Mute(PrimaryDevice->IsMute());
}

==============================================================================
=== spdif.c - HOLD(thread)
==============================================================================

// if (caller)
// thread = caller;
// HOLD(thread); // Thread locking





Home | Main Index | Thread Index