I have a number of USB audio adaptors that I am tried to get working with an Atheros AR9331 chipset router board. Every version I compile (tried historic and latest builds) has playback and recording issues. When playing back audio files (with alsa aplay) every other audio instance has what sounds like static or noise over it. When recording (with alsa arecord or sox rec) there is static and echo in the recording.
I then built the exact same OpenWRT build (recompiled) for an ipq40xx platform router board and used the exact same alsa settings and the playback and record is perfect! Does anybody have any idea why this might be? Why would it make a difference which platform it was built for and how can I replicate whatever (kernel or alsa) configuration works for the ipq40xx on the ar71xx?
While ARM has selectable endianness, it's usually operating in little-endian mode just like x86 (I'm not entirely sure of this, but I've seen a lot of comments strongly implying this)
While OpenWRT on ath79 targets is most definitely big-endian.
The first thing to remember is that the SoCs supported by the ar71xx/ath79 platform are generally comparatively slow, single-core devices compared to the multi-core, ARM-based SoCs. You may never get acceptable real-time audio performance from them, especially under load.
As a side note, working with ath79 is highly recommended as the ar71xx platform has been EOLed at this point.
The ar71xx platform is a 400MHz CPU and I am recording raw 8-bit 8000Hz WAV. CPU usage (as measured with top) is less than 10% even with other processes running. Surely that would be ok?
The strangest behaviour is that playback is perfect every other instance of aplay, and then static/noisy the next! I suspect the problem is something to do with compiler options/endianness that sort of thing?
Update: Just tried with a 650MHz ar71xx (MIPS 24Kc) and still exactly the same issue!
Update2: Just tried with a 400MHz AT91 (ARM) board and also the same issue.
@lleachii kind of missing out ! Do we have the sound card specs at hand ? Meaning what kind of chipset does the usb to audio/radio conversion ? Any reading to grasp the basics of it ?
Update3: compiled the exact same build of OpenWRT but for Raspberry Pi Model A target and the USB audio works perfectly, same as ipq40xx.
Why would it work fine for brcm2708 and ipq40xx but not ar71xx?
brcm2708 is single core 700Mhz so not much different to 650MHz ar71xx. Seems more like it's architecture related (compiler/build options?) than raw CPU speed performance?
Can you compare the output of the usb card information with the two different architecture ? Something like lsusb or cat about the stream process ? Could be the driver that set something wrong for ar71xx? Is the output of
Some Atheros devices doesn't work in full USB 2.0 mode when using ath79 so that might be an issue even though it "should" work but just barely. Also, what are you using to record? Keep in mind that you should record to a USB, Network Share (NFS as SMB/Samba will probably eat too much CPU) or /tmp (tmp is a bad idea as you will run out of memory quite easily but it'll do for short tests).
Preferably I think using ffmpeg is the best solution but arecord should work I suppose.
Sidenode: As far as encoding goes your best bet is using (fdk-)aac as it does just fine with integer operations.
I'm using /tmp as the file sizes are only small (<1MB)
There are issues with both playback and recording. When playing back any WAV audio file it will playback perfectly once, then the next time it will play but will be "crackly", then play it again it will be perfect, then crackly....and so on.
Recording is harder to describe, it's like crackling but also like an echo and skipping. Recording at 8000Hz Mono 8-bit Unsigned should surely not be a problem for even a 400MHz CPU. Other much faster USB devices have no problems, such as mass storage or WiFi adapters.
Working: brcm2708 and ipq40xx
Not working: ar71xx and at91
Does that make any sense? Is there something that those platforms have in common?