Totem receives BadAlloc when playing very large movies using Xv

Bug #4229 reported by Žygimantas Beručka on 2005-11-12
42
Affects Status Importance Assigned to Milestone
totem (Ubuntu)
Medium
Ubuntu Desktop Bugs
xserver-xorg-driver-i810 (Ubuntu)
Undecided
Unassigned

Bug Description

Made a screen capture with Istanbul and tried to view this with Totem in Dapper, but it crashes with that file. Here's the output of Totem:
[snip]
Using netbios name MOONSHINE.
Using workgroup MSHOME.
video_out_xv: using Xv port 69 from adaptor Intel(R) Video Overlay for hardware colorspace conversion and scaling.
video_out_xv: port attribute XV_COLORKEY (6) value is 66046
video_out_xv: port attribute XV_BRIGHTNESS (5) value is -1
video_out_xv: port attribute XV_CONTRAST (4) value is 65
video_out_xv: this adaptor supports the yuy2 format.
video_out_xv: this adaptor supports the yv12 format.
x11osd: unscaled overlay created (Colorkey mode).
video_out: thread created
snd_pcm_open() failed:-16:Device or resource busy
>>> Check if another program already uses PCM <<<
audio_oss_out: Opening audio device...
audio_oss_out: audio.device.oss_device_name = auto, probing devs
audio_oss_out: Auto probe for audio device failed
audio_esd_out: connecting to esd server...
audio_out: thread created
xine_stream_new
video_out_xv: VO_PROP_INTERLACED(0)
xine: found input plugin : file input plugin
load_plugins: probing demux 'anx'
load_plugins: probing demux 'matroska'
ebml: invalid master element
load_plugins: probing demux 'mng'
load_plugins: probing demux 'ogg'
xine: found demuxer plugin: OGG demux plugin
demux_ogg: Theorastreamsupport is highly alpha at the moment
video discontinuity #1, type is 0, disc_off 0
waiting for audio discontinuity #1
audio discontinuity #1, type is 0, disc_off 0
waiting for in_discontinuity update #1
vpts adjusted with prebuffer to 140739
load_plugins: plugin theora will be used for video streamtype 3e.
xine_play
libtheora:Received an bad packet
diff=1 (pts=1, last_pts=0)
video discontinuity #2, type is 2, disc_off 1
waiting for audio discontinuity #2
audio discontinuity #2, type is 2, disc_off 1
waiting for in_discontinuity update #2
libtheora:Received an bad packet
video jump
The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 65 error_code 11 request_code 141 minor_code 19)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

The file I was trying to watch is here http://zygis.gotdns.org/stuff/desktop-recording.ogg (~0.5Mb)

However, I'm not sure should I have reported this against Istanbul or Totem.

Sebastien Bacher (seb128) wrote :

Thanks for your bug. It works fine for me. Does it crash every time for you? Could you get a backtrace with --sync as mentionned by the message?

Changed in totem:
assignee: nobody → gnome
Žygimantas Beručka (zygis) wrote :

Tried with --sync, result is the same. However, I went on investigating more and downloaded mplayer and I haven't been able to watch it either. I get

--- cut ---
Selected video codec: [theora] vfm:theora (Theora (free, reworked VP3))
==========================================================================
Audio: no sound
Starting playback...
X11 error: BadAlloc (insufficient resources for operation)

MPlayer interrupted by signal 6 in module: vo_check_events
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
--- cut ---

I'm afraid that it can be not totem's bug, but of "i810" Xorg video driver.

Daniel Holbach (dholbach) wrote :

It works nicely in mplayer on an i810 box of mine, but totem-gstreamer exits for me too.

I changed the videosink (gstreamer-properties) from (x11/xshm/xv) to (no xv), which made it work. As the error message instructed me, I got a back trace (http://ubuntu.gplan.info/totem.bt) with a breakpoint on gdk_x_error - Daniel, could we have your input on it?

j^ (j) wrote :

this looks more like a bug in the grafic driver.
some cards have problems to play videos of that
size. if your card uses shared memory you can try to
give it more ram by setting
 Option VideoRam 49152
 Option CacheLines 1980
in Section "Device" in /etc/X11/xorg.com

Changed in totem:
assignee: gnome → ubuntu-x-swat
Jerome S. Gotangco (jsgotangco) wrote :

Can anyone get to test if this still happens on Flight 6? Thanks.

Changed in xserver-xorg-driver-i810:
status: Unconfirmed → Needs Info
Daniel Serpell (daniel-serpell) wrote :

In dapper beta, it crashes with a 1024x768 video.
Using:
 Option VideoRam 32768
 Option CacheLines 1980

Works ok.

João Craveiro (jcraveiro) wrote :

In dapper beta, it crashes with 1280×768

João Craveiro (jcraveiro) wrote :

PS:

It was with xserver-xorg-driver-i810_1:1.4.1.3-0ubuntu2, and updating to 0ubuntu5 (latest available) did no trick.

yoeloosh (yoeloosh) wrote :

i have the same problam with different video card
Section "Device"
        Identifier "S3 Inc. Savage 4"
        Driver "savage"
        BusID "PCI:1:0:

Paul Sladen (sladen) wrote :

The BadAlloc comes with the video just doesn't have the resources to give the program; either there isn't enough free RAM on the video card for an Xvideo buffer of the size requested, or the Xv port cannot decode images that large.

It really should be up to totem to realise this, back-off and try another combination (eg. software rendering).

Changed in totem:
assignee: ubuntu-x-swat → desktop-bugs
status: Needs Info → Confirmed

It's true that totem should try another output method, but the i810/i915 does support that large accelerated video output, so, IMHO, the driver shoud support this at install.

After all, it's only two lines to xorg.conf to solve it.

Paul Sladen (sladen) wrote :

Yes, it does support scaling up to 1440x... but only if there is enough memory to allocate a buffer of that size (4-8MB of framebuffer).

I've done an upload to mitigate the problem by having totem not try to display a HUGE startup logo.

Julian Rockey (ubuntu-jrockey) wrote :

I've had this problem on my HP Pavilion dv4000 laptop, which is Intel onboard graphics GMA 915. It's only appeared recently (in past week or so); previous Dapper versions played DVD's OK in Totem so it must have been as a result of an update within the last couple of weeks.

Totem immediately exits with this error on startup without trying to play a disc or a file.

Blue (vali-dragnuta) wrote :

I can confirm this bug. It happens with totem AND mplayer, but it's a xorg bug. This stupid bug keeps reappearing in al xorgs, while I never had this with xfree. The problem is that xorg is not smart enough to allocate memory required for xv framebuffers.

Adriaan Peeters (apeeters) wrote :

I get this error when simply starting totem, without opening any file. I am using totem-xine on ubuntu dapper latest updates.

The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 69 error_code 11 request_code 141 minor_code 19)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Kai-Uwe Widany (kwidany) wrote :

I get this error when trying to watch wmv9 videos with resolutions of 1280x720 and 1440x1080 on a i915GM with a screen-resolution of 1400x1050.
I have modified my xorg.conf to:

        VideoRam 65536
        Option "CacheLines" "1024"

Now it play both videos fine.

Sebastien Bacher (seb128) wrote :

Adriaan, your bug is likely to be bug #35229 which is fixed to edgy

Sebastien Bacher (seb128) wrote :

Cc-ing Adriaan so he can read the previous comment

I can also confirm that the workaround works but I don't think this bug should be logged against totem. The bug is in i810, or somewhere else.

Dean Sas (dsas) wrote :

is bug 38939 a duplicate of this bug?

LCID Fire (lcid-fire) wrote :
Download full text (3.2 KiB)

I can confirm this (also for mplayer).
Totem gives me:
The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 48 error_code 11 request_code 141 minor_code 19)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

mplayer gives me:
MPlayer 2:0.99+1.0pre8-0ubuntu8 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) III Mobile CPU 933MHz (Family: 6, Model: 11, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled with runtime CPU detection.

Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.

Playing HEAVYRAIN_THECASTING_1280.avi.
AVI file format detected.
VIDEO: [DX50] 1280x720 24bpp 30.000 fps 3763.3 kbps (459.4 kbyte/s)
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 191.7 kbit/13.59% (ratio: 23964->176400)
Selected audio codec: [ffmp3] afm: ffmpeg (FFmpeg MPEG layer-3 audio decoder)
==========================================================================
open: No such file or directory
Couldn't open: /dev/mga_vid
open: No such file or directory
Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
alsa-init: using device default
alsa: 44100 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 1280x720 => 1280x720 Planar YV12
[xv] Source image dimensions are too high: 1280x720 (maximum is 1024x1080)
FATAL: Cannot initialize video driver.

FATAL: Could not initialize video filters (-vf) or video output (-vo).

alsa-uninit: pcm closed

Exiting... (End of file)

I'm running on a laptop - having a i830m graphic card. Movie I tried is: http://download.filefront.com/5058523;dc558d...

Read more...

Daniel Holbach (dholbach) wrote :

Can somebody if this is bug #35229 or bug 38939?

Eugenia Loli-Queru (eloli) wrote :

This bug persists! Please, if you can't fix it in the driver, at least when you autodetect that an intel card is used, automatically add to the xorg.conf this

        VideoRam XXXXX
        Option "CacheLines" "1024"

Without it, ALL HD movie trailers from Apple.com fail with ALL video players, not just Totem. I was not able to play 720p and 1080p videos if I was not adding the above!

Thomas Pryds (thomas-pryds) wrote :

This happens for me, too. I've just done a clean install of Gutsy Herd 5, and did all updates. I get the same error as above (note that the error which this error points to as a duplicate deals with a "BadRequest" error instead of a "BadAlloc" as here). I get the error with all players I tried (totem, vlc, mplayer). Here's the output from totem when trying to play a 720p mov video file from Apple's trailer site (my screen resolution is 1280x800, using the 915resolution package):

Gdk-ERROR **: The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 56 error_code 11 request_code 140 minor_code 19)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
aborting...
Aborted (core dumped)

VLC says:

VLC media player 0.8.6c Janus
main warning: can't store message (Invalid or incomplete multibyte or wide character): found Box:
main warning: can't store message (Invalid or incomplete multibyte or wide character): read box: "
main warning: can't store message (Invalid or incomplete multibyte or wide character): found Box:
main warning: can't store message (Invalid or incomplete multibyte or wide character): read box: "
main warning: can't store message (Invalid or incomplete multibyte or wide character): found Box:
main warning: can't store message (Invalid or incomplete multibyte or wide character): read box: "
main warning: can't store message (Invalid or incomplete multibyte or wide character): found Box:
main warning: can't store message (Invalid or incomplete multibyte or wide character): read box: "
X Error of failed request: BadAlloc (insufficient resources for operation)
  Major opcode of failed request: 140 (XVideo)
  Minor opcode of failed request: 19 ()
  Serial number of failed request: 82
  Current serial number in output stream: 83

Bastanteroma (bastanteroma) wrote :

Confirming the problem with Gutsy beta on an intel 865G.

Bastanteroma (bastanteroma) wrote :

Should have tried this first - fixable by either adding the videoram related lines to the xorg.conf, or by switching from i810 to intel.

JuanHoyos (elhoyos) wrote :

This bug should be unlinked as dup from bug #35229. The latter is already fixed and right now, with Hardy, I'm experiencing the problems described on the present with driver i810 (82915G/GV/910GL).

I used what j^ suggested about xorg.conf values and it now works fine. Remember you should restart your X11 server to changes take effect.

May Ubuntu, by default, give us bigger values for shared memory?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions