[Solved] Distorded sound when Airplay with USB Dac and 1.4

Hi,

thanks to marcos (http://volumio.org/forum/airplay-name-won-change-from-volumio-t1339.html#p5094) and kais (http://volumio.org/forum/volumio-rpi-soundcard-select-and-airplay-issues-t1321.html#p5840) i have solved the problem reported by many users when using Airplay with Volumio 1.4 connected to a USB Dac.
As initially reported by LeonCB, the problem was : “the sound is very distorted. It sounds like a very oversteered Mickey Mouse”

To fix it, you just need to edit the file “/var/www/command/player_wrk.php” and change the shairport related line to

$cmd = '/usr/local/bin/shairport -a "Volumio" -w -B "mpc stop" -o alsa -- -d default:'.$device.' > /dev/null 2>&1 &';

I don’t think this issue can be called “solved” - the aforementioned fix does not work for me. I still have distorted sound, either using this modification or the default shairport call.

I don’t believe that this mod addresses the root cause of the issue. If we look at the shairport documentation, all this change is doing is forcing shairport to use the system default sound card, instead of the card that is specified in the Volumio config. I think there’s two problems with this - perhaps we’re losing functionality in that those with multiple sound devices will not be able to change the Volumio sound device config and have it be changed when using shairport. Also - this mod may work for some, but not all - depends on what the system default audio card setup is, and if it’s configured correctly or not.

Clearly there is an issue with the data that shairport is sending to the audio device. I’m not sure why on some systems that changing the device to default fixes the issue?

Esseki (or anyone else for whom this fix works) - since this fix works for you, perhaps you could inspect your default sound card config and find the configuration for that? I think you’ll find information that may lead to a fix that addresses the root cause of the issue and still allows shairport to use the sound device specified in the Volumio UI.

Hi bdouble,

I marked it as resolved as it solved the issue for my setup. Im sorry to hear that it did not help in your case, but i’m confident this can help others on the forum, with the same setup as me, who i saw reported the same problem.

.
I agree with you but I didn’t pretend so. I just shared a solution that worked for me.

I agree :slight_smile:

This is what surprises me. As i explained my setup is based on a Cubox-i4Pro. On this platform it seems the default output is the SPDIF not the USB. And my fix worked. So i have been testing a bit farther. Trying to change the output in Volumio from USB to SPDIF. And i confirm as you say that my fix does not work :cry: So again i agree with you

I would be happy to help but i’m affraid i don’t know where to start from. If you could give me some directions, i could return you some details about my setup or pull out some logs. It could help to identify why this fix works in this particualr case.

Do you have a file called “asound.conf” in either location?

/etc - this is where to configure the systemwide default soundcard.

/.asoundrc - sets up a per-user default sound card config

I don’t know how setting this up interacts with volumio. I have tried using the stock 1.4 build with these in place, or without - airport still won’t work.

There’s also some sound card config details in /etc/modprobe.d -

alsa-base-blacklist.conf alsa-base.conf both set up alsa audio parameters

I suspect that this issue is due to a sampling rate or bit depth mismatch between what shairport sends to the sound card, and what works with my particular DAC… but still haven’t figured out the fix.

Michelangelo can you help us?

yep, that is my feeling too

any help really appreciated, thanks

Hi bdouble,

sorry for the late answer.

I have checked either location and i didn’t find any file called “asound.conf”.

Here is the content of :

/etc/modprobe.d/alsa-base-blacklist.conf

[code]volumio@volumio:~$ cat /etc/modprobe.d/alsa-base-blacklist.conf

Uncomment these entries in order to blacklist unwanted modem drivers

blacklist snd-atiixp-modem

blacklist snd-intel8x0m

blacklist snd-via82xx-modem

Comment this entry in order to load snd-pcsp driver

blacklist snd-pcsp[/code]

/etc/modprobe.d/alsa-base.conf

[code]volumio@volumio:~$ cat /etc/modprobe.d/alsa-base.conf

autoloader aliases

install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

Cause optional modules to be loaded above generic modules

install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; : ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }

Keep snd-pcsp from beeing loaded as first soundcard

options snd-pcsp index=-2

Keep snd-usb-audio from beeing loaded as first soundcard

options snd-usb-audio index=-2

Prevent abnormal drivers from grabbing index 0

options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2[/code]

Those seem like the standard default settings that ship with Volumio. I am assuming you didn’t change anything in there?

Unfortunately I don’t have an answer. I have not been able to get Shairport to work with my DAC… I really do think this is a sample rate mismatch between what shairport is sending the DAC and what my DAC will accept - but, I haven’t found any way to change that.

The next thing I was going to do was to update shairport to the latest version by compiling it - haven’t had a moment to try that out yet. I’ll keep you posted if this fixes the issue…

Michaelangelo, if you’re watching this thread and you have any advice on things to try, let us know! I think the community seems to be stumped on this one.

Hi bdouble,

They are. I indeed din’t change anything in those files.

Actually i did already. At least this version from Jul 11, 2014 of https://github.com/abrasive/shairport. I am indeed interested in retrieving the metadata of Airplayed files to display them (including the artwork) like other files played with MPD.
I still got a lot of distorted sound when changing the alas output but i encourage you to test and confirm.

Any help would be much appreciated :slight_smile: This issue is new since Volumio 1.4, i’m sure that Michelangelo may have an idea why it is occurring.

Hi all,

I had the same problem with airplay audio that some of you have reported here: the audio was sped up, and everything sounded like one of those tacky chipmunk sound effects. This was a total dealbreaker for me, as volumio is going to be primarily an airplay receiver in my setup. The B+ was connected to my Peachtree Audio Decco65 via USB.

The audio out dropdown box on the volumio web UI only offered me “ALSA” and “X” - and the ALSA option disappeared shortly thereafter. I presume “X” is the digital out, as when I boot without the USB plugged into the DAC the list is empty.

Firs things first, I ran the following lines to ensure everything was up to date:

sudo apt-get update sudo apt-get upgrade sudo apt-get install binutils sudo apt-get rpi-update
Next, I followed the instructions given by esseki (quoted below) and edited /var/www/command/player_wrk.php, and it solved my problem.

I hope this helps other people who might have this same problem.

What I’d like to know is what exactly does this line do? $cmd = '/usr/local/bin/shairport -a "Volumio" -w -B "mpc stop" -o alsa -- -d default:'.$device.' > /dev/null 2>&1 &';