Tutorial: Raspberry Pi as Music Server, DSP, and Crossover

Hi - I installed the latest Raspbian, ran sudo apt-get update, installed ecasound, alsa-base, alsa-tools, alsa-utils, cmt, swh-plugins, libasound2-plugins, ladspa-sdk, cmake and make.

I ran speaker-test -D surround21😀evice -c 2 -t wav and got Front Left/Front Right audio. So, the card works and communicates with the Raspberry.

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

I then ran ecasound -i:alsahw,1,0 -o:sample.wav and ecasound worked fine. I checked and had a sample.wav file after I turned off ecasound. Then, I ran ecasound -i:sample.wav -o:alsahw,1,0 and ecasound opened as normal, the USB LED blinked like it does when processing audio and no sound. Bummed. This is as simple as it gets I think. Thoughts? Oh, arecord -l shows this:

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $
 
Okay, I loaded a .wav file directly onto the SD card and it played fine with:

ecasound -i😛eggy.wav -o:alsahw,1,0

When I run alsamixer I choose the USB card, make sure the line level is not muted and save as alsactl store.

I have ordered that Behringer BEHRINGER U-PHONO UFO202 to see what happens.

I am about to give up because it "should" be working. >>>>>>>>> Dang.
 
Okay, I loaded a .wav file directly onto the SD card and it played fine with:

ecasound -i😛eggy.wav -o:alsahw,1,0

When I run alsamixer I choose the USB card, make sure the line level is not muted and save as alsactl store.

I have ordered that Behringer BEHRINGER U-PHONO UFO202 to see what happens.

I am about to give up because it "should" be working. >>>>>>>>> Dang.
Don't give up now, you're just getting to the fun part!
🙂
 
Ok. I went back to a step by step process. None of this is making sense to me, I am fairly adept at this but have been flummoxed.

So, if it should work assuming the soundcard's line in jacks work and it does not work then perhaps it is the soundcards. I plugged each of them into my Windows 10 machine and each says line in currently unavailable. ????????? Could it have been this simple all along. Why wouldn't there be a line in available, even on Windows? Hmmmm. More testing to be done directly on the cards I guess.
 
Update: Now it is weird. When I plug each soundcard into my Windows box and right click on properties each card registers its line in as unavailable. However, if I open Audacity, it sees each card and records line in just fine. I can safely conclude that it is not a hardware problem/defect/damage with either card. Each will record line in signal.

Perhaps, I am not having success in getting Raspbian to recognize/allow line in from the card. I cannot seem to get the alsamixer settings to stick.

Does anyone suggest I do the changes to /etc/modprobe.d/alsa-base.conf and force the USB as default? I think it is options snd-usb-audio index=0?

Thanks.
 
I then ran ecasound -i:alsahw,1,0 -o:sample.wav and ecasound worked fine. I checked and had a sample.wav file after I turned off ecasound. Then, I ran ecasound -i:sample.wav -o:alsahw,1,0 and ecasound opened as normal, the USB LED blinked like it does when processing audio and no sound. $
Were you feeding audio to the soundcard from an external source when you recorded your test file 'sample.wav'?

I'm not sure why you are not explicitly giving the audio format for ecasound each time. How do you know that the format for the recording of 'sample.wav' (ecasound must have chosen something) was a format that the soundcard could playback?

The above is a good approach, however, I would redo it but this time using ecasound's format specifier, with the same audio format when you are writing the test file and when you are playing it back. The format should be a standard one like 16 bit, 44.11k 2 channels.

So, specifically, issue the following:
Code:
ecasound  -f:16,2,44100 -i:alsahw,1,0 -o:sample.wav
and
Code:
ecasound  -f:16,2,44100 -i:sample.wav -o:alsahw,1,0

This may or may not get things working, but it's worth a try.
 
Thanks all who have taken interest in this. Thanks Charlie.

Hi, No love. I did explicitly what you noted above (previously as well). I confirmed I had line level output going into the soundcard. Ecasound opened and ran like expected.

I confirmed there was a sample.wav file. Then, I ran another test with sample1.wav as the filename and confirmed it was there. I then confirmed that the files named had actual data in them with ls -l sample.wav and sample1.wav based on size of file. What I do not know is if there is any actual audio data in those files.

But, no audio out even with the explicit instruction you gave me. So, I ran speaker-test and I got audio out of the soundcard. So, I know the card is capable of inputting line signal (on Windows), I know that it is capable of outputting sound under Linux if the music data is on the SD card.

This is all being done on a clean install of Raspbian on the new RPi3 I got for Christmas.

I am going to pull the sample files off of the SD Card and check to see if they are actually audio. Here is the print out of the file size check. Is there a command I can issue that tells me if it is actually audio data?

pi@raspberrypi:~ $ ls
mnt sample1.wav sample.wav
pi@raspberrypi:~ $ ls -l sample.wav
-rw-r--r-- 1 pi pi 10821676 Jan 5 17:06 sample.wav
pi@raspberrypi:~ $ ls -l sample1.wav
-rw-r--r-- 1 pi pi 5611564 Jan 5 17:12 sample1.wav
pi@raspberrypi:~ $
 
Update number ad nauseum:

I pulled the sample.wav and sample1.wav file off of the RP3 and copied them to my Fiio X3 player.

Though the files are substantial there is no audio data on them. When I play them back directly from the FiiO and into my amplifier there is no sound. So, I am not actually getting recording from line in using ecasound. A permissions problem? An alsamixer problem?

Geez. . . . . . . . . .. .
 
Update number ad nauseum:

I pulled the sample.wav and sample1.wav file off of the RP3 and copied them to my Fiio X3 player.

Though the files are substantial there is no audio data on them. When I play them back directly from the FiiO and into my amplifier there is no sound. So, I am not actually getting recording from line in using ecasound. A permissions problem? An alsamixer problem?

Geez. . . . . . . . . .. .
I never had to worry about alsamixer with mine. Did you get the behringer? I know those work 🙂
 
I ordered it and Amazon says it is supposed to arrive today. This whole thing has taught me a lot about the inner workings/commands for linux. I know that Linux has limited support for some advanced USB cards, one of mine is rather new, and suppose that is it.

The amount of time I have spent on this is mind-boggling.
 
My FiiO player can also function as an USB source. So, I mounted it on the RP3 and was able to play music files off of it through ecasound easily.

Looks like I am back where I started and can conclude that the problem is the cards themselves. I will check again when the Behringer arrives today.

Thanks All. I am going to put it to rest until my new thing arrives.

James
 
I got the Behringer and am using it as a line in (not phono in) and lo and behold it works. The reason I did not go the behringer route earlier is that it did not have multiple outputs. So, since the other soundcard worked as an output I am using the Behringer as the -i: input and the other card as -o: output.

The present command is working ecasound -z:mixmode,sum -x -a😛re -i:alsahw,1,0 -o:loop,1 -a:woofer,tweeter -i:loop,1 -a:woofer,tweeter -chorder:1,2,0,0 -a:tweeter -chorder:0,0,1,2 -a:woofer,tweeter -f:16,4,44100 -o:alsa,surround51:Audio

I am getting four channels of output. Now, I will build in the RTaylor filters and will be up and running. Wow, all along it was a hardware incompatibility problem. Thanks everyone! I wish I could buy you all a beer or two!

James
 
Well, I built up the RTaylor filters and it is working. There are considerable underruns but it works! I switched to the turntable running it through my Hafler DH-110 pre and I am getting some hum. I will chase that down but it works: line in, DSP, line out to a bi-amp setup for present.

Thanks again.
James
 
Last post

Hi, Since I have hijacked this post already I will make this the last one. The previous success I described before was on the RP3. I did exactly the same setup with the Odroid C2 and it will not properly record line in - even with the Behringer that works well as a line in on the RP3.

I get static and angry buzzing but underneath I can hear the audio signal.

There is probably a workaround but it will be a lot of work. I will post on the Odroid site and see if they can figure it out.

Thanks all and thanks for your patience and guidance.

James
 
I suppose

Yeah, the underruns are pretty significant. I will try to use a powered usb hub in the morning to see if that helps.

After all was said and done though, I realized that the reason I love the vinyl sound is that there is no analog to digital to analog conversion in the signal path when I go straight to a preamp/amplifier/speakers.

I am not sure I cared for the sound as much after I did all this. Ironic eh?

At least I know where things are wrong with the Odroid - quite disappointing actually. In reviewing their site/forums with a more critical eye, they are definitely not familiar with or skilled at the audio potential of their product.

I wish I knew more so I could help out. Thanks for your posts, suggestions and good cheer.

James
 
hello all,
4 years later.... I am trying to find out if i can use a raspberry pi as a server with EQ, that is, that the pi can read the music archives from a NAS (mostly FLAC), aply EQ and transmit wirelessly to other renderers in my house.
What is the best way (if any) to do this as of today?

thanks in advance for your comments!!

PS: i know it would be easier to use a pi with Moodeaudio as a renderer and EQ with moode, but my system is a commercial integrated renderer/DAC/amplifier that works with the manufacturer firmware, does not have EQ and does not allow me to install any software
 
Thanks Drone, those links seem an awesome source of information, will need a few days to go through them.
Still, i understand that this solution will not allow to stream wirelessly the eq-ed signal to another renderer, right? (remember in my system the renderer is built in the integrated amp)