Crackling with MP3s and Alsa

I've upgraded my system to Ubuntu Feisty, and started having problems with mocp. A few tracks have very bad quality, with crackles and pops, in exactly the same places every time. The same files play fine under madplay, and other MP3 players using different decoders. Also, if instead of the default backend for moc (Alsa), I switch it to use OSS, or even jackd (with jackd running with an Alsa backend), the crackling goes away. There doesn't seem to be anything particularly strange about the files that crackle -- most of the other tracks in the same album, which were ripped at the same time, don't have these problems.

Also, recoding the file can cause the crackling to go away, or change slightly. I've experimented a bit, and have had problems either with high quality VBR or a high fixed bitrate.

Note that the same tracks were working fine before my upgrade (I had Ubuntu Edgy before).

If it would be helpful, I could upload the tracks somewhere, or parts of them.

I've used MOC on Ubuntu Feisty and hit the same problem. I've ignored this because this was an old box (pentium 200) and thought this was the problem. Those kinds of bugs are hard to debug and the only thing I'll do now is to add this to my known bugs list. I'll try to fix it when I have more time.

--
Damian Pietras - MOC developer

Same problem on archlinux after last update:(

I've noticed this too. I'm using moc on a p133 with puppylinux 2.12 no X.
mp3s at 56kbps are fine but at 128kbps they start to crackle. I just assumed it was the extra load in decompressing the mp3s.

I tried using OSS as suggested and the quality was much better than ALSA though still a bit crackly. Does this mean OSS is lighter on resources than ALSA?

If I shutdown the moc client then the quality is good enough regardless of the sound driver.

Running top with the moc client running, whilst playing a 128kbps mp3, lists 7 moc processes
the 6 server processes are using about 67% cpu and the client is using 31% (not much to spare)
With the client off, the load reduces to a much more reasonable 89%!

I'm not really expecting any better, I think a faster processor is called for, something modern like a celeron 400!

I might try using something with a 2.4 kernel instead of 2.6, puppy 1.x or maybe DSL (I see that they have moc in testing).

I think it's not that OSS is lighter. It's a MOC bug because other programs works good and I was using OSS emulation modules with ALSA drivers.

What is the kernel version in your puppylinux box? What is the soundcard? Mine was CMedia something.

--
Damian Pietras - MOC developer

Since I don't have access to hardware/software configuration where the problem can be reproduced could any of you try the following patch: ftp://daper.net/pub/soft/moc/patches/moc-2.4-try-to-fix-alsa-1.patch

It changes the way MOC sets up ALSA buffers to what is in mplayer.

--
Damian Pietras - MOC developer

Hello,
I applied your patch as I am having the same problem, still no success though.
I think the problem doesnt occur with low volume mp3s; its like if the decoded audio gets too high in level and you get distortion. Let me know if I can help somehow, this is really bothering me :)

G.

Does it happen only with mp3?

--
Damian Pietras - MOC developer

No, I found also few wav files which behave in the same way. I have not enough ogg to test with, but I dont think its a decoder problem, as using OSS driver is OK.

There could be also a difference between OSS and ALSA with 24bit sound. There was a fix in 2.5.0-alpha1 for a different bug, but it also disables 24bit output with ALSA. Can you try this version? Please add OnSongChange = "/usr/bin/true" to your ~/.moc/config file before running 2.5.0 because without that it will segfault.

--
Damian Pietras - MOC developer

It seems you got the point man, that version works OK. No more crackling. Tell me if I can help you more deeply.

G.

I will be thankful if you try this patch: ftp://daper.net/pub/soft/moc/patches/moc-2.4-try-to-fix-alsa-2.patch on 2.4 version. It will assure me that this is the issue.

--
Damian Pietras - MOC developer

I applied the patch and actually turning on/off 24 bits enable/disable the crackling. If this can be useful to you, my notebook is an Apple iBook G4 12", last series before Apple switched to intel. I am using ubuntu feisty and notice that I applied the patch to the ubuntu source version of mocp, which is already a bit patched (modplug and prune_command patches). So I had to tweak a bit the patch to make it work. If you need something else, I'll be glad to help. If you think it can be useful, I can compile mocp 2.4 "vanilla" with and with no patch.
Thanks a lot to have solved it ;)

G.

I have also this problem with some mp3s(i have 2.4 version of moc). But if i use other programs(like Totem, Rhytmbox or mp3blaster) i don't have any problems...

I tried to set in config file only alsa and play with alsamixer(i have a dolby sorround 5.1 system) but the problem persists.

Please i love this program but i don't have still try patch: i don't know how i can install it??

Here Italy,
Garret

It was fixed in recently released 2.4.2. Try this version.

--
Damian Pietras - MOC developer