Skip to main content

RI 1.2 is not proceeding with the recording even though the free space is available in the MSV

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
5 replies [Last post]
srinivasrk
Offline
Joined: 2011-10-31

Scenario:
I have created an MSV of size 15MB. Started a recording of duration 5 minutes on the MSV. I have stopped the recording by using LeafRecordingRequest.stop() API after 34 seconds. Still the MSV has free space of 47%. Waited for 1 second. Then started new recording on the same service with duration just 5 seconds. This recording goes to IN_PROGRESS_INSUFFICIENT_STATE and then immediately transitions to IN_PROGRESS_WITH_ERROR_STATE with reason SPACE_FULL. After the stop spec has been called, transitioned to FAILED_STATE.

Expected:
The MSV has 47% of it's space free. It should accomodate the recording, and the recording should be in COMPLETED_STATE after the it is completed.

Issue found:
When the first recording starts, a new TSB and a new recording file will be created whose initial sizes are 0. While TSB conversion is going on, the callback method for TSB conversion is checking for the condition "required space to append the current chunk of recording content should be less than available space". Here the required space is being calculated by subtracting the recording file size from TSB size. (required space = TSB size - current recording file size). This works fine for the first recording.
When we start the second recording it will use the same TSB again whose initial size is not zero and creates new recording file (size 0). Now in the callback method the requred space (TSB size - current recording file size) is greater than the free space available in the MSV because of huge TSB size (The delta will be huge). So the recording goes to IN_PROGRESS_WITH_ERROR_STATE with reason SPACE_FULL. Actually, the MSV is capable of accomodating the complete new recording but due to this calculation the recording is failing.

This is observed in both RI 1.2 and RI 1.1.4. Can anyone clarify me on this whether it is an issue or expected?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
greg80303
Offline
Joined: 2008-07-03

Can you point me to the code that does this calculation:

(required space = TSB size - current recording file size)

Thanks,

G

srinivasrk
Offline
Joined: 2011-10-31

Hi greg,

tsbConversionStateStarting & tsbConversionStateActive functions in tsb.c are sending RI_DVR_EVENT_TSB_CONVERSION_STATUS events to callback function i.e convert_event_cb in mpeos_dvr.c.

As part of event data they are sending TSB size to callback function. It is being calculated in both tsbConversionStateStartingfunction & tsbConversionStateActive from tsb.c like below:

pTsbItem->pTsb->conversion_status.size = pIfsHandleInfo->mpegSize + pIfsHandleInfo->ndexSize;

In the callback funtion i.e convert_event_cb in mpeos_dvr.c, there is a condition to check whether space is sufficient or not:

if (updateDiskUsage(rec->volume, rec->volume->device, status->size - info.size))

Here status->size is same as pTsbItem->pTsb->conversion_status.size sent from tsb.c functions. info.size is current recording file size.

I suppose, the calculation of pTsbItem->pTsb->conversion_status.size should be changed in tsb.c to:

pTsbItem->pTsb->conversion_status.size = pTsbItem->pTsb->ifsConvHandle->mpegSize + pTsbItem->pTsb->ifsConvHandle->ndexSize;

Thanks,

Kurma Srinivas

srinivasrk
Offline
Joined: 2011-10-31

Hi Greg,

Any update on this?

smaynard
Offline
Joined: 2009-01-27

This looks like a valid bug - please enter it into the bug database and we'll make the appropriate correction(s)...

Thanks

srinivasrk
Offline
Joined: 2011-10-31

Hi,

I have raised an IT (IT580) for this.