Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10

by Piotr Krzyzek on November 20, 2009

Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10Screen casting in Linux is not what many can consider a fun nor easy experience. There are many issues with it, but one of the largest being a lack of any professional software in Linux.

In Linux … we have RecordMyDesktop and XVidCap. Both programs are, suffice it to say well behind the commercial competition. Though they can do the job well enough assuming you can get everything to work right. So lets get started into getting RecordMyDesktop to record sound perfectly for you!

We’ll get rid of the pesky “Broken pipe: Overrun occurred” which is the source of broken, choppy and incorrectly timed audio while recording. There aren’t too many setting which you have to change, and once you have it working I recommend tweaking the setting up to your quality standards. The fixing idea here goes back from my old computer repair days: start simple and then add on.

If you’re looking for the solution, skip past the next section of my analysis as to why the problem occurs.

Why the error occurs:

Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10

Now I cannot say with 100% certainty the exact reason, though I can tell you it is partially to do with the audio card (being low quality) and the speed of the hard drive on your computer, of course also a bit to do with your CPU speed. Though the CPU shouldn’t be an issue in this day-and-age.

The cpu does all the grunt work of handling the capturing, all while taking care of the rest of the system. So if your CPU can’t handle the work load (which shouldn’t be that much) it will start to ‘miss’ a frame here and there in-order to keep up with your recording demands (and the FPS, if it can). The Linux software does NOT get any help from the graphics card to help process the video (and audio) so it leaves the CPU with really a lot of work to do.

A low qualilty sound card CAN and does cause problems. Not only because of possible driver issues (which there are from time to time in Linux, especially Ubuntu …), but also that cheap cards are simply not made up well enough nor with quality parts. The cheap quality of the card prevents it from being utilized effectively, makes it generally record and output sound with horrid quality and Lord only knows how long it’ll last before it burns out and you have to replace it. Though, on laptops you generally will not have to do such a thing.

On a laptop, unless you got a extremely high end laptop with a name brand card with a high end audio card, be prepared to deal with lower quality sound … especially recording it. Low quality parts means more resistance, less heat efficiency and meh … just face it: laptop audio cards suck in general. Reverse engineering the audio drivers doesn’t help either.

Now,  you might be asking “how on earth could a hard drive effect recording?” Simple, a hard drive is one of the slowest recording mediums we have in a computer. A hard drive is, I think, 100x slower than ram. So, any work that has to be written to the HD you’re computer will have to wait for it to complete before anything else can happen. RecordMyDeskop has several options for controlling that, and I’ll show you how to tweak it, but the general settings prefer HD usage over CPU usage. If you have a SDD drive you probably won’t have any issues, but for the rest of us we need to watch out for the HD usage.

How to fix the dreaded “Broken pipe: Overrun occurred” issue and record with jitters:

As explain above, the broken pipe error is caused by a slew of error though is can be generalized as “system lag”. We’ll try to minimize any areas of system lag and hopefully you’ll be able to enjoy full 24 FPS recording with 100% quality audio.

Step 1) Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10Turn of Composite Effect (eye candy). Things like Composite Effects (Compiz/Beryl/whatnot ..), animations, shadows all require more processing power. Eye candy is great and I love it, though for recording it is mostly a hindrance. If you are doing a presentation (PowerPoint/OOImpress style) then it’s just wasting CPU cycles.

To turn of alpha blending and all those pretty Linux effect, in Kubuntu open your Kmenu bar, go to System Settings. Click Desktop, and uncheck “Enable desktop effects”, then hit apply on the bottom right to save the settings. Your screen might flicker a bit and then the effects will be off.

Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10Step 2) Change audio device to “plughw:0,0″. Assuming you have one sound card and it’s working correctly and what not, a partially confirmed work-around to issue is to change the usable audio device. For me, these first two tips helped the most. If you are using the commend line program recordmydesktop use the extra parameter like this:

recordmydesktop -device plughw:0,0

If you are using the gui version (gtk-recordmydesktop or qt-recordmydesktop) the setting is under Advanced and in the Sound tab. Change whatever is in there, probable “DEFAULT” to: plughw:0,0

Step 3) Using only 1 channel and a frequency of 22050. This is a minor thing really, or so I think. Though using only one channel (mono) to record will take less processing power  AND less space so it can be worth while to live with with recording in mono. Honestly, I don’t think anyone will care that you record in mono anyway. The frequency has a bit to do with quality; keeping the frequency at 22050 will give you good enough audio quality for a nominal performance and not all that much space usage.

Step 4) Disable “Zero Compression”. As the tooltip for this says: “Do not apply compression on the temporary files. If enabled, the program will need less processing power, in the expense of hard disk space.” That doesn’t sound bad actually, probably a good idea except that we are trying to decrease the hard drive usage. Thus, disabling it will give the hard drive less to write and thus hopefully speeding things up for us.

Step 5) Use a NON system disk for the “Working Directory” (not possible for everyone). What I mean by this is to use a another hard drive to use for the working directory. I do not mean just another partition, I mean a completely separate hard drive. Separating out the data usage and system use hard drives allows your system to happily keep working while all your data is being written elsewhere. If you write to the same hard drive, your system will have to wait for the data to be written before the system can read it’s next instructions thus causing system lag.Best to split your system and data drives :)

Step 6) Don’t use “Encode on the fly”. Your CPU has enough to worry about while recording, just encode afterwards. No big deal.

Step 7) Enable “Quick subsampling”. This will decrease CPU usage while recording, but it will also decrease the quality. Good for those of you with slow(er) processors. A decent trade of I think if your processor can’t handle it.

Broken pipe: Overrun occurred. 8 Step RecordMyDeskop Solution in Ubuntu/Kubuntu Karmic 9.10Final Step, Step 8) Decrease Video and Sound recording Quality setting. Go on, don’t be afraid to sacrafice quality for speed here. This part is completely up to you. The more you decrease these setting the faster things will go; just like decreasing quality in video games on a PC. Of course, the lower you go the worse the quality. It’s your choice for what the trade off benefits are. Go as high or as low as you want.

edit added this step, very logical step: Step 8.5)Decreasing the recording area. You probably do not need to record the whole desktop. IF you are recording a powerpoint type presentation, OpenOffice Impress does have a ‘windowed mode’ for the presentation. So your presentation shows up in the full presentation version, with animation and all, but it’s in a window. Then simply record that much smaller window instead of a full screen.

Bonus Step #9: Record the audio and video separately. This takes a bit more skill though it’s do-able and can produce cool results. One work around actually did it this way using a bash script. The bash script sound at this bug report, the script is called “recordSoundAndDesktop.sh” records video with recordMyDesktop and audio with arecord. Another way is to record only the video in gtk-/qt-/recordmydekstop while talking (to help you make sure you are showing the right things at the right time) and then record audio with Audacity. Or even record using audacity while recoding with recordMyDesktop which DOES work very well and there are no ‘bugs’ or jitters or breaks; sound issues at all using that method…. though of course you have to combine the audio and video afterwards.

Good luck with your screen casting. Let me know if this has worked for you and if you recorded something, let me and everyone here see your work! Leave your other solutions in the comments, or if there are any other issues also let me know. We’ll try to fix it all.

Related posts:

  1. XBMC 9.11 Alpha in Kubuntu And Ubuntu Karmic Repositories! Hurray.
  2. XBMC 9.11 Alpha 2 in Kubuntu/Ubuntu Karmic 9.10
  3. XBMC Beta 2 Now In Kubuntu Karmic Repos!
  4. How To Install Chromium (Google Chrome) In Kubuntu Karmic 9.10 i386 And x64
  5. Install TweetDeck in Ubuntu Karmic x64 Easily

{ 6 comments… read them below or add one }

Norbert Wójtowicz November 21, 2009 at 4:50 am

Thanks for the writeup – this will definitely come in handy.

Just one small clarification, a hard drive seek time is over 3 ms, while today’s DRAM runs at say 300MHz (that is 3 ns/cycle). In other words, a million times (10^6) faster (not 100x).

Also, that may not be a completely accurate picture, because it’s a little bit like comparing apples to oranges. The time spent between presenting DRAM with an address and actually being able to write data to it is about 30ns. But that’s still 10^5 times faster! :-)

Reply

Piotr Krzyzek November 21, 2009 at 10:55 am

Thanks for the clarification Norbert. Though it only goes to prove my point a bit more, the difference between hard drives and DRAM is staggering. Now imagine if consumer level audio cards came with processors and ram like video cards. Imagine all the streams and ‘possible’ quality enhancements that could add.

My theory these days is to avoid the hard drive at all possible costs. Most computers today come with a dual core CPU’s and video cards which are able of offload some of the work (see Nvidia’s CUDA). If there’s time, I’ll see if I can get recordMyDesktop connected with cuda to help ease up the CPU’s load since the graphics card is generally faster as number crunching.

Adam Marchetti January 12, 2010 at 4:50 pm

Despite this page being a couple months old, I was actually able to get really good quality audio recording on my system following what you had said (despite that this is for Ubuntu, it worked on a manual compile for Slack 13. It is probably more cross platform than you realize…)

Thanks a lot for the info!

Reply

Piotr Krzyzek January 13, 2010 at 4:34 am

Awesome! I’m really glad to hear that this has helped you! Once you create your screencast, send a link here. I’m interested to see what kind of work you created. Plus I can also post a link to the video on the page if you want.

Icy May 13, 2010 at 4:31 am

Still can't remove the buffer overrun, sorry. This is even on a core i7 laptop with ATI 5870 Graphics. I'd love to use Windows for recording, but I have to limit it a lot in order to just get 30 fps.

Reply

Piotr Krzyzek May 13, 2010 at 8:55 am

Hm, yeah. Sorry about that. I've been reading up on the issue a bit lately and it's not yet solved. And it's not 100% a linux issue either. It's a problem with the recordItNow program. There was a forum post about this exact topic somewhere but I don't remember off hand. Sorry I can't be of more help.

All I can suggest for now is that you try “RecordItNow”. Seems to work best out of all the linux recording programs.

Reply

Leave a Comment

CommentLuv Enabled

Previous post:

Next post: