Bus error when playing repeatedly Quicktime movies

Hi,

I am trying to play Quicktime movies including both video and sound repeatedly with
Psychtoolbox. Usually this works fine, but in about 1/4 of the cases Matlab crashes with a
bus error. This practically never happens when the first movie is played for the first time,
but only after the movies have been playing for a while. Does anyone know any solution or
a way out of this problem?

Thank you,
Tuomas Teinonen


Here is an example code about how the movies are played:

%% The movie is loaded into memory

[movie.mov, movie.dur, movie.fps, movie.w, movie.h] =...
Screen('OpenMovie',EXPWIN, 'movie1.mov');

% Load texture

Screen('SetMovieTimeIndex', movie.mov, 0);
movietexture = 0;
count = 0;
lastpts = -1;
pts = -1;
texture = [];
while(movietexture>=0)
[movietexture, pts] = Screen('GetMovieImage', EXPWIN, movie.mov, 1);

if( movietexture>0 & pts>lastpts )
count = count +1;
texture(count) = movietexture;
lastpts = pts;
else
break;
end
end

%% The movie is played

% This is done in a loop so that each time the movies are played in a certain order
% (here the code for just playing one movie one time)

numframes = length(texture);
dispTime = (movie.dur)/(numframes-1);

Screen('SetMovieTimeIndex', movie.mov, 0);
Screen('DrawTexture', EXPWIN, texture(1), [], [] );
when = GetSecs + ifi;

Screen('PlayMovie', movie.mov, 1, 1 );

for j=2:numframes
now StimulusOnsetTime FlipTimestamp Missed Beampos] = Screen('Flip', EXPWIN, when,
2);
Screen('DrawTexture', EXPWIN, texture(j), [], []);
Screen('DrawingFinished',EXPWIN, 2);
when = StimulusOnsetTime + dispTime-ifi;
end
Screen('Flip', EXPWIN, when, 2 );

% Movie stopped


Here's the system info:

OS X Psychtoolbox version 3.0.8 9 October 2006
OS X 10.3.9
2 CPU PowerPC 970 (2.2) Mac G5 with 2GB RAM (bus speed 1 GHz)
ATI RV350 64MB AGB display driver
QuickTime 7.1.3
MATLAB Version 7.0.1.24704 (R14) Service Pack 1


And the error message I get when the program crashes is:


-----------------------------------------------------------------------
Bus error detected at Fri Jan 26 00:15:44 2007

------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.0.1.24704 (R14) Service Pack 1
MATLAB License:
Operating System: Darwin 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar
30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh
Window System: The XFree86 Project, Inc (40300000), display :0.0
Current Visual: 0x22 (class 4, depth 24)
Virtual Machine: Java 1.4.2_09 with "Apple Computer, Inc." Java HottSpot(TM) Client VM
(mixed mode)

Default Charset: US-ASCII
r0 = 00000000 r8 = 00000000 r16 = 00000000 r24 = a01c5084
r1 = bfffd9b0 r9 = 00000000 r17 = 00000000 r25 = a00016b4
r2 = a00016b4 r10 = 000003e8 r18 = a01c1f20 r26 = 02ca4a40
r3 = 30934ba0 r11 = a62f0c44 r19 = 00000000 r27 = 00000000
r4 = 00000000 r12 = 00000000 r20 = 0002f637 r28 = 02ca4a58
r5 = 000003e8 r13 = 00000000 r21 = 00000000 r29 = 02ca4a66
r6 = bfffd7a8 r14 = 00000000 r22 = 02c0f690 r30 = 30934ba0
r7 = 00000002 r15 = 00000001 r23 = 16685534 r31 = 962f8924
cr = 22222242 lr = 962f8984 xer = 20000000 ctr = 00000000
vrsave = 00000000

Stack Trace:
[0] 0x00000000
[1] QuickTime:0x96340e1c
[2] QuickTime:0x96402aa8
[3] CoreFoundation:0x901c5170
[4] CoreFoundation:0x901c24d0
[5] CoreFoundation:0x901c69e4
[6] HIToolbox:0x91a81e10
[7] HIToolbox:0x91a8853c
[8] HIToolbox:0x91aaa638
[9] AppKit:0x97d84248
[10] AppKit:0x97d9acc8
[11] AppKit:0x97daf048
[12] libawt.jnilib:0x8108bc3c
[13] Foundation:0x90a4b0a0
[14] CoreFoundation:0x902151b0
[15] CoreFoundation:0x901c4800
[16] CoreFoundation:0x901c20b8
[17] CoreFoundation:0x901c69e4
[18] CoreFoundation:0x9022ffac
[19] MATLAB:callMainFromNewThread(startup_args_tag*) + 172 bytes
[20] MATLAB:main + 208 bytes
[21] MATLAB:_start + 392 bytes
[22] MATLAB:start + 48 bytes

This error was detected while a MEX-file was running. If the
MEX-file is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for
information on debugging MEX-files.
This link:

<http://psychtoolbox.org/wikka.php?wakka=FaqQuickTimeTrouble>

summarizes all we know about how to resolve Quicktime issues. Obviously you should
also make sure that you stop & close movies after playing them, otherwise you could leak
ressources, something that people sometimes forget to do, but that's about it.

-mario

--- In psychtoolbox@yahoogroups.com, F DELIGIANNI <f.deligianni@...> wrote:
>
> I got the same problem with a similar script on another computer:
> Dual 2 GHz PowerPC G5
> 5GB DDR2 SDRAM
> Mac OS X Version 10.4.8
>
> PsychtoolboxVersion:
> 3.0.8 - Flavor: beta - Corresponds to SVN Revision 583 but is *locally modified*
> !
>
> Fani
>
> crash:
>
>
> Bus error detected at Wed Apr 4 11:00:04 2007
> -------------------------------------------------------------------
> -----
>
> Configuration:
> MATLAB Version: 7.3.0.298 (R2006b)
> MATLAB License: 318315
> Operating System: Darwin 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8
> 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh
> Virtual Machine: Java 1.5.0_06 with "Apple Computer, Inc." Java HotSpot(TM)
> Client VM mixed mode, sharing
> Default Charset: ISO-8859-1
>
> r0 = 00000000 r8 = 00000000 r16 = 00000000 r24 = 05133a90
> r1 = bfffd2c0 r9 = 00000000 r17 = 00000000 r25 = 05133ba8
> r2 = a0001fac r10 = 000003e8 r18 = 000287ff r26 = 13dee500
> r3 = 15c7e930 r11 = a4781c44 r19 = 00000000 r27 = 00000000
> r4 = 00000000 r12 = 00000000 r20 = 1d1a5981 r28 = 13dee518
> r5 = 000003e8 r13 = 00000000 r21 = e81b312c r29 = 13dee526
> r6 = ffffffff r14 = 00000001 r22 = 05133ba8 r30 = 15c7e930
> r7 = 00000002 r15 = 00000001 r23 = 139353c8 r31 = 94789924
> cr = 24228242 lr = 94789984 xer = 00000000 ctr = 00000000
> vrsave = 00000000
> Stack Trace:
> [0] 0x00000000
> [1] QuickTime:TaskMovie~ + 396 bytes
> [2] QuickTime:__QTInitializeGestaltValues~ + 344 bytes
> [3] CoreFoundation:CFRunLoopWakeUp~ + 1640 bytes
> [4] CoreFoundation:CFRunLoopRunSpecific~ + 2904 bytes
> [5] CoreFoundation:CFRunLoopRunSpecific~ + 268 bytes
> [6] HIToolbox:GetMainEventQueue~ + 2004 bytes
> [7] HIToolbox:BlockUntilNextEventMatchingListInMode~ + 500 bytes
> [8] HIToolbox:BlockUntilNextEventMatchingListInMode~ + 96 bytes
> [9] AppKit:_DPSNextEvent~ + 384 bytes
> [10] AppKit:_runningOnAppKitThread~ + 176 bytes
> [11] AppKit:_NXIsHiddenOnLaunch~ + 3020 bytes
> [12] libawt.jnilib:VerifyMember~ + 1236 bytes
> [13] Foundation:NSZoneRealloc~ + 4304 bytes
> [14] CoreFoundation:_CFRunLoopPerformEnqueue~ + 724 bytes
> [15] CoreFoundation:CFRunLoopRunSpecific~ + 4444 bytes
> [16] CoreFoundation:CFRunLoopRunSpecific~ + 1676 bytes
> [17] CoreFoundation:CFRunLoopRunSpecific~ + 268 bytes
> [18] CoreFoundation:CFRunLoopRun~ + 52 bytes
> [19] libmwmcr.dylib:mcr_kickoff_cfrunloop(void* (*)(void*), void*) + 172 bytes
> [20] MATLAB:start + -2572 bytes
> [21] MATLAB:start + -3652 bytes
> [22] MATLAB:start + -4048 bytes
>
> This error was detected while a MEX-file was running. If the MEX-file
> is not an official MathWorks function, please examine its source code
> for errors. Please consult the External Interfaces Guide for information
> on debugging MEX-files.
>
> If it is an official MathWorks function, please
> follow these steps in reporting this problem to The MathWorks so
> that we have the best chance of correcting it:
>
> 1. Send this crash report to segv@... for automated analysis.
> For your convenience, this information has been recorded in:
> /Users/cbcd/matlab_crash_dump.190
>
> 2. If the problem is reproducible, please submit a bug report via:
> http://www.mathworks.com/support/contact_us/ts/help_request_1.html
>
> Thank you for your assistance. Please save your workspace and restart
> MATLAB before continuing your work.
>
> Non-signal thread entered the MATLAB signal handler.
>
> MATLAB program terminated.
> Severe:
> The program '[190] : Native' has exited with code 1 (0x1).
> PTB-INFO: Connection to kernel-level vbl handler establised (shmem =
> 0x1462f000).
>
>
>
>
>
> ---- Original message ----
> >Date: Tue, 27 Feb 2007 14:53:29 -0000
> >From: tuomast <tuomast@...>
> >Subject: [psychtoolbox] Re: Bus error when playing repeatedly Quicktime
> movies
> >To: psychtoolbox@yahoogroups.com
> >
> > Thank you for your suggestions!
> >
> > --- In psychtoolbox@yahoogroups.com, "Mario Kleiner"
> > <mario.kleiner@> wrote:
> > > 1. Quicktime support on OS-X 10.3.9 is less stable
> > than on 10.4.x in
> > > my experience.
> >
> > Updating to OS X 10.4.8 did not help. I still get a
> > similar crash dump, sometimes also
> > including an error message of an illegal instruction
> > (below). I will look into your other
> > suggestions and let you know, if I manage to solve
> > this.
> >
> > Best regards,
> > Tuomas
> >
> > ----------------------------------------------------------
> > Bus error detected at Tue Feb 27 14:42:28 2007
> > ----------------------------------------------------------
> >
> > Configuration:
> > MATLAB Version: 7.0.1.24704 (R14) Service Pack 1
> > MATLAB License: x
> > Operating System: Darwin 8.8.0 Darwin Kernel Version
> > 8.8.0: Fri Sep 8 17:18:57 PDT
> > 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power
> > Macintosh
> > Window System: The XFree86 Project, Inc (40400000),
> > display :0.0
> > Current Visual: 0x22 (class 4, depth 24)
> > Virtual Machine: Java 1.4.2_09 with "Apple Computer,
> > Inc." Java HotSpot(TM) Client VM
> > (mixed mode)
> > Default Charset: US-ASCII
> >
> > r0 = 00000000 r8 = 00000000 r16 = 00000000 r24 =
> > 02a0f850
> > r1 = bfffd390 r9 = 00000000 r17 = 00000001 r25 =
> > 02a0f948
> > r2 = a0001fac r10 = 000003e8 r18 = 0002df53 r26 =
> > 02a8d250
> > r3 = 0fd8f910 r11 = a4755c44 r19 = 00000000 r27 =
> > 00000000
> > r4 = 00000000 r12 = 00000000 r20 = 1d1afc43 r28 =
> > 02a8d268
> > r5 = 000003e8 r13 = 00000000 r21 = 13dd7822 r29 =
> > 02a8d276
> > r6 = ffffffff r14 = 00000001 r22 = 02a0f948 r30 =
> > 0fd8f910
> > r7 = 00000002 r15 = 00000001 r23 = 086e5320 r31 =
> > 9475d924
> > cr = 24228242 lr = 9475d984 xer = 00000000 ctr =
> > 00000000
> > vrsave = 00000000
> > Stack Trace:
> > [0] 0x00000000
> > [1] QuickTime:0x947a5e2c
> > [2] QuickTime:0x94867ab8
> > [3] CoreFoundation:0x907f0550
> > [4] CoreFoundation:0x907dcec8
> > [5] CoreFoundation:0x907dc47c
> > [6] HIToolbox:0x93205740
> > [7] HIToolbox:0x93204dd4
> > [8] HIToolbox:0x93204c40
> > [9] AppKit:0x936e7ae4
> > [10] AppKit:0x936e77a8
> > [11] AppKit:0x936e3cec
> > [12] libawt.jnilib:0x9a8a3d3c
> > [13] Foundation:0x9296ca00
> > [14] CoreFoundation:0x9080da78
> > [15] CoreFoundation:0x907dd4cc
> > [16] CoreFoundation:0x907dc9fc
> > [17] CoreFoundation:0x907dc47c
> > [18] CoreFoundation:0x907eb8dc
> > [19] MATLAB:callMainFromNewThread(startup_args_tag*)
> > + 172 bytes
> > [20] MATLAB:main + 208 bytes
> > [21] MATLAB:_start + 392 bytes
> > [22] MATLAB:start + 48 bytes
> >
> > ----------------------------------------------------------
> > Illegal instruction detected at Tue Feb 27 14:42:28
> > 2007
> > ----------------------------------------------------------
> >
> > Configuration:
> > MATLAB Version: 7.0.1.24704 (R14) Service Pack 1
> > MATLAB License: x
> > Operating System: Darwin 8.8.0 Darwin Kernel Version
> > 8.8.0: Fri Sep 8 17:18:57 PDT
> > 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power
> > Macintosh
> > Window System: The XFree86 Project, Inc (40400000),
> > display :0.0
> > Current Visual: 0x22 (class 4, depth 24)
> > Virtual Machine: Java 1.4.2_09 with "Apple Computer,
> > Inc." Java HotSpot(TM) Client VM
> > (mixed mode)
> > Default Charset: US-ASCII
> >
> > r0 = f0ffbb8c r8 = 00000000 r16 = f0ffd220 r24 =
> > f0ffadb8
> > r1 = f0ffad80 r9 = 00000000 r17 = 00000005 r25 =
> > 0002b2cb
> > r2 = 00001d03 r10 = 00000000 r18 = 106aa600 r26 =
> > 00000000
> > r3 = 00000000 r11 = a0006a28 r19 = f0ffdba4 r27 =
> > 00000000
> > r4 = 00000003 r12 = 9000ab40 r20 = f0ffd190 r28 =
> > 00000000
> > r5 = 0000002c r13 = f0ffd8b0 r21 = 00000004 r29 =
> > 00000000
> > r6 = 0000002c r14 = f0ffd190 r22 = 00000000 r30 =
> > 00000000
> > r7 = 00001d03 r15 = 00000000 r23 = 00000004 r31 =
> > f0ffbb80
> > cr = 24048204 lr = f0ffbb8c xer = 00000000 ctr =
> > 9000ab40
> > vrsave = 00000000
> > Stack Trace:
> > [0] liblaf.jnilib:0xf0ffbb8c
> >
> >
>