SGI: Video

O2 dmrecord error - Page 1

Hi!

So I finally have an O2 video modul and started playing with dmrecord this evening.

I hooked up my Digital8 camera via Composite video.
Code:
dmrecord -p audio test.mv
seemed to work beautifully until I tried to capture longer than around a minute or so.

Got this error:
Code:
VL: Resource temporarily not available.
vlDMBufferGetValid (video server, video.path, video.drain, &buf) failed in file capture.c line 754
dmICReceive(video.ic ,&buffer) failed in file capture.c, line 1268
DM error Compress failed : hardware timeout


There is a topic about a similar error in the forum but no solution yet...

Oh yeah...: R5k 180MHz, 128MB, 73GB Seagate Cheetah ;)

jmc
hmm most likely a timebase error, search for TBC, there's a ton of threads about it (quickest shortcut is to get a decent tbc in order to capture properly)

making sure nothing heavy runs in the background will also help

edit: jimmer's quick explanation
In case it's of any help, my site has some example dmrecord commands for use with IMPACT
Compression:

http://www.sgidepot.co.uk/impcom.html

Just replace the definitions of 'device' and 'engine' with 'ice' instead of 'impact' and it should
work ok on O2.

It could be that without specifying the parameters fully, it's defaulting to something unwise,
like single-frame capture and fixed a percentage quality factor (MJPEG on O2 works better
with 2-field capture and fixed bitrate).

Thus, for example:

Code:
dmrecord -p video,device=mvp,comp=jpeg,engine=ice,brate=30000000 -p audio,channels=2 test.mv


Hmm, my O2 is off atm. I'll check later, make sure the above is correct.

There are some other example commands on the page, and aliases to make things easier. See the
man page for dmrecord on your O2 for more info and other settings specific to O2. Note that the
comment on my IMPACT page about playing to the screen with audio is not relevant to O2.

Btw, I'd want more than 128MB RAM for doing video stuff on an O2. 256MB minimum is best IMO.

The one good thing though is that at least you are trying to use dmrecord. Very wise, as it's more
reliable than MediaRecorder; just a somewhat steeper learning curve. Worth the effort though. And
assuming you have a recent enough OS version, O2 can capture as AVI aswell, which makes it
easier to port files to a PC (convert to other formats for free with the MidVid JPEG codec, or
use the PIC codec which costs $99 but is 20% faster than MidVid; use VirtualDUB, AVIdemux or
other application to convert to DivX).

Cheers! :)

Ian.

_________________
SGI Systems/Parts/Spares/Upgrades For Sale: http://www.sgidepot.co.uk/sgidepot/
[email protected] , [email protected] , +44 (0)131 476 0796, check my auctions on eBid!
for O2's is corrcet this command:
Code:
dmrecord -p video,device=mvp,comp=jpeg,engine=ice,brate=30000000 -p audio,channels=2 test.mv


only difference is that the device is not ice but mvp. Maybe for older Irixes is ice.

_________________
:O2: R7000/600 576MB Ram CDRW 18+9Gb HDD
http://www.tomosgi.co.cc
Ah yes, mvp. Sorry, I was trying to recall from memory. Been a while since I've done any
capture with O2.

Ian.
Thanks guys!

I tried it again with the command you posted but I can't get it to work. :?

It gives me:
Code:
audio buffer overflow (can't write movie file fast enough)
It works for around 8 seconds usually and then stops capturing. Without an audio track I was able to capture for minutes without a problem...

Is this related to the limited RAM (128MB) I have?

I also tried capturing using media tools -> movie recorder but after capturing it has to process the movie for ages... :x I mean, if the O2 does the jpeg compression in hardware it shouldn't have to do that right?!

And even using movie recorder it gave me buffer errors once or twice...

jmc
jmc wrotes:
> I tried it again with the command you posted but I can't get it to work. :?

What exactly did you enter?


> It gives me:
Code:
audio buffer overflow (can't write movie file fast enough)
It works for around 8 seconds usually
> and then stops capturing. Without an audio track I was able to capture for minutes without a problem...

Odd... perhaps the audio is not being dealt with properly.


> Is this related to the limited RAM (128MB) I have?

Hard to say, I've never done video stuff on an O2 with that little RAM.


> I also tried capturing using media tools -> movie recorder but after capturing it has to process the movie for ages... :x
> I mean, if the O2 does the jpeg compression in hardware it shouldn't have to do that right?!

That will happen if you select single-frame instead of 2-field for the compression format.

Ian.
jmc wrote:
Thanks guys!

I tried it again with the command you posted but I can't get it to work. :?

It gives me:
Code:
audio buffer overflow (can't write movie file fast enough)
It works for around 8 seconds usually and then stops capturing. Without an audio track I was able to capture for minutes without a problem...

Is this related to the limited RAM (128MB) I have?

I also tried capturing using media tools -> movie recorder but after capturing it has to process the movie for ages... :x I mean, if the O2 does the jpeg compression in hardware it shouldn't have to do that right?!

And even using movie recorder it gave me buffer errors once or twice...

jmc


Hi, I have this command(found similiar version on Ian's pages) modified in aliases:
dmrecord -a -v -p audio -p video,comp=jpeg,quality=98 output.mv

Only limitation on my system is disk speed so I cant write fast enough video with quality=100. My disks are old SGI/IBM 9gb 7200rpm and capabe of ~7-9mb/s writes in classic use (big files copying). But this is done with 100% system load (checked trough top, copying done with neko_mc). It is normal?

Also you must have on mind that as disk becomes more filled, it SLOWS down writes. Not even talking about this alert window:
Code:
Filesystem '/dev/dsk/dks0d2s7', mounted as /mnt/somwhere is 95% full.

1-2 seconds before this happends O2 becomes like kicked to the head. After displaying alert window everything becomes normal again.

My sugestion is start with low quality parameters eg. 75 and then go higher.
Also don't run anything system demanding on background. Check it trough top maybe you will be surprised how many cpu power is wasted on something that do nothing - like neko_xmms on my system it draws 3% of cpu - when idling (not playing anything and is displayed on other desktop) Seamonkey & etc are mutch worst on this.

If you don't solve this problem I can strip my sytem to minimal ram config (64) and try to record some video we will see...

_________________
:O2: R7000/600 576MB Ram CDRW 18+9Gb HDD
http://www.tomosgi.co.cc
tomo writes:
> dmrecord -a -v -p audio -p video,comp=jpeg,quality=98 output.mv

That command is specifying constant quality. O2's ICE system works better with a constant bitrate.

Constant quality means the size of each compressed frame can vary enormously, giving an uneven flow into
the compression engine. The microcode was optimised for constant bitrate, ie. a more even flow. Thus, instead
of quality=98, try brate=25000000. That should work better.


> Only limitation on my system is disk speed so I cant write fast enough video with quality=100. My disks are old SGI/IBM
> 9gb 7200rpm and capabe of ~7-9mb/s writes in classic use (big files copying). But this is done with 100% system load
> (checked trough top, copying done with neko_mc). It is normal?

For reference, if it's of any help, I have 73GB 1.6" SCA 10K disks normally for 35 UKP each, but make it 30 for any Neko
member (lots available, suitable as external drives, 60 day warranty). I also have R7K/600 CPU modules available, ready to use.


> My sugestion is start with low quality parameters eg. 75 and then go higher.

No, use lower bitrates, like 20M, and go higher. Assuming the disk can take it, 30Mbit gives good quality, no need to go
any higher than that.


> Also don't run anything system demanding on background. Check it trough top maybe you will be surprised how many
> cpu power is wasted on something that do nothing - like neko_xmms on my system it draws 3% of cpu - when idling
> (not playing anything and is displayed on other desktop) Seamonkey & etc are mutch worst on this.

My IMPCOM advice page has some suggestions on this. Turn off all unnecessary background daemons (except XLV
if you need it) and shut down mediad/httpd, and anything else not needed:

Code:
alias chk chkconfig
chk esp off
chk webface_apache off
chk sesdaemon off
chk xlv off
chk tfxd off
chk routed off
chk sendmail off
chk sendmail_cf off
chk grio off
chk cluster off
chk ipaliases off
chk lp off
chk ts off
chk pmcd off
chk autoconfig_ipaddress off
chk ns_fasttrack off
chk tfxd off
chk timed off


Naturally, make sure videod and verbose are on. Wise to see what's going on during bootup:

Code:
chk videod on
chk verbose on


After the above is done, reboot, login as root, enter:

Code:
/etc/init.d/sgi_apache stop
/etc/init.d/mediad stop


Use 'ps -ef' to see what's running. It should be pretty minimal. It goes without saying, don't have anything running
like Firefox or other apps.


I'll be writing a large article later this year on video capture with O2. Been meaning to for ages...

Ian.
So after leaving the O2 in the corner of the room for a few days I did another capturing session today.

I changed the mediarecord setting to 2-fields which reduced the processing time. Still slow on a R5000 ..ZZZZZzzzzzz :D

I then did another session with dmrecord with following command:

Code:
dmrecord -p ausio test.mv


And: It worked :shock: I tried capturing sevaral movie files ranging from a few seconds to a few minutes and had no problem (yet)

I was wondering what the difference was to last time and the only thing I can think of is that I changed from NTSC to PAL in the mediarecord settings. Something I did not do when capturing with dmrecord the first time because the videoin signal was ok... at least on screen. Was this really it?! I will do another session and see if I get any errors... "touch wood"

jmc
Try using dminfo on the recorded movie, see what it says with respect to its stats.

Normally, if one records using 2-fields and constant bitrate, the post-processing time is barely a few seconds.

Oh yes, when I've been recording from VHS, the material is of course interlaced. The interlacing can be
removed later using a PC, etc.

Here's the dminfo for a typical 5 minute MJPEG I have stored away, file size 480MB:

Code:
File Name: vidintro.mov
File Format: QuickTime movie

PLAYING_TIME: 00:04:52.840
BITRATE: 13.220 Mbps
LOOP_MODE: Play Once
LOOP_LIMIT: 0
OPTIMIZED: 0

Audio Track:
TRACK_LENGTH: 12901896
DM_AUDIO_RATE: 44100.000Hz
DM_AUDIO_CHANNELS: 2
DM_AUDIO_FORMAT: Twos-complement
DM_AUDIO_WIDTH: 16
DM_AUDIO_BYTE_ORDER: Big Endian
DM_AUDIO_COMPRESSION: Uncompressed Audio
DM_AUDIO_BITRATE: 1.411 Mbps

Video Track:
TRACK_LENGTH: 7321
DM_IMAGE_RATE: 25.000Hz
DM_IMAGE_INTERLACING: Interlaced Odd
DM_IMAGE_LAYOUT: Split fields
DM_IMAGE_ORIENTATION: Top-to-bottom
DM_IMAGE_WIDTH: 768
DM_IMAGE_HEIGHT: 576
DM_IMAGE_COMPRESSION: JPEG
DM_IMAGE_QUALITY_SPATIAL: 0.750000
DM_IMAGE_QUALITY_TEMPORAL: 0.750000
DM_IMAGE_PIXEL_ASPECT: 1.0000 (square)
DM_IMAGE_PACKING: YCbCr 4:2:2



Converted to DivX (720x544, 1500Kbits/sec bitrate), the movie is 57MB.

Ian.
Hi!

I haven't used my O2 to capture for a while now. Today I wanted to capture some new material from my Digital8... Yes, you're right it did not work the way I would like it to. :x

Here is some of the errors I am getting:

When trying to play one of the recorded movie files:
Code:
mVPlayEventError: Error in the dmedia library: No space left on device : Cannot allocate buffer


When using dmrecord (dmrecord -p audio test.mv)
Code:
Warning: Expecting buffer XYZ from compressor, got buffer XYZ instead

This line keeps repeating with different buffer values and the recording is stopped.

When using mediarecorder sometimes it workes to capture as two-field full res Pal using JPEG compression... and the next time it won't work. Then the video input freezes every few seconds when capturing. When I stopped the recording I even got a completely frozen system and had to pull the plug...

Another mediaplayer error I got is this:
Code:
mvPlayEventError: Error in dmedia library : dmlICReceive failed: Decompress failed : hw timeout


Why won't this damn thing work?! This O2 seems to be very moody...

I am starting to think that this is a hardware error in the video module or maybe faulty RAM? I still have to get a RAM upgrade so I can swap the DIMMs and see if this still happens...
Try running the IDE tests. The 1st error looks like the system disk is full. Anything in the SYSLOG?

More info please! :)

Ian.
mapesdhs wrote:
Try running the IDE tests. .

Or maybe just df -k first ...
Or just do things from my sentence in a logical order. :D

-k is for wimps. I have it aliased...

Ian.
Hi!

I will try the tests later.

Quote:
The 1st error looks like the system disk is full.
Well I have about 63GB free space on that drive. :?

Thanks,
jmc
Got the same error!
Error in dmedia library : dmlICReceive failed: Compress failed : hw timeout
After YEARS of no errors!
Have you solved this problem?

_________________
Marco
Italy
Temperamental indeed.

I find myself with this problem - after several successful records of many minutes of footage, the next and subsequent invocations just will not capture. A reboot fixes the problem.

OK so something less invasive: reset the video system, sudo ml unld mvp driver, as suggested in the man O2Video. We see the slight pause on the next invocation as the kernel modules are reloaded, but we still cannot capture.

I did try recording as root and my system froze immediately. Pah! That was with logging as my user and using sudo. I tried logging in as root instead, and successfully recorded a few times until a total freeze on invocation. I the initiated reader would immediately point to h/w failure, like memory, but I'm not convinced.

Lets go back to just being a normal user and using dmrecord.

So what's going on ? top, par and gr_osview are my current observation points. In normal "working" operation we can see some, but not excessive CPU user and sys percentage, but mostly idle, as we'd expect as the video is being processed by ICE. In borked operation, we see a hugely increased amount of sys, which is kernel sys call activity. There are no other background tasks stealing cpu.

Why would this be? I'm still trying to find out. dmrecord or mediarecorder both fork a child to do the recording, and it's the combined CPU time consumed by the pair that breaches what the system can do, introduces the hiccup and as I'm cancelling the capture on a drop, dropping the session. In my par output of mediarecorder I have gazillions of select and ioctl calls, but my skills in this area make the system a bit opaque. Oddly I cannot get par and dmrecord to give me any data on the child process (FIX you have to run par as root).

You might thing par has something to do with it too, but when we're in a working state, I have enough headroom to have par collect stats.

oo@mapleleaf:~/MovieTest dmrecord -C -v -p video -p audio dmrec0.mv
Options:
Audio channels: 2
Video device: mvp
Input port: 'Camera Video Input' (1)
Compression scheme: jpeg
Compression engine: ice
Quality: 75
Audio rate: 44100hz
Image (field) height: 240
Image width: 640
video timing = VL_TIMING_525_SQ_PIX
DM_IMAGE_PIXEL_ASPECT = 1.000000

Hit the Enter key to begin recording...
Hit <ctrl>-c to stop recording...

Expecting buffer 11 from video, got buffer 23 instead


Warning: Expecting buffer 11 from compressor, got buffer 23 instead

Error capturing image frame 5
Post-processing output file 'dmrec0.mv' ...
Timing information:
5 image frames = 0.17 seconds of video captured.

Compression information:
Average compressed frame size: 20062.4 bytes
Average compression ratio: 30.6 : 1
Bit rate achieved: 4810161.0 bits/sec

Tried a few things: sudo ml unload the mvp and ice modules and retry - no joy. Tried systune mvpearly_frontiemsc = 0 (was 1) no change.
The only thing that reliably works is a full reboot. Then I can get 4 successful captures, then no more.
Actually sometimes it fixes itself and I can get a few more, but it's not reliable.

And then - just like that, the time it took me to write this out, it's working. Argh!

oo@mapleleaf:~/MovieTest sudo par -e ioctl -e select -i -o dmrec.par dmrecord -t 30.0 -C -v -p video -p audio dmrec0.mv
Options:
Audio channels: 2
Video device: mvp
Input port: 'Camera Video Input' (1)
Compression scheme: jpeg
Compression engine: ice
Quality: 75
Audio rate: 44100hz
Image (field) height: 240
Image width: 640
video timing = VL_TIMING_525_SQ_PIX
DM_IMAGE_PIXEL_ASPECT = 1.000000

Hit the Enter key to begin recording...

Recording was done in real time successfully.
Post-processing output file 'dmrec0.mv' ...
Timing information:
899 image frames = 30.00 seconds of video captured.

Compression information:
Average compressed frame size: 19717.6 bytes
Average compression ratio: 31.2 : 1
Bit rate achieved: 4727497.5 bits/sec

and it works...

oo@mapleleaf:~/MovieTest time dmrecord -t 30.0 -C -v -p video -p audio dmrec0.mv
Options:
Audio channels: 2
Video device: mvp
Input port: 'Camera Video Input' (1)
Compression scheme: jpeg
Compression engine: ice
Quality: 75
Audio rate: 44100hz
Image (field) height: 240
Image width: 640
video timing = VL_TIMING_525_SQ_PIX
DM_IMAGE_PIXEL_ASPECT = 1.000000

Hit the Enter key to begin recording...
Recording was done in real time successfully.
Post-processing output file 'dmrec0.mv' ...
Timing information:
899 image frames = 30.00 seconds of video captured.

Compression information:
Average compressed frame size: 17976.1 bytes
Average compression ratio: 34.2 : 1
Bit rate achieved: 4309947.1 bits/sec
0.698u 3.677s 0:32.16 13.5% 0+0k 2+4io 1pf+0w

and it doesn't work... meh :( It sucks being an SGI aficionado...

oo@mapleleaf:~/MovieTest time dmrecord -t 30.0 -C -v -p video -p audio dmrec0.mv
Options:
Audio channels: 2
Video device: mvp
Input port: 'Camera Video Input' (1)
Compression scheme: jpeg
Compression engine: ice
Quality: 75
Audio rate: 44100hz
Image (field) height: 240
Image width: 640
video timing = VL_TIMING_525_SQ_PIX
DM_IMAGE_PIXEL_ASPECT = 1.000000

Hit the Enter key to begin recording...

Expecting buffer 11 from video, got buffer 13 instead


Expecting buffer 15 from video, got buffer 17 instead


Warning: Expecting buffer 11 from compressor, got buffer 13 instead

Error capturing image frame 5
Post-processing output file 'dmrec0.mv' ...
Timing information:
5 image frames = 0.17 seconds of video captured.

Compression information:
Average compressed frame size: 17068.8 bytes
Average compression ratio: 36.0 : 1
Bit rate achieved: 4092415.5 bits/sec
0.027u 0.272s 0:01.94 14.9% 0+0k 2+5io 1pf+0w

CPU: MIPS R12000 Processor Chip Revision: 2.3
FPU: MIPS R12010 Floating Point Chip Revision: 0.0
1 300 MHZ IP32 Processor
Main memory size: 768 Mbytes
Secondary unified instruction/data cache size: 1 Mbyte on Processor 0
Instruction cache size: 32 Kbytes
Data cache size: 32 Kbytes
FLASH PROM version 4.18
Integral SCSI controller 0: Version ADAPTEC 7880
Disk drive: unit 2 on SCSI controller 0
CDROM: unit 4 on SCSI controller 0
Integral SCSI controller 1: Version ADAPTEC 7880
On-board serial ports: tty1
On-board serial ports: tty2
On-board EPP/ECP parallel port
CRM graphics installed
Integral Ethernet: ec0, version 1
Iris Audio Processor: version A3 revision 3
Video: MVP unit 0 version 1.4
AV: AV1 Card version 1, O2Cam type 1 version 0 connected.
Vice: TRE

oo@mapleleaf:~/MovieTest /sbin/uname -R
6.5 6.5.26m
rooprob wrote:
And then - just like that, the time it took me to write this out, it's working. Argh!


... and after *five minutes* it works....

Interesting that IRIX has a unload delay of 5 minutes for many of it's modules....
I did say I tried unloading both mvp and vice myself, and it didn't cleanup the problem for me. However leaving the machine idle for 5 minutes and returning to the test, we see a successful recording...

Now how' to script this.... Wait another 5 minutes and see what modules are still loaded.

oo@mapleleaf:~/MovieTest sudo ml list

Loaded Modules:
Id: 6 Character device driver: prefix plp, major 38, unload delay 5 minutes, filename /var/sysgen/boot/ecplp.o
Id: 4020 File system: filename /usr/vice/etc/sgiload/libafs.IP32.nonfs.o
Id: 6000 Symbol Table module: unload delay 5 minutes, filename /unix


Registered Modules:
Id: 2 Character device driver: prefix pciba_, unload delay 5 minutes, filename /var/sysgen/boot/pciba.o
Id: 1013 Streams module: prefix kbd, fmodsw name kbd, unload delay 5 minutes, filename /var/sysgen/boot/kbd.o
Id: 3 Character/Block device driver: prefix smfd, unload delay 5 minutes, filename /var/sysgen/boot/smfd.o
Id: 4 Character device driver: prefix ts_, unload delay 5 minutes, filename /var/sysgen/boot/ts.o
Id: 5 Character device driver: prefix tpsc, unload delay 5 minutes, filename /var/sysgen/boot/tpsc.o
Id: 1014 Streams module: prefix ptrmap, fmodsw name ptrmap, unload delay 5 minutes, filename /var/sysgen/boot/ptrmap.o
Id: 1015 Streams module: prefix wacom, fmodsw name wacom, unload delay 5 minutes, filename /var/sysgen/boot/wacom.o
Id: 1016 Streams module: prefix magellan, fmodsw name magellan, unload delay 5 minutes, filename /var/sysgen/boot/magellan.o
Id: 1017 Streams module: prefix imp, fmodsw name imp, unload delay 5 minutes, filename /var/sysgen/boot/imp.o
Id: 1018 Streams module: prefix hitachi, fmodsw name hitachi, unload delay 5 minutes, filename /var/sysgen/boot/hitachi.o
Id: 1019 Streams module: prefix calcomp, fmodsw name calcomp, unload delay 5 minutes, filename /var/sysgen/boot/calcomp.o
Id: 1020 Streams module: prefix tablet, fmodsw name tablet, unload delay 5 minutes, filename /var/sysgen/boot/tablet.o
Id: 1021 Streams module: prefix sball, fmodsw name sball, unload delay 5 minutes, filename /var/sysgen/boot/sball.o
Id: 1022 Streams module: prefix dialbox, fmodsw name dialbox, unload delay 5 minutes, filename /var/sysgen/boot/dialbox.o
Id: 1023 Streams module: prefix dial, fmodsw name dial, unload delay 5 minutes, filename /var/sysgen/boot/dial.o


Registered and Currently Loaded Modules:
Id: 0 Character device driver: prefix vice, major 17, unload delay 5 minutes, filename /var/sysgen/boot/vice.o
Id: 1 Character device driver: prefix mvp, major 9, unload delay 5 minutes, filename /var/sysgen/boot/mvp.o
This isn't it either. Left system for 30 mins, first two tries failed, the next worked.

This smells more like some kind of software bug in either the mvp kernel module or the dm library interaction in these tools. Time to battle with the dm code directly....