ecasound crossover issue with Line in

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello,
I'm trying to build a crossover with delay on 2 channels of three ina 5.1 environment. Ihave a no sound while trying to use my line in as input with esound .
I followed the famous :

Digital Crossover/EQ with Open-Source Software: HOWTO | Richard's Stuff

when i send a sound file, ie :

Code:
ecasound -z:mixmode,sum -x  -a:pre1 -i:Echo-Logik.mp3 -pf:pre1.ecp -o:loop,1 \  -a:pre2,woofer -i:loop,1  -a:mid,tweeter -i:loop,2 -a:pre2 -pf:pre2.ecp -o loop,2 -a:woofer \ -pf:woofer.ecp -el:delay_1s,0.2,1 -chorder:1,2,0,0,0,0   -a:mid -pf:mid.ecp \ -chorder:0,0,1,2,0,0  -a:tweeter -pf:tweeter.ecp -el:delay_1s,0.2,1 -chorder:0,0,0,0,1,2 \      -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0

if i try with the system inputline,
Code:
ecasound -z:mixmode,sum -x \
         -a:pre1 -i:alsa,hw:CARD=MID,DEV=0 -pf:pre1.ecp -o:loop,1 \
         -a:pre2,woofer -i:loop,1 \
         -a:mid,tweeter -i:loop,2 \
         -a:pre2 -pf:pre2.ecp -o loop,2 \
         -a:woofer -pf:woofer.ecp -el:delay_1s,0.25,1 -chorder:1,2,0,0,0,0  \
         -a:mid -pf:mid.ecp  -chorder:0,0,1,2,0,0 \
     -a:tweeter -pf:tweeter.ecp -el:delay_1s,0.25,1 -chorder:0,0,0,0,1,2  \
         -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,hw:CARD=MID,DEV=0


i have no sound output at all, but a continued snorring on my loudspeakers, and warnings

Do you know whats wrong with this script ?

I would be happy to discuss and debug this script with you

regards,

Tonio
[/I]
 
Always troubleshoot step by step.

First I would make sure the playback part works fine. The difference between first and second lines in the playback part is the -o:alsa,surround51:CARD=MID,DEV=0 vs. -o:alsa,hw:CARD=MID,DEV=0 . Only after getting this part right using a standard audio file, troubleshoot the capturing part.
 
Hello,
i tried the following to identify my which hw I have to use, or which entry I have to put in the input line -i


Code:
cat /proc/asound/card0/pcm0c/info
card: 0
device: 0
subdevice: 0
stream: CAPTURE
id: ALC670 Analog
name: ALC670 Analog
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

but this doesn't function. I tried to read the ecasound ALSA section under the heading "INPUT/OUTPUT SETUP" but I still don't get the card_number,device_number,subdevice_number, identifying my Input Line. How do I know which number the line in is ?


Another question: Am i right right to use the input line as input for ecasound : I want to catch all the audio ( example i play a youtube video ) and put a delay on 2 channels in a 5.1 configuration
 
Hello,
i tried the following to identify my which hw I have to use, or which entry I have to put in the input line -i


Code:
cat /proc/asound/card0/pcm0c/info
card: 0
device: 0
subdevice: 0
stream: CAPTURE
id: ALC670 Analog
name: ALC670 Analog
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

but this doesn't function. I tried to read the ecasound ALSA section under the heading "INPUT/OUTPUT SETUP" but I still don't get the card_number,device_number,subdevice_number, identifying my Input Line. How do I know which number the line in is ?


Another question: Am i right right to use the input line as input for ecasound : I want to catch all the audio ( example i play a youtube video ) and put a delay on 2 channels in a 5.1 configuration

There is a much easier way to identify card and device numbers using aplay. Run the command:
Code:
aplay -l
to get a list of playback cards and devices, and
Code:
arecord -l
to get a list of record (input) cards and devices.
(that is a small "L" at the end)
You should get output listing cards and their devices. Typically there is only one subdevice and most of the time you can omit that part of any reference to card,device,subdevice. I'm not near a linux box or I would give you an example of the output. THIS PAGE shows some typical output it the first couple of answers.

Once you know the ALSA card and device number it is easy to specify them in ecasound using -o:alsahw,card,device (I omitted the subdevice).

Hope that gets you going. If not just let us know and we will try to help.
 
Hello Charlie,
thanks for the message, I already tried and gave
Code:
-i:alsahw,0,0
as Input, identified by
Code:
aplay -l
but I have the same Issue : the sound is snorring on all my 6 loudspeaker and no sound is coming from youtube for example.
Also, Until now, i couldn't see a difference between input hardware ID, and output hardware ID, all both identified with hw,0,0. Is this normal ?
Many regards,
Tonio
 
Hello Charlie,
thanks for the message, I already tried and gave
Code:
-i:alsahw,0,0
as Input, identified by
Code:
aplay -l
but I have the same Issue : the sound is snorring on all my 6 loudspeaker and no sound is coming from youtube for example.
Also, Until now, i couldn't see a difference between input hardware ID, and output hardware ID, all both identified with hw,0,0. Is this normal ?
Many regards,
Tonio

aplay is for listing OUTPUT cards/devices only!

arecord will list your INPUT cards/devices. Input and output devices are assigned separately.

I believe that even if your physical audio device has both inputs and outputs, depending on how many other system input and output devices are present and the order in which the OS is listing them, the input card number may be different than the output card number for the same physical device. At least I believe that is possible. For instance, if the system hardware has only an output device but no input device, and you add some USB audio interface that has both outputs and inputs, it may be assigned card 1 for output but card 0 for input.

Please check your own system. You can post the results of aplay and arecord here (make sure to use CODE tags for the output - highlight the text and then click on the "#" icon just above the top of the forum message input window).

Let me know what you find. Once it is clear that you are routing input to, and sending output from, ecasound we can move on to trying to diagnose and fix the other problems that you are having.
 
Last edited:
Card number is for a card, assigned by alsa kernel subsystem when the card is recognized by the driver. In alsa device strings card can also be identified (preferrably) by its name. The directory structure in /proc/asound shows it - upper level is the card directory, its subdirectories describe individual capture or playback devices.
 
@ charlie
Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC670 Analog [ALC670 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 1: ALC670 Digital [ALC670 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
and

Code:
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC670 Analog [ALC670 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
@phofman

which file would have the information ?

Code:
/proc/asound$ ls
card0  cards    HDMI   MID      pcm  timers
card1  devices  hwdep  modules  seq  version
 
I tried to read the ecasound ALSA section under the heading "INPUT/OUTPUT SETUP" but I still don't get the card_number,device_number,subdevice_number, identifying my Input Line. How do I know which number the line in is ?


Another question: Am i right right to use the input line as input for ecasound : I want to catch all the audio ( example i play a youtube video ) and put a delay on 2 channels in a 5.1 configuration

Thanks for posting the output from aplay and arecord. So it looks like alsahw,0,0 is correct for both input and output in ecasound, however, this is taking input from the analog input of the card "MID". I'm not sure that is what you want based on your question about playback from a youtube video, which I assume is on the same computer. Were you using the analog inputs?

The software that is playing the youtube video needs to send the audio to ecasound so that it can apply the delay you mentioned, or any other audio processing that you desire. This is joining an output to an input. There are a couple of ways to do that - you can use a pipe (not sure that will work in this case) or you can use an audio 'loopback'. ALSA has a loopback "card" but it is not enabled by default. You can enable it for the current session using the command:
Code:
sudo modprobe snd-aloop
Now when you run aplay and arecord you will see a new card called 'Loopback'. The software playing the youtube video should play the audio to the loopback card, device 0 and then ecasound should use as input the loopback card, device 1. As before, you must specify the audio format for ecasound (sample rate, channels, and bit depth)
This is not totally complete on the details of how to do this, but I wanted to give an overview first. Let me know if you want to try this. Otherwise you might try the analog inputs to see if that works.
 
Hello,
i did what you said about creating a loop device, and it runs perfect.
BUT I have no 5.1 sound.
When I try
Code:
ecasound -tl -i chan_labels_6.wav -f:16,6,44100 -o alsahw,surround51,0,0
I have a "bad " 5.1 sound giving a lot of snorring in Right MID and both tweeter, and a message giving me :


Code:
WARNING: ALSA playback underrun, glitches in audio playback possible! Break was at least -1153957696.38 ms long.
If I try

Code:
ecasound -z:mixmode,sum -x \
         -a:pre1  -i:chan_labels_6.wav -f:16,6,44100  -pf:pre1.ecp -o:loop,1 \
         -a:pre2,woofer -i:loop,1 \
         -a:mid,tweeter -i:loop,2 \
         -a:pre2 -pf:pre2.ecp -o loop,2 \
         -a:woofer -pf:woofer.ecp -chorder:1,2,0,0,0,0  \
         -a:mid -pf:mid.ecp  -chorder:0,0,1,2,0,0 \
     -a:tweeter -pf:tweeter.ecp -chorder:0,0,0,0,1,2  \
         -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0
i have no 5.1 but a single 2way channel output

with
Code:
**************************************************************************
*        ecasound v2.9.1 (C) 1997-2014 Kai Vehmanen and others    
**************************************************************************
(eca-chainsetup-parser) Enabling 'sum' mixmode.
(eca-chainsetup-parser) Truncating outputs (overwrite-mode).
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
(eca-chainsetup) Chainsetup "untitled-chainsetup"
(eca-chainsetup) "rtlowlatency" buffering mode selected.
(eca-chainsetup) NOTE: using existing audio parameters -f:s16_le,6,44100
... for object 'chan_labels_6.wav' (tried to open with -f:s16_le,2,44100).
(eca-chainsetup) Opened input "chan_labels_6.wav", mode "read". Format:
... s16_le, channels 6, srate 44100, interleaved (locked params).
(eca-chainsetup) NOTE: using existing audio parameters -f:f32_le,6,44100
... for object 'loop' (tried to open with -f:s16_le,6,44100).
(eca-chainsetup) Opened input "loop", mode "read". Format: f32_le, channels
... 6, srate 44100, interleaved (locked params).
(eca-chainsetup) NOTE: using existing audio parameters -f:f32_le,6,44100
... for object 'loop' (tried to open with -f:s16_le,6,44100).
(eca-chainsetup) Opened output "loop", mode "write". Format: f32_le,
... channels 6, srate 44100, interleaved (locked params).
(eca-chainsetup) Opened input "loop", mode "read". Format: f32_le, channels
... 6, srate 44100, interleaved (locked params).
(eca-chainsetup) Opened output "loop", mode "write". Format: f32_le,
... channels 6, srate 44100, interleaved (locked params).
(eca-chainsetup) Opened output "alsa", mode "write". Format: s16_le,
... channels 6, srate 44100, interleaved.
- [ Connected chainsetup: "untitled-chainsetup" ] ------------------------
- [ Controller/Starting batch processing ] -------------------------------
- [ Engine - Driver start ] ----------------------------------------------

- [ Engine - Processing finished ] ---------------------------------------
- [ Controller/Batch processing finished (0) ] ---------------------------
- [ Controller/Processing stopped (cond) ] -------------------------------
- [ Engine exiting ] -----------------------------------------------------
(eca-control-objects) Disconnecting chainsetup:  "untitled-chainsetup".
Do you know whats happening ? Maybe it's normal but i would think the 6 way crossover would give me a 5.1 surround. Do you have some idee on how I could try my self to debug it ?

Regards !
 
Let's look at this ecasound script:
Code:
ecasound -z:mixmode,sum -x \
         -a:pre1  -i:chan_labels_6.wav -f:16,6,44100  -pf:pre1.ecp -o:loop,1 \
         -a:pre2,woofer -i:loop,1 \
         -a:mid,tweeter -i:loop,2 \
         -a:pre2 -pf:pre2.ecp -o loop,2 \
         -a:woofer -pf:woofer.ecp -chorder:1,2,0,0,0,0  \
         -a:mid -pf:mid.ecp  -chorder:0,0,1,2,0,0 \
         -a:tweeter -pf:tweeter.ecp -chorder:0,0,0,0,1,2  \
         -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0
I see some potential problems:
  • You do not specify any kind of buffering. I would add -B:rt to the first line.
  • You don't need the -x option - you can remove it.
  • You are telling ecasound in line 2 that your input has 6 channels yet on the lines for woofer mid and tweeter lower down you are assigning only channels 1 and 2 from the input file to the output. This might be why you only hear channels 1 and 2 and think that there is only 2 channel audio being processed.
I would change these to something like:
Code:
         -a:woofer -pf:woofer.ecp -chorder:1,2,0,0,0,0  \
         -a:mid -pf:mid.ecp  -chorder:0,0,3,4,0,0 \
         -a:tweeter -pf:tweeter.ecp -chorder:0,0,0,0,5,6  \
After making that change you should hear all of the channel labels, just through different output channels/drivers.

Let me know if that helps.
 
So, i made a test :
Code:
ecasound -z:mixmode,sum -B:rt       \
   -a:pre1 -i:chan_labels_6.wav -f:16,6,44100 -pf:pre1.ecp -o:loop,1 \
   -a:pre2,woofer -i:loop,1 \
   -a:mid,tweeter -i:loop,2  \
   -a:pre2 -pf:pre2.ecp -o loop,2 \
   -a:woofer -pf:woofer.ecp -chorder:0,0,0,0,1,2 \
   -a:mid -pf:mid.ecp -chorder:3,4,0,0,0,0 \
   -a:tweeter -pf:tweeter.ecp -chorder:0,0,5,6,0,0 \
   -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0
sounds perfect. I change my device oder as you can see in the
Code:
-chorder,
so that the plugs corresponds to what I have without ecasound.

But changing the input line to
-i:alsahw,2,1 corresponding to my loop doesn't give a 5.1 sound : it only plays on my woofer while playing a youtube file or a 5.1 sound file with VLC.

I suspect that my loop doesn't give a 6 channel output ?

here are my aplay and arecord outputs :

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC670 Analog [ALC670 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 1: ALC670 Digital [ALC670 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: 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 2: 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
Code:
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC670 Analog [ALC670 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: 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 2: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 7/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
 
The ecasound man page says this about the format specifier (-f option below):
-f:sample_format,channel,sample-rate,interleaving
Sets the audio stream parameters for subsequent audio objects. If no '-f' option is specified, or some of the argument fields are left empty (e.g. '-f:,2,44100'), ecasound will use default values. These default values are defined in ecasoundrc configuration file.
Since you invoke the format specifier AFTER specifying the input, at the time that the input is specified the program is likely using the default format, which is 16bits, 2 channel 44.1 kHz. Because the default specifier is for 2 channels, any additional channels are (I think) just dropped.

Try moving the format specifier location so that it is before the input specifier. Like this:
Code:
-a:pre1 -f:16,6,44100 -i:chan_labels_6.wav -pf:pre1.ecp -o:loop,1 \
That's my guess at the problem at least! Let me know if that works.
 
Hello Charlie,


first I use a tool to put my sound to loop-output (see scrennshot).

then, if I first enter :

Code:
ecasound -z:mixmode,sum -B:rt \
         -a:pre1  -f:16,6,44100 -i:alsahw,2,1  -pf:pre1.ecp -o:loop,1          \
     -a:pre2,woofer -i:loop,1 \
         -a:mid,tweeter -i:loop,2 \
         -a:pre2 -pf:pre2.ecp -o loop,2 \
         -a:woofer -pf:woofer.ecp -el:delay_1s,0.2,1 -chorder:0,0,0,0,1,2  \
         -a:mid -pf:mid.ecp  -chorder:3,4,0,0,0,0  \
     -a:tweeter -pf:tweeter.ecp -el:delay_1s,0.2,1 -chorder:0,0,5,6,0,0 \
         -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0
I have no sound and the video is freezing if I try to play a youtube video.


If I first play the video in Youtube, and then give the same code, I have an error message :

Code:
ecasound -z:mixmode,sum -B:rt          -a:pre1  -f:16,6,44100 -i:alsahw,2,1  -pf:pre1.ecp -o:loop,1           -a:pre2,woofer -i:loop,1          -a:mid,tweeter -i:loop,2          -a:pre2 -pf:pre2.ecp -o loop,2          -a:woofer -pf:woofer.ecp -el:delay_1s,0.2,1 -chorder:0,0,0,0,1,2           -a:mid -pf:mid.ecp  -chorder:3,4,0,0,0,0   -a:tweeter -pf:tweeter.ecp -el:delay_1s,0.2,1 -chorder:0,0,5,6,0,0          -a:woofer,mid,tweeter -f:16,6,44100 -o:alsa,surround51:CARD=MID,DEV=0
**************************************************************************
*        ecasound v2.9.1 (C) 1997-2014 Kai Vehmanen and others    
**************************************************************************
(eca-chainsetup-parser) Enabling 'sum' mixmode.
(eca-chainsetup-parser) Buffering mode 'rt' selected.
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
(eca-chainsetup) Chainsetup "untitled-chainsetup"
(eca-chainsetup) Multitrack-mode enabled.
(eca-chainsetup) "rt" buffering mode selected.
ERROR:  Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA:
... Channel count 6 is out of range!"
 

Attachments

  • Screenshot from 2017-01-24 13:12:54.png
    Screenshot from 2017-01-24 13:12:54.png
    738.2 KB · Views: 62
But changing the input line to
-i:alsahw,2,1 corresponding to my loop doesn't give a 5.1 sound : it only plays on my woofer while playing a youtube file or a 5.1 sound file with VLC.

I suspect that my loop doesn't give a 6 channel output ?
OK, let's check on the source first. When playing the 5.1 track in VLC are you choosing the output Audio Device (menu item Audio > Audio Device) called "Loopback, Loopback PCM 5.1 Surround output to front, center, and rear speakers"? If instead you choose a different Loopback mode with a different number of channels, this may be causing the ecasound error because it is expecting 6 channels.

Also, try starting up and playing the track in VLC first before starting ecasound. With an ALSA Loopback, the order that the applications are first connected to the loopback is what sets the parameters (sample rate, channels, etc.) of the loopback process. Not until all inputs and outputs are disconnected can these properties be changed. So when testing try to always start the source before launching ecasound.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.