Yun audio crackle

I have added sound to my Yun following these instructions: http://dev.mikamai.com/post/69775973742/arduino-yun-with-sound-the-supereasy-way.

So I did:

opkg update
opkg install kmod-sound-core 
opkg install kmod-usb-audio 
opkg install madplay

However, during playback, I get repeated clicking sounds. This has been tested with a DAC with the same chipset as suggested in the article, as well as with others: always the same result.

madplay /mnt/sd/samples/test3.mp3

I have tried the solution suggested here: http://forum.arduino.cc/index.php?topic=214968.msg1651246#msg1651246; and added the asound.conf file (chmodded it to 644 as well) That does not solve the issue.

Also, when using alsa directly (aplayer), I get the same results with wav files of different sample rates stored on the sd-card.

aplay /mnt/sd/samples/piano2.wav

Anyone have any idea what might be causing this?

To me everything seems to point to the USB-interface dropping packets, but I do not know how to be sure of this or how to solve it... or am I missing something?

Have you upgraded the Yun? There is a known and fixed issue with USB port that may explain your issue

[quote author=Federico Fissore link=topic=235360.msg1693350#msg1693350 date=1398283414] - Fixed USB port stability (when using it both with a pen drive or as a serial device) [/quote]

http://forum.arduino.cc/index.php?topic=235360.0

Unfortunately: yes. I have upgraded three devices, and I am still seeing this on all of them.

EDIT: I have also tried different ways of supplying them with power, used powered USB-hubs or every other thing I could think of.

On the internet I see some hints concerning openwrt to change usb-port speed, but no idea how to do this on the yun.

EDIT2: the distortion is also audible when using speaker-test

Try to get better sound;-

AR9331 + Audio I2S DAC WM8918G Sample rate:16-bit, 44 kHz Frequency arange 40 Hz/15kHz dB:+0.03, -0.07 Noise level, dB (A):-74.4 THD, %:0.0046 IMD + Noise, %:0.050

https://forum.openwrt.org/viewtopic.php?id=50512

Not directly support by Yun.

http://forum.arduino.cc/index.php?topic=188690.msg1725763#msg1725763

Unfortunately the last suggestion is not possible; I have to stick with the Yun for reasons of build format and the use of IO.

Thomas

I've just found this http://comments.gmane.org/gmane.comp.audio.mad.devel/766 Does it help? Like playing with the mixer volumes (lowering them) ?

We did that, it did improve the audio but did not completely remove this specific crackle. The only solution (for us) was to reduce the audio quality in the mp3 to 32k, 44.1kHz, mono. Then it does work.

What were the previous quality settings?

Hi, today I write in this forum because also I followed the instruction on this site in past and it work as i want..until now !!

I recently added new function in my Yun based project and I have a little .mp3 file that yun plays when i touch a button.. The mp3 is 3 seconds long but if I push the button while mp3 is playing, nothing append !!!

Actually I use madplay and I would to use other application... i found this site but i can't install MPD..

I did opkg update and then opkg install mpd, the download starts, but at the end i get an error: the package can't be installed.

What is wrong ? There's another way to solve my problem ? The perfect "theorical" way is if exist a madplay command that stops playing mp3 to replay the mp3 from its begin..

mpd-full - 0.16.5-2 - Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. It is typically controlled over a network using one of it's many clients including mpc (console), gmpc (gnome), phpmp (php), etc... . This package contains a full-blown Music Player Daemon. mpd-mini - 0.16.5-2 - Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. It is typically controlled over a network using one of it's many clients including mpc (console), gmpc (gnome), phpmp (php), etc... . This package contains a minimal Music Player Daemon, with support for only Flac, MP3 & OGG media types & only file: & http: protocols.

opkg update
opkg  install mpd-full

Or

opkg update
opkg  install mpd-mini

http://forum.arduino.cc/index.php?topic=242648.msg1744666#msg1744666

Repeat Play:

/usr/bin/madplay /mnt/sda1/track39.mp3 -r

Stop play:

/usr/bin/killall -9 madplay