ecasound -- ALSA issue

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi,


I build a crossover using ecasound. It used to work OK, but suddenly, stopped working.



I removed the crossover specs, pre.ecp is an empty file and I send the output to 2 different DACs (sound cards) using the simplified command
Code:
ecasound -z:nodb \
     -z:mixmode,sum -x \
         -a:pre   \
     -i:test.flac  -pf:pre.ecp         -o:loop \
         -a:woofer,tweeter -i:loop \
         -a:woofer -f:s24_le,2,44100  -o:alsahw,1 \
         -a:tweeter -f:s24_le,2,44100  -o:alsahw,2 \


and get the error
(eca-chainsetup) Opened output "alsahw", mode "write". Format: s24_le, channels 2, srate 44100, interleaved.
ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA: Error when setting up hwparams: Erreur
... d'entrée/sortie"

If I replace either card (1 or 2) by the dummy 0, each of my outputs play (one at a time) OK. However, I struggle without success to have them play both simultaneously.


As I told, it used to work OK and suddenly the issue I just described occurred, and I could never again play my speakers with the crossover.


Any clue will be much appreciated!


Jean-Pierre
 
Hi,


I build a crossover using ecasound. It used to work OK, but suddenly, stopped working.



I removed the crossover specs, pre.ecp is an empty file and I send the output to 2 different DACs (sound cards) using the simplified command
Code:
ecasound -z:nodb \
     -z:mixmode,sum -x \
         -a:pre   \
     -i:test.flac  -pf:pre.ecp         -o:loop \
         -a:woofer,tweeter -i:loop \
         -a:woofer -f:s24_le,2,44100  -o:alsahw,1 \
         -a:tweeter -f:s24_le,2,44100  -o:alsahw,2 \


and get the error
(eca-chainsetup) Opened output "alsahw", mode "write". Format: s24_le, channels 2, srate 44100, interleaved.
ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA: Error when setting up hwparams: Erreur
... d'entrée/sortie"

If I replace either card (1 or 2) by the dummy 0, each of my outputs play (one at a time) OK. However, I struggle without success to have them play both simultaneously.


As I told, it used to work OK and suddenly the issue I just described occurred, and I could never again play my speakers with the crossover.


Any clue will be much appreciated!


Jean-Pierre

You could try:

supplying the device number as part of -o alsahw. The format should look like:
-o[:]alsahw,card_number,device_number,subdevice_number
e.g.:
Code:
-o:alsahw,1,0

using the alternate device-name nomenclature:
-o[:]alsa,pcm_device_name, e.g.
Code:
-o:alsa,DAC

Above I use "DAC" as an example. To find out the device names on your system, use the command "aplay -L". Make sure to copy the device name verbatim from the output.

Do either of those fix the problem?
 
Last edited:
Hi again,


thanks for your suggestions!



I did not find out (quickly) how to reply itemwise to the message.


I did try to add subdevice numbers without success...


I also did try providing the actual names of the devices, and had partial failure since the named device was considered as "0"(a dummy device) and the other played OK.


Thanks again,


JPD
 
Thanks,


Code:
$ aplay -l
**** Liste des Périphériques Matériels PLAYBACK ****
carte 0: PCH [HDA Intel PCH], périphérique 0: ALC283 Analog [ALC283 Analog]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 0: PCH [HDA Intel PCH], périphérique 3: HDMI 0 [HDMI 0]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 1: Receiver [24bit USB Receiver], périphérique 0: USB Audio [USB Audio]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 2: II [Music Streamer II], périphérique 0: USB Audio [USB Audio]
  Sous-périphériques: 0/1
  Sous-périphérique #0: subdevice #0


Receiver is a Music Hall 25.3 and II a HRT music streamer II.


Both cards are able to play since by executing
Code:
         -a:woofer   -o:alsahw,0\
         -a:tweeter   -o:alsahw,2
the tweeter plays OK and by executing
Code:
         -a:woofer   -o:alsahw,1\
         -a:tweeter   -o:alsahw,0
the woofer plays OK, no error message in both cases.



I removed the
Code:
-f:s24_le,2,44100
to further simplify the script causing the error.



JPD
 
OK, very good. Let's proceed systematically, no need for any trial/error.

Card 0 is not dummy, but your internal Intel HDA.

Let's see capabilities and connections of your soundcards. Please output of:

Code:
aplay -v --dump-hw-params -D hw:0 /dev/zero
aplay -v --dump-hw-params -D hw:1 /dev/zero
aplay -v --dump-hw-params -D hw:2 /dev/zero
lsusb -t
 
Card 0 is not dummy, but your internal Intel HDA.
Yes, I know card 0 is my internal sound card, but it is a dummy with respect to my crossover project.
Let's see capabilities and connections of your soundcards.
Thank you so much, I did'nt know where to investigate!


Code:
$ aplay -v --dump-hw-params -D hw:0 /dev/zero
Lecture données brutes '/dev/zero' : Unsigned 8 bit, Fréquence 8000 Hz, Mono
HW Params of device "hw:0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 64]
CHANNELS: 2
RATE: [44100 192000]
PERIOD_TIME: (83 185760)
PERIOD_SIZE: [16 8192]
PERIOD_BYTES: [128 65536]
PERIODS: [2 32]
BUFFER_TIME: (166 371520)
BUFFER_SIZE: [32 16384]
BUFFER_BYTES: [128 65536]
TICK_TIME: ALL
--------------------
aplay: set_params:1299: Ce format d'échantillonage n'est pas disponible
Available formats:
- S16_LE
- S32_LE


Code:
$ aplay -v --dump-hw-params -D hw:1 /dev/zero
Lecture données brutes '/dev/zero' : Unsigned 8 bit, Fréquence 8000 Hz, Mono
HW Params of device "hw:1":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 24]
FRAME_BITS: [32 48]
CHANNELS: 2
RATE: [8000 96000]
PERIOD_TIME: [1000 16384000]
PERIOD_SIZE: [11 131072]
PERIOD_BYTES: [64 524288]
PERIODS: [2 1024]
BUFFER_TIME: (229 32768000]
BUFFER_SIZE: [22 262144]
BUFFER_BYTES: [88 1048576]
TICK_TIME: ALL
--------------------
aplay: set_params:1299: Ce format d'échantillonage n'est pas disponible
Available formats:
- S16_LE
- S24_3LE


Code:
$ aplay -v --dump-hw-params -D hw:2 /dev/zero
Lecture données brutes '/dev/zero' : Unsigned 8 bit, Fréquence 8000 Hz, Mono
HW Params of device "hw:2":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 24]
FRAME_BITS: [32 48]
CHANNELS: 2
RATE: [32000 96000]
PERIOD_TIME: [1000 4096000]
PERIOD_SIZE: [32 131072]
PERIOD_BYTES: [128 524288]
PERIODS: [2 1024]
BUFFER_TIME: (666 8192000]
BUFFER_SIZE: [64 262144]
BUFFER_BYTES: [256 1048576]
TICK_TIME: ALL
--------------------
aplay: set_params:1299: Ce format d'échantillonage n'est pas disponible
Available formats:
- S16_LE
- S24_3LE


Code:
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 1: Dev 11, If 0, Class=Hub, Driver=hub/7p, 480M
        |__ Port 2: Dev 13, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 3: Dev 16, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 7: Dev 12, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 7: Dev 12, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 7, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 1: Dev 7, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 2: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 15, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 15, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 3: Dev 15, If 3, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 15, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
 
From the output you posted, I think the problem may stem with the format that you are telling ecasound to use with cards 1 and 2. You use:
Code:
-f:s24_le,2,44100
But the output of the card capabilities shows support for S24_3LE, which is different than S24_LE. Unfortunately I think that the S24_3LE format is not supported by ecasound. Try to use S16_LE as the output format and see if the ecasound chain setup works.

The other think you might try is using S32_LE as the output format in ecasound
Code:
-f:s32_le,2,44100
If you are lucky, ALSA will convert that to S24_3LE by trucation.

Phofman may be able to help you create a custom device in .asoundrc that does this conversion. In that case you would play to the ALSA device, which will pass it on to the sound card.
 
From the output you posted, I think the problem may stem with the format that you are telling ecasound to use with cards 1 and 2. You use:
Code:
-f:s24_le,2,44100


I removed this part, and then tried to replace it by either


  • s16_le ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA: Error when setting up hwparams: Input/output
    ... error"
  • s24_3le ERROR: [ECA-SESSION] : "Unable to parse sample format "s24_3le" passed to -f."
  • s32_le ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA: Audio format not supported."
  • nothing ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA: Error when setting up hwparams: Input/output
    ... error"
Also, I have this curious message:
Code:
(eca-chainsetup) NOTE: using existing audio parameters -f:f32_le,2,44100 for object 'loop' (tried to open with
... -f:s16_le,2,44100).
Notice the f32_le that comes from I don't know where...


Despite this strange message, replacing one output (card 1 or 2) by the internal card0 allows to hear the other one; the message is still displayed but the woofer/tweeter plays OK.


JPD
 
Ecasound format s24_le corresponds to alsa S24_3LE.

f32_le is floating point 32bit, IMO internal ecasound format, used e.g. by jackd too. That message is just an info ecasound/eca-chainsetup.cpp at 0d4439a12469b4fc04afebb3ae1128f4042092b9 * skakri/ecasound * GitHub

Since both USB soundcards work with the same params when run independently, I would suspect the USB layer. Perhaps the 24bit altsetting requires switching to higher speed and the hub refuses to switch both ports at the same time.

First I would try plugging the other USB soundcard to some other port - e.g. attaching all 1.5Mbps HIDs to port 2 and attaching the other soundcard to port 1 with the 480Mbps USB mass storage - look at the usb tree output of lsusb -t.
 
Are both the Music Hall 25.3 and the HRT music streamer II connected via USB? What is the computer hardware you are using?

Do you know that both can playback together, simultaneously, using another program or programs?

For example, if you run both of these commands (each in a different terminal window):
Code:
ecasound -i tone,sine,200 -f:s16_le,2,44100 -o alsa,Receiver
and
Code:
ecasound -i tone,sine,300 -f:s16_le,2,44100 -o alsa,II
Do both reproduce the tone at the same time?
 
Thank you all, I changed the usb port in which one of the sound cards was plugged in, and it seems to fix my issue.


I now can play my speakers (woofer and tweeter) and pursue the fine tuning of my Xover!


I use as computer audio server (which also performs the Xover) a rather old laptop Aspire E3 111. Perhaps it is time to upgrade!


Thank you again to all for this discussion, in which I succeeded to fix my issue and moreover, learned many points about Alsa and usb.


I use ecasound from within MPD, I need now to learn how to have my Xover accept many formats (higher rez) as piped by MPD, but this will be for another discussion.



Jean-Pierre
 
Actually, I interchanged a USB-hub (on which 2 hard discs are plugged, as well as a mouse) with my sound card. I have a total of 3 usb ports on the laptop and obviously need more than that.



Code:
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 1: Dev 19, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 19, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 19, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 19, If 3, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 7, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 1: Dev 7, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 2: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 20, If 0, Class=Hub, Driver=hub/7p, 480M
            |__ Port 7: Dev 23, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 7: Dev 23, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 3: Dev 22, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 21, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
 
Thanks. Please can you post another lsusb -t when both usb soundcards are playing the 24bits? I would really like to see if any USB speed change occurs.


Here are 2 outputs of lsusb -t, one when idle, one when playing 24/96000 (I choose a Hi Res file).



First, idle, no music playing.

Code:
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 2, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 2, If 3, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 10, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 1: Dev 10, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 2: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 7, If 0, Class=Hub, Driver=hub/7p, 480M
            |__ Port 3: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M


Playing
Code:
(eca-chainsetup) Opened output "alsa", mode "write". Format: s24_le, channels 2, srate 96000, interleaved.
(eca-chainsetup) Opened output "alsa", mode "write". Format: s24_le, channels 2, srate 96000, interleaved.


Code:
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 2, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 2, If 3, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 10, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 1: Dev 10, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 2: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 7, If 0, Class=Hub, Driver=hub/7p, 480M
            |__ Port 3: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M


They look identical to my untrained eye.





Which USB hub model is the one which could not handle both soundcards simultaneously?


The laptop I use as a sound server has 3 usb ports (left, back1 and back2) .I previously (when facing the error messages) had


  • left: one sound card ,
  • back1: other sound card ,
  • back2: hub (2 hard discs, mouse).
I switched to

  • left: hub,
  • back1: soundcard,
  • back2: soundcard.
and I now can play both sound cards without issue. The hub is not identified.



Thank again for your help!


Jean-Pierre
 
Thanks a lot for the info update. Yes, the USB speed did not change when soundcard was operating, very useful to learn.

So the culprit was the internal USB hub in the notebook which apparently could not handle the increased flow from multiple connected devices. Interesting. Thanks!
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.