Netscape Causes MP3s to Skip?
A member of the ubiquitous Clan Anonymous Coward asks:
"Hi, I'm having some trouble playing MP3s smoothly on my
PII333/96MB Linux box, running Slakware 3.6 w/ kernel
2.0.35. X11amp and mpg123 both skip when I scroll in
Netscape. I have messed around with it a bit to no avail.
Can anyone give me some pointers on giving the MP3 player
a higher priority than other apps (in the hopes that this
will keep it from skipping)."
I used to have the same problem on my box as well. And when I used to play mp3s in windows, it did the same. Start mpg123 like this. 'mpg123 -b 4096 filename.mp3' the number after the -b is the bytes of ram you want it to take for its own and not to give up. This will fix the problem.
pci_retry gives X better acceleration, but will 'block' the bus and can cause some soundcards to skip during large video transfers. See your X server man page for details.
For some stupid reason, neither mpg123 nor x11amp cache anything by default. In fact I don't even know how to enable cache in x11amp. Running mpg123 with -b 128 switch (128k buffer) solves the problem. But still I don't get WHY the hell is cahe off by default???
Nullsoft's FAQ says that the reason Winamp will skip is due to the video transfer on the I/O Bus. This takes away from the bandwidth of the sound card and thus it cannot get the data fast enough to play it without skipping. The only solution that that would lend to is making sure one has an AGP video card that is good... rather than just a cheap trident or something like that.
I also have this problem in Win98 (sorry, they just don't make some stuff fot Linux!). Whenever I scroll I get this little skipy stuff. I have done this with a SB16 AND a ESS1686. Of course I am on a 233MMX w/128MB RAM. It does the same thing on my roomates PII 450 w/ 256MB though. He runs 98/NT, he is a non-Linux running wienie though. I have no problems in Linux.
As others have pointed out, start mpg123 and tell it to buffer. I use -b 1024, and it wont even skip when im compiling a kernel, using X and netscape, and playing mp3. This all on a lowly p200, 64 megs ram, UW SCSI. You can alias mpg123 in your shell to mpg123 -b 1024, then you just type "mpg123" and itll always use the buffer.
_Underflow, at school with no cookie.
I get skips only when in 44khz, stereo sound,
under heavy video load. MP3 buffering is
irrelevant here; that's a buffer of decompressed
data, and this happens when playing WAVs, too. I've tried both OSS and Alsa--no change. I've got a generic ISA SB16 and an old S3 868. "pci_retry" isn't an option on the X server I'm using (XF SVGA). MTRR settings have no effect, so I leave write-combining enabled (improves video performance substantially.)
The only solution I've got so far, for my hardware, is to play mono.
I use to have this problem on my p166 when i ran redhat. I was convinced it was something between memory and the slow bus. I got a Dual PPro 200 and it skipped, rarely but it would skip.
;-) to Fbsd 3.0 for this machine and
I "upgraded"
cant get a mp3 to skip no matter what. I'm still convinced its effected more by hardware but the symptoms were reduced by beefy hardware in my case and a change of OS.
Mp3's do strain less systems but surely a p2-333 is more than beefy! hehe.. maybe not.. get an alpha..
That is a common problem to all platforms. It's a Bus DMA contention problem. The solution - Three letters ---> AGP!
I would suggest running "top" or some other program that gives insight into resource usage while you experience this phenomena.
I have an AMD K6-300 with 64MB of SDRAM, a cheap generic 4MB S3-GX video card, and a sound blaster 16. I am running Debian 2.1, kernel 2.0.36, and KDE 1.1. I currently have 4 netscape windows open, 2 xterms, a nice Quake II screenshot as a background, 1280x1024 resolution, and playing a song on x11amp. I just wheeled up and down some web pages, used the scroll-bar to go up and down, grabbed a netscape window and moved it around my screen as fast as I could without experiencing any skipping or pausing in the audio.
I did all this while running "top." The only major change I noticed was the CPU usage for XF86_SVGA. It once went over 40%.
Yesterday I ran a dedicated Quake II server on my machine with 8 people connecting to it for the game and usage of my ISDN via IP_MASQ. The whole time I was playing mp3s on the machine.
I have a hard time believeing that my little K6 is more powerful than any Pentium II. I would suggest looking for a program or piece of hardware that is sucking up lots of resources.
I can't believe no one has mentioned this yet (unless I'm blind). My appicon (shortcut) for Netscape automatically nices it to 15, which cuts down most of that. If you want your mp3s to have CPU time no matter what (not just against Netscape), then you'll have to give mpg123 a negative nice value, which you'll have to be super-user to do. 'man nice' should get you started.
I have a diamond stealth 3d 4000 AGP card (4 meg) and it skipped like a bitch under windows when I scrolled in _anything_ while using winamp. No skips at all under linux though, with x11amp.
I agree with that.
My PPro200 box running x11amp does not get such stuff while using Communicator 4.5. Even on 98 running WinAmp does not suffer from it. Using Communicator 4.5? It seems to take a lot of CPU time while you do something on it. I hope Netscape releases improved browsers, which consume less CPU time.
Your Hitler quote is BRILLIANT. How long did it take you to make that association?
Way to take a stand, champ.
Basicly alot of video card lock the pci bus for a short period of time to increase benchmarking. (This was windows I assume the same thing happens)I noticed someone also recomended disableing pci retry and or try buffering mpg123 -b 300 works on most machines thats useally appx 20 seconds. Netscape causes alot of hd io, it may be normal, on my P2 400 I have no such problem. Pentium 200 I dont have that situation either but minor buffering is required on both.
is hogging all the bandwidth
i use -b 2048 with mpg123, on my P100, with netscape running, it occasionally "pauses", but doesnt skip, i see this pause as better than skipping, because im most likely to expect either on my current hardware
With Linux 2.2 things seem to skip much less. In fact, last night mpg123 did skip once (thanks to netscape indeed), and this is what appeared in my /var/log/messages:
Mar 2 00:56:36 localhost kernel: Sound: DMA (output) timed out - IRQ/DRQ config error?
So at least the kernel (2.2.2) is aware of the skips.. let's hope that a few more kernel releases will blow this problem away.
x11amp seems to be the problem. I had to find a way to play my mp3s smoothly because I have a regular Pentium running at 100Mhz...
If you nice down x11amp, it help, but the best way to make sure x11amp use more cpu is to change the real time setting with a utility called rude.
mpg123 is not very effective at playing mp3s on a slow machine, xaudio works much better. My favorite player is definitely mxaudio for all kinds of good reasons, first because it's the only one that doesn't choke on my mp3s when I'm working. You can also use xaudio with the latest x11amp, but it's not as effective as mxaudio.
Marc
I had a problem with mp3s skipping. They sounded terrible. It was really annoying. I couldn't figure it out. It turned out that unless the CD Caddy was loaded into my SCSI CD-R drive, mp3s would skip. When I put in a caddy and the drive read it, the mp3s played normally. Bizzare
I've had similar problems with PCI retry except not only was my sound card affected, my serial port transfers were affected as well. I'd get dropped characters when scrolling my screen. Needless to say, disabling PCI retry fixed the problem.
Chris McCoy
If you go to WinAmp's site they address this problem exactly as it applies to windows machines. They are after all a windows app. The problem is NOT with sound cards. It's a problem with the video card itself. The discription and fix are to long for this forum but basiclly the video card buffer is locking up the buss untill it's finished with the redraw. The same buss your Sound card is trying to use to play the MP3. End result a skip. Although they give a fix, designed for Windows machines It's complete with enough info that a resonalble person should be able to apply it to Linux as well. They are at www.winamp.com
stop running heinous bloatware like nutscrape
and x-windoze. duh!
I am not familiar with how to configure sound cards under linux. However, when using windows 95, I had the same problem. When I checked the DMA option for the soundcard, the problem went away. Perhaps there is an equivalent setting for your card under Linux.
The ISA bus is served off of the PCI bus.. The entire ISA bus essentially behaves like a single PCI card.
- A.P.
--
"One World, One Web, One Program" - Microsoft Promotional Ad
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
Maybe something funny in your sound drivers? I'm happily scrolling around in Netscape playing MP3's on my good ol' P200 without the slightest problem here...
\\'
Hey Berky,
I used to have the same exact problem, you have a couple solutions at hand:
1) Hunt down the settings for Accelerated X, and if you see "PCI retries" or "PCI retry" anywhere, disable it.
2) Alternatively, you can switch to XFree86, which has PCI retries on Matrox cards disabled by default. The performance of the Matrox XFree86 driver is very good, too.
Please feel free to email me at muaddib@magicnet.net so we can get this fixed.
Slashdot's first reaction to VMware
as some AC pointed out, it's in X acceleration. We have mp3 player we modified so it has threaded feeder to playing thread with 128kb buffer. We still can make pauses while dragging windows under X around. 1600x1200x16M can be real killer to PCI (IIRC, ISA too is bridged through PCI).
while XFree is pretty adjustable on PCI behaviour, I can't find how to tell Xaccel to be nice.
http://opencm3.net, http://www.nongnu.org/gm2/
The PCI code in XFree86 version 3.3 breaks my soundcard real good. XFree86 3.2 doesn't have any problems so I keep a copy of XFree86 3.2 around permanently.
Also the free open sound system driver can rarely allocate more than 4096 bytes for a DMA buffer because it's memory management sucks. You should either try the commercial sound driver or figure out how to permanently allocate 128k DMA buffers at startup.
For rock solid buffering, get rt.c which allows one process to lock the CPU until it's finished buffering. I use rt.c with mpg123 and it's rock solid with no crashes.
I have a dual processor system, and the problem is still there. My CPU utilization is never hi while playing MP3's, so I doubt that is the souce of the problem.
sigs are a waste of space
It's probably the "Acclerated X" server grabbing the PCI bus and not letting go.
"'Tis great confidence in a friend to tell him your faults, greater to tell him his." --Poor Richard's Almanac
--
First, try enabling the buffering in mpg123. A buffer of between 128kb - 4096kb will allow the player thread to continue working even when the decoder falls behind due to high system load.
Second, try using rtstools to give mpg123 realtime priority. This will result in mpg123 getting run before all other pending processes on your computer. I also have a patch for mpg123 that can do this -- mail me if rtstools helps but you get tired of doing it by hand.
Third, check for hardware issues. Make sure your video card or another device isn't hogging all the bus bandwidth. Make sure slow devices like parallel port zip drives and old IDE controllers aren't holding up the entire system.
As someone else mentioned, the solution is to turn off PCI Retry in your X server options. This is an article a friend of mine sent me about why it happens. The article is primarily directed at Windows drivers, but their drivers are just doing the same thing as PCI Retry under X.
---
(If you are not using a PC with a PCI VGA accelerator card,
you need not read any further....)
WARNING: Long post ahead! updated 11/11/97
In the past this information has been suppressed, now it can be told...
A good number of VGA card manufacturers are squeezing out a few extra
points on their winbench scores by locking up the PCI bus. This is fine
for graphics and most systems on the PC (hard disks and such) don't even
notice the problem.... Unfortunately this can hurt the audio system in
a big way.
Most audio cards use ISA/DMA to trickle samples over the bus one word
at a time. Even PCI cards such as the AMIII can be hurt by this problem
because they trickle the data over the bus in tiny PCI transfers. When
another device illegally locks up the bus for more than 1/88200th of a
second, there's a good chance you will lose audio samples resulting an a
glitch in the recording or playback.
How do you know if you're having this problem? Try opening up your
favorite wave editing program, loading a wave file and hitting the play
button. While the audio is playing, grab the top of the window (assuming
it is not maximized) and repeatedly pick it up and drag it to another
location on the desktop. On a soundblaster compatible card, the audio
will glitch and pop while you drag the window. On a ZA2 card, there is
a 50/50 chance the audio will swap L/R channels after such a glitch.
On an adb card, not only can the right and left channels swap, but there
is also a good chance the audio will be left in a glitchy mode that makes
the audio repeatedly jump channels resulting in a high pitch scratchy noise.
At this point in the discussion, I would like to stress that this is NOT
(I repeat NOT) the fault of the soundcard! This is not even the fault
of the VGA card... it is in fact the fault of the VGA driver. If you do
not experience any glitching or distortion then you can probably ignore
the rest of this post! I've heard that the VGA drivers supplied by
Microsoft (verses the drivers supplied by the VGA manufacturer) do not
suffer from this problem.
I think Matrox was the first to play with this, but it doesn't really
matter because most high performance VGA accelerator cards for the PCI
bus are doing the same thing now. When a number of graphics acceleration
operations need to be performed, these commands are sent from the VGA driver
to the VGA card over the PCI bus. The VGA chipset has a built in queue
that is capable of holding several accelerator commands. Normally the driver
checks a status bit on the VGA card to tell if this queue is full or not.
If the queue is full, the driver waits for the queue to have a free space
before sending the next command. Matrox discovered (and everyone soon
followed) that you could increase VGA performance by NOT CHECKING THIS
STATUS BIT!!!!! What happens when you write blindly to a full queue of
commands on the VGA card? The bus hangs... The bus master has started a
PCI transaction, but the target (the VGA card) can't accept the data yet
because it has no place to put it. As soon as the VGA card has room for the
data, then the transaction can complete... but until that time the PCI bus
is completely locked up. No PCI or ISA transactions can happen. This can
take a long time (40 or more audio cycles) if the current VGA operation is
a huge BITBLT on a 24bit screen... A 256 or 512 bit FIFO just ain't gonna
cut it.
The only acceptable solution to this problem is to put the queue check
BACK into the VGA driver. I have been discussing this problem with some
of the engineers at Matrox and Tseng labs and have some solutions for you!
Tseng labs has released a new version of their ET6000 VGA driver that
behaves nicer to the PCI bus.. this driver is now trickling down to the
STB and Hercules products that use the ET6000 chip. For the Hercules
Dynamite 128 card, there is a new driver on the Hercules BBS (not web
page... don't ask me) called DV95112 (Version 1.12) Using this driver,
you need to add a special switch in your system.ini file. Under the
heading [Hercules] there is a line that reads "Optimization=0" you will
need to set this to "Optimization=1"... ta da, problem fixed.
It turns out that Matrox has ALWAYS had a hidden back door switch to
enable this check in the VGA driver. If you are using the Matrox Millennium,
you will need to add the following lines to your system.ini file:
[mga.drv]
PCIChipset=1
This almost fixes the problem completely.... you will also need to disable
the "Use PowerGDI acceleration" feature in the Advanced Matrox setup
(Control Panel->Display Properties->MGA Settings->Advanced->Performance)
ta da... problem fixed.
[update July 1997] I've heard from the good folks at S3 that _ALL_ S3
drivers for all of their VGA cards (downloaded from www.s3.com) can be
fixed by adding a line in system.ini under the [display] section...
After [display] add the line 'bus-throttle=1' so (for S3 drivers):
[display]
busthrottle=1
[update September 1997] For owners of newer Matrox cards:
Go to screen properties (right click in main window)
Go to setting tab, Click on PowerDesk button
Check 'Use Bus Mastering' (on)
Uncheck 'Use Automatic PCI Bus retries' (off)
On Pentium Pro machines, Uncheck 'Use Write-Combining'
Click on OK
[updated November 1997] For owners of the #9 Imagine 128 series 2
It seems a new driver (version 4.102.36) is now available directly from
the folks at #9 upon request..
Unfortunately there are other VGA maker who have not
acknowledged this problem (not that Matrox or Tseng has formally done so
either). And we as users, software manufacturers or hardware
manufacturers need to get the word out that this is a VGA problem
and not a DMA problem!!!!!! We need to drill it through the heads of
the VGA card makers that they can't get away with this B.S. without at
least having an OPTION to make the driver behave appropriately.
Have you ever been told to turn the VGA acceleration off??? or to reduce
the size of your VGA screen??? or reduce the color depth???
THESE ARE NOT ACCEPTABLE SOLUTIONS!!!
Call your VGA manufacturer and tell them they need to fix the problem!
(You will probably need to get beyond Joe Tech Support, because he
probably doesn't know anything about this... please inform him!)
This message has been brought to you by Greg Hanssen (hanssen@zefiro.com)
copyright 1996 Zefiro Acoustics.
PLEASE feel free to post this to any forum where the knowledge can be used.
-- OpenVerse Visual Chat: http://openverse.com
It isn't the CPU cycles that are in short supply it is the RAM. When X, netscape and whatever else is running, the RAM is what is sucked up, not the CPU.
I had the same skipping problem and was able to fix it by using the -b option to increase the memory buffer size when using mpg123. I actually found that 4MB or more of buffer was usually necessary for flawless play.
So mark that two votes for increasing the buffer size.
don't you guys just hate pc's? ...something must be done! :)
I use Winamp on the above respective systems, and anytime that I scroll in a window in any program (netscape, ie, outlook, win explorer, word, etc.) winamp skips a bit.
Given enough hydrogen, just about anything is possible.
Despite the belief of the masses, it takes one hell of a lot of resources to scroll. It redraws the screen every scroll, and when you get smooth scrolling, it's even worse. If you have lots of ram, you can let x11amp reserve some, but even that won't fix everything...
A little while ago I had the problem of X11amp skipping on my RH5.2 box (P200MMX, 64mb RAM). I had earlier in the day logged in as root a few times to install some packages, and I discovered (on running top) that I had three instances of control panel running, even though I was now logged in as myself. Each instance was using about 30% of available CPU. When I killed them x11amp stopped skipping.
The same think happened to a friend of mine running WinAmp on his NT box. What happens (according to the official Winamp faq) is that your video card is using so much bus bandwidth that nothing can get through to the soundcard. Some boards even go so far as to lock other devices out of the bus while scrolling. The only known way to fix this problem is to replace the video board.
0 1 - just my two bits
Yeahbut! I _do_ have a good AGP card on my 233mhz :) My Matrox G200 (8meg) _still_ makes skips :)
K6.
on mp3 playback (never tried X11amp, cause mpg123
is more effecient - no X interface to drive). As
posted earlier, even a 128k buffer can kill _most-
skips. Hm. speaking of matrox (offtopic now),
how does one enable X for agp2x mode?
I have an AMD K6-300 with 64MB of SDRAM, a cheap generic 4MB S3-GX video card, and a sound blaster 16. I am running Debian 2.1, kernel 2.0.36, and KDE 1.1. I currently have 4 netscape windows open, 2 xterms, a nice Quake II screenshot as a background, 1280x1024 resolution, and playing a song on x11amp. I just wheeled up and down some web pages, used the scroll-bar to go up and down, grabbed a netscape window and moved it around my screen as fast as I could without experiencing any skipping or pausing in the audio
I have a similar system. Same video card, but I've got a cyrix 200, and an ess sb compatible. When I ran a 2.0.x kernel, I had absolutely NO skipping whatsoever. Now that I'm using a 2.2+ kernel it skips like crazy. My assumption is a change in sound drivers to these oss ones, but I'm not sure.
The bit about X swamping the pci bus is news to me, but it makes a lot of sense. In my experience, though, (and this is with a much slower cpu) mpg123 without options will always skip when I do any substantial amount of accessing on IDE disks. The amount of disk transfer it will get through without skip seems directly proportional to the size of buffer I tell mpg123 to use. If you're running on scsi disks, this shouldn't be an issue, but otherwise it would be another good reason to crank up that buffer size.
So, is this a nonissue for people with AGP video cards?
I had the same problem, way back when. I agree with the previous post that video grabbing the pci bus is the most likely cause of the troubles, but I like my solution better. When I installed a second processor in my box, the problem went away. (:
Hi all, got myself an acct finally... ok here's the story... i've tried setting the buffer on mpg123 to 4 megs with mpg123 -b 4096 but that still does not work... scrolling still causes mp3s to skip. As far as video goes, I have a matrox millennium II 4 meg AGP video card... yes, AGP, so hmmm how does that figure into this whole situation? Soundcard is a SB AWE64 and i'm now running 2.2.1, with the OSS/Free AWE64 drivers. BTW, system is all scsi if that matters. I'm running AcceleratedX, and I dont know where to look for the disabling of pci_retries, and not sure why i would even want to, since i'm using an agp card, although i will look furthur. But the main thing is, it is an agp video card... gotta love agp, right? ps sorry this is posted twice, ignore the first one.
Do you have a better suggestion for linux? How about lynx? maybe if i'm stranded with a shell account, but not when i'm in front of my workstation, thanks.
I've noticed on my Dell PII-400 that when I ran fvwm95 my MP3s played fine under X, when I went to KDE they got real choppy. They work fine if I load the mpg123 before KDE, but if I do it afterwards, even after leaving KDE, the audio is choppy.