Artless idea for a 2way x-o

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Thanks for your reply.
I'm a noob i don't get any bit of you write.

1. I have no file named asound.conf and don't know what to enter and where to store.
2. aplay -Dplug:myalsadevice says
Code:
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM alsadevice
aplay: main:722: Fehler beim Öffnen des Gerätes: Datei oder Verzeichnis nicht gefunden
3. I don't know how.
I found some tutorials in the web.
They all start with 'pacmd list-sources' or list-sink.
But my pc says that pulseaudio is not running.

Sorry, I did not see your posts until now. It seems you would like to use some other software (your 'player' that you mention) to play audio files, stream audio, etc. and have that processed by ecasound as you do when you call ecasound and use a file (e.g. an mp3 file) as input. I will proceed with that assumption in place.

As Jerms mentioned, you need to install the ALSA loopback. This installs a new virtual sound card on your system called "Loopback". It is essentially a way to connect the output of one program to the input of another via ALSA. The Loopback card consists of 8 separate devices that are like "pipes", each pipe having two "ends". Each "pipe end" is a subdevice of the device in the card. So, let's begin.

To temporarily (until the next reboot) install the ALSA Loopback card, execute the following at the command prompt:
Code:
sudo modprobe snd-aloop
If there is an error message generated that snd-aloop cannot be found, let me know. Usually that is not the case. Next, run
Code:
aplay -l
You should now see a new card listed called 'Loopback'. Note the card number for it (in this case it will likely be the last one listed).

Next, open your player software. Go to the menu or configuration page where you can choose which audio output to use. You should also see the Loopback listed there, possibly with multiple possibilities for "front" and "5.1", "7.1" etc. I suggest you choose one of the two channel options, like "front". Next, select a music track or stream and play it.

Now in a terminal window you will run ecasound as before, except you need to specify the Loopback as input instead of an mp3 filename. This is where you need to know the card number for the Loopback because you likely also need to specify which subdevice (the pipe end) to use. So we will use the format (taken from the ecasound manpage):
Code:
-i[:]alsahw,card_number,device_number,subdevice_number
Let's say the Loopback card number is 'Y'. First try device 0, subdevice 1 as input like this:
Code:
-i:alsahw,Y,0,1
Substitute the actual Loopback card number for 'Y' above. If that doesn't work or produces an error, kill ecasound and then try it again but changing the subdevice to '0'. I am never sure which pipe end the source program will choose!

Hopefully you will be up and running. If not, let me know.

Once that works we want to permanently have the Loopback as one of the available audio cards on the system. To do this you only need to add the snd-aloop at the end of the list of modules in the file /etc/modules (there may not be modules listed when you open the file). This will automatically load the Loopback module at bootup, but the card number will probably change to 0 (it will be loaded first before other cards in the system). So you will need to change the card number used to reference it in the ecasound command.
 
Hi Charlie,
thanks for your reply.
I didn't manage to get it running like you described it.
I see one loopback card with two devices and eight channels each.
I will try out all combinations of devices and channels as soon as i'm in the mood again.
Please excuse me that the project has lower priority in the next few weeks.
I have a big project going that has nothing to do with audio, but with prosperity for my family for the next decades.

If everything turns out how i want it, i will have much time for a lot of audio projects....
Nonetheless i will report and ask questions about the filters on the rpi.
The missing audio input is giving me a bit of a headache aleady...
 
OK, let me think through this out loud again here...

Ecasound will be taking in (capturing) audio from the output of the ALSA Loopback. This is like recording, so you should use arecord to list cards. You should see the Loopback listed (from arecord -l) like this:
Code:
**** List of CAPTURE Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  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: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  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

NOTE: The card number for the Loopback in your system may be different.

So using the ecasound input format:
Code:
-i[:]alsahw,card_number,device_number,subdevice_number
You should be able to say something like
-i:alsahw,X,Y,Z
Where
X=card number
Y=device number
Z=subdevice number

Also, I think I was incorrect in my last post regarding device and subdevice. It's been awhile since I set this up and I'm just writing this off the top of my head... Try using the first subdevice (subdevice number zero) or omitting it completely from ecasound. The two ends of the "pipes" like I described before are device 0 and device 1, with each pipe a subdevice. In that case, we should specify as part of the ecasound command string:
Code:
-i:alsahw,X,1,0
or you can try
Code:
-i:alsahw,X,1
The second is with the subdevice omitted since we are using the first one and that it often the default, especially for programs that do not allow you to specify an ALSA subdevice. Substitute your card number for X. You may need to do some trial and error by playing sound from your player software to the Loopback and then trying device 0 or 1 in ecasound to get it to pick up the other end of the pipe. Once you know which device to specify in ecasound for the Loopback input you can stick with that one.

There is also the ecasound ALSA input format that is specified by device name, e.g.:
Code:
-i[:]alsa,pcm_device_name
To get the complete pcm_device_name text you need to run arecord -L and then select one of the Loopback modes listed, e.g.
Code:
-i:alsa,"front:CARD=Loopback, DEV=0"
Again, you may need to change DEV=0 to DEV=1 depending on which end of the pipe you need to connect to. It's a bit of a mystery to me which one to use, because when you look at the output from aplay -L (playback devices) and arecord -L (record devices) they BOTH list DEV=0 and they cannot both use that at the same time. Playback uses one and record should use the other, but they may be interchangeable because the pipe can be used in both the 0-->1 and 1-->0 "directions".

Finally, remember that after each reboot you will need to run sudo modprobe snd-aloop again until you include snd-aloop to the /etc/modules file.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.