little clicks and pops

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

little clicks and pops

Post by mieczotronix »

Hi. My hacked asus wl-520gu developed this annoying problem. Every second or two when playing .mp3/.flac files off nfs file system it generates these tiny clicks and pops. On one USB soundcard they're just clicks and pops while on another (the better one I wanted to use) they cause it to loose sync and generate noise.

I've tried hard to eliminate this, but I can not
What i did:
- I set:
audio_buffer_size "102400"
buffer_before_play "10%"
max_connections "2"
max_playlist_length "200"

I also run the mpd using
nice -n 20 /usr/bin/mpd

When i use top command, I see 3 instances of mpd running, using taking up 49% 49% and 54% of MEM (whatever it is). I have CPU usage at 10-30% by mpd, and yet it skips. I hThe system uses 13000-14000K and has 300-400K RAM free on average

Anyone has any idea how to elliminate this?

My sound driver is oss

User avatar
mightyohm
Site Admin
Posts: 1016
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: little clicks and pops

Post by mightyohm »

What USB-audio adapters are you using, and what is the dmesg output like for each of them? What sampling rates do they support?

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

Thanks for your reply.
I've been using the "USB2.0 EXTERNAL 7.1 AUDIO PC SOUND CARD ADAPTOR" I bought off ebay
another one is a Chinese hi-fi DAC (HLLY DMK-IV with PCM2704 as USB receiver).
The first one is 44,1/48 kHz while the other is 32/44,1/48 (according to dmesg) and I also tested it at 96kHz and it seemed like it worked. Both are easily recognized and are set to play mpd at 44,1 kHz.
If there's anything more apart from supported sample rates you want from dmesg, tell me and I post it here.

I am now after a whole day of fruitless tests and checks. I downgraded my previously nfs-enabled kernel to exactly the setup you recommend, and when I play a "silence" mp3 file the clicks are still there, so it is not the issue of nfs compatibility in the kernel, as I thought yesterday.

Normally you wouldn't hear those clicks, since they are very quiet and if a music plays it will almost completely mask them up. And this is probably why I haven't heard them until I bought the DMK-IV hoping to turn my Asus wl-520gu to a networked hi-fi .flac player. The problem is that the DMK-IV with PCM2704 reacts differently to those clicks and pops. It somehow looses sync and starts generating noise and lo-fi distortion of one or both channels until another click arrives and it either somehow resyncs or starts generating noise/distortion in another channel.

According to my tests, clicking occurs regardless of whether I play a .mp3 or a .flac and whether it is on nfs over wifi or ethernet, on the Internet (radio streaming), or on local flash drive inside the router.
Still I have no idea why those clicks are there and it seems like a permanent problem nobody has noticed so far.

User avatar
mightyohm
Site Admin
Posts: 1016
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: little clicks and pops

Post by mightyohm »

I'm not sure if the clicks and pops you are referring to are the same ones I have, but I will say that my radio is very "noisy" when there is no music playing or the music is at a low volume. This happens even with mpd stopped or not running, I don't need to play an audio file at all.

The issue in my case seems to be RF noise from the wifi chipset getting back into the USB-audio adapter or audio amplifier. The noise goes away when I disable the wireless interface.

Not all USB-audio adapters are the same, and compatibility with OpenWrt is not very good across a wide range of adapters. That's why we have the thread in this forum about supported USB-audio adapters. The only one I have ever used is the SYBA, so I don't have any experience with other adapters.

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

mieczotronix wrote:No, I don't mean noise. I mean these kind of clicks and crackles you could hear on a regular (analogue) old-style LP disc, but not that often... every a couple of seconds (some 2 to 5 seconds maybe - don't know what it depends on). Sometimes more frequent sometimes less. I mean like you would be clicking with your finger nails.
Noise on my two usb soundcards is low, especially the Hi-Fi one which is almost noiseless. Also I can't see much difference in terms of noise with wireless either on or off.

Since I've been getting it on two different soundcards I think this is the router's fault.

I've been still thinking about this issue and I just thought that this may be due to the router performing some kind of time-critical task every couple of seconds. That could halt data transfer to USB for a tiny fraction of a second. I am now thinking that this may be due to the flash file system. Maybe the system is writing something to the flash memory at such low rate and that causes the problem.
I've now bought an used 500gp to see if I could mount file system on an external HDD and try with alsa drivers, which I was unable to fit in 520gu memory.
Some time before I also ordered a USB->Spdif converter to check whether a another device will have the same problem and to be able to feed data somehow to my DAC. But from my current reasoning it seems pretty clear that the converter will be also suffering from clicking, hopefully it won't cause the DAC to get into trouble like it is now...
I wanted to build a hi-fi networked player, with a LCD, around my open-wrt-ed asus so getting rid of this problem is really important for me.
Last edited by mieczotronix on Fri Mar 25, 2011 11:13 am, edited 1 time in total.

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

mieczotronix wrote:No, I don't mean noise. I mean these kind of clicks and crackles you could hear on a regular (analogue) old-style LP disc, but not that often... every a couple of seconds (some 2 to 5 seconds maybe - don't know what it depends on). Sometimes more frequent sometimes less. I mean like you would be clicking with your finger nails.
Noise on my two usb soundcards is low, especially the Hi-Fi one which is almost noiseless. Also I can't see much difference in terms of noise with wireless either on or off.

Since I've been getting it on two different soundcards I think this is the router's fault.

I've been still thinking about this issue and I just thought that this may be due to the router performing some kind of time-critical task every couple of seconds. That could halt data transfer to USB for a tiny fraction of a second. I am now thinking that this may be due to the flash file system. Maybe the system is writing something to the flash memory at such low rate and that causes the problem.
I've now bought an used 500gp to see if I could mount file system on an external HDD and try with alsa drivers, which I was unable to fit in 520gu memory.
Some time before I also ordered a USB->Spdif converter to check whether a another device will have the same problem and to be able to feed data somehow to my DAC. But from my current reasoning it seems pretty clear that the converter will be also suffering from clicking, hopefully it won't cause the DAC to get into trouble like it is now...
I wanted to build a hi-fi networked player, with a LCD, around my open-wrt-ed asus so getting rid of this problem is really important for me.

User avatar
mightyohm
Site Admin
Posts: 1016
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: little clicks and pops

Post by mightyohm »

I have not had this issue with the SYBA (CM chipset) USB-audio adapter.

Regards,

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

ok, thanks anyway,

I've seen some posts here and here of people having this problem (search for "crackl")
So it seems like it is build/driver related. Allegedly ALSA drivers would cure it, but I read this in quite an old post

I'll post here If I can nail it down

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

Managed to install alsa drivers on 520gu, but it didn't help. Clicking is still there. Someone elsewhere suggested that it's because of interrupts. I'll try then with 500gp and hdd when I get them...

mieczotronix
Posts: 14
Joined: Tue Nov 23, 2010 2:48 pm

Re: little clicks and pops

Post by mieczotronix »

Got 500gp today. Installed Kamikaze 8.09 on it plus mightyohm's mpd/mpc and so far it has been working ok without crackling. So It looks like more RAM/and uhci driver (instead of ohci) helped.

Post Reply