help with iec958 input through Ecasound crossover

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi, I need a little help setting up the optical input of my usb sound card to play through my ecasound crossover. I’ve used the current setup for a couple of years playing music files or netflix from the computer with no problems. This is the crossover I’ve been using:

#!/bin/sh -e
ecasound -d -n:3way \
-B:rt -z:mixmode,sum -z:nointbuf -f:16,2,44100 \
-a:pre1 -i:alsahw,2,1 -el:RTlr4hipass,20 -o:loop,1 \
-a:pre2,subs -i:loop,1 \
-a:pre2 -el:RTlr4hipass,100 -o:loop,2 \
-a:mids,tweeters -i:loop,2 \
-a:subs -el:RTlr4lowpass,100 -eadb:10 -chorder:0,0,0,0,1,2 \
-a:mids -el:RTlr4lowpass,1800 -chorder:1,2,0,0,0,0 \
-a:tweeters -el:RTlr4hipass,1800 -eadb:-8 -chorder:0,0,1,2,0,0 \
-a:tweeters,mids,subs -f:16,6,44100 -o:loop,3 \
-a:delay -i:loop,3 -el:mTAP,0,0,1.9,1.9,0,0 -o:alsa

where alsahw,2,1 is the loopback card
OptiPlex-780:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD1984A Analog [AD1984A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: AD1984A Alt Analog [AD1984A Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 2: Loopback [Loopback], device 0: 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
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

But now I want audio from TV (optical cable) to soundcard to ecasound..and then back out to speakers.. so I configured pavu control to have
CM106 Like Sound Device to have Profile: Analog Surround 5.1 Output+Digital Stereo (IEC958) Input.
Loopback has Profile: analog Stereo Duplex.
On the input tab I can see the orange line moving under the IEC958 input device... but there’s no sound. And on the PAVU control playback tab, there is nothing using the loopback.

(I should mention that when trying the optical input, I had alsamixer PCM Capture set to “iec958 in” and not “Line”).

I must have something configured incorrectly, but I can’t figure it out. I’d appreciate any help.
 
IIUC your ecasound setup is alsa-only, no pulseaudio.

If that is the case, first I would disable in pulseaudio all the soundcards involved in your chain, so that they are left to alsa clients.

Then alsamixer -c ID (plus checking with amixer contents).

I have an 8channel CM106 too, the TOSLINK input works OK only with 48kHz.

Build the chain step by step and always make sure the previous step is working correctly. I would start with making sure the SPDIF input works OK - check with e.g. arecord. Also, make sure the input receives data. When the spdif data stops, the whole chain will get blocked, some cards may not like it.
 
Hi, thanks for the responses. I am using pulseaudio actually. I tried this tonight:
arecord hw:1,0 -d 10 /tmp/test-opticalin.wav
(where device 1 is the usb card)
and then
aplay /tmp/test-opticalin.wav
and managed to record some static-ish noise. Not ideal, but better than silence. Also on the good side in pavu control I did see things appear on the recording tab.. with an option to select the iec958 input (which gave me that static).
I'll try some more experimenting tomorrow and report back.

Gordon
 
IMO mixing alsa and PA will get you stuck eventually. Your ecasound chain is alsa only, do not put PA into the mix. PA will acquire the soundcard, making it inaccessible (device busy) to alsa clients (e.g. ecasound). Also changing controls via PA can lead to undesired behavior is alsa clients are used.
 
If your soundcard has multiple inputs (mic, line-in, optical, digital?), then it may well be that the default input device is NOT the optical.

AMIXER can be used view the current setup and AMIXER CSET (or is it SET?) used to select the correct input device.

It's probably possible to do this with ALSAMIXER but I haven't tripped over the method so far on my travels.

Also, also, some soundcards have a "relay" or play-through function where input is echoed through to the speakers. Certainly my CM6206LX cheapie can do this. It can be annoying if you think it's all working, only to discover that only 2 of 4 channels are playing and there's no filtering occurring.
 
I tried changing the format
-f:16,2,41000 --> -f:16,2,48000 in line 2 and line 10
and also the input
-i:alsahw,2,1 --> -i:alsahw,1,0 [2,1 was the analog loopback. 1,0 is the USB which was fed by the optical input]
and so with this crossover..

#!/bin/sh -e
ecasound -d -n:3way \
-B:rt -z:mixmode,sum -z:nointbuf -f:16,2,48000 \
-a:pre1 -i:alsahw,1,0 -el:RTlr4hipass,20 -o:loop,1 \
-a:pre2,subs -i:loop,1 \
-a:pre2 -el:RTlr4hipass,100 -o:loop,2 \
-a:mids,tweeters -i:loop,2 \
-a:subs -el:RTlr4lowpass,100 -eadb:10 -chorder:0,0,0,0,1,2 \
-a:mids -el:RTlr4lowpass,1800 -chorder:1,2,0,0,0,0 \
-a:tweeters -el:RTlr4hipass,1800 -eadb:-8 -chorder:0,0,1,2,0,0 \
-a:tweeters,mids,subs -f:16,6,48000 -o:loop,3 \
-a:delay -i:loop,3 -el:mTAP,0,0,1.9,1.9,0,0 -o:alsa

I got a good loud blast of noise (similar to what I got with arecord, but louder). I think the tweeters survived.

So is using -f:16,2,48000 not correct for iec958? What am I missing here?
On the positive side - I think I have achieved digital-type noise passing through the crossover to the speakers. Just the wrong kind of noise.
 
Thanks for asking that.. there were more options than I thought .. It was set to optical out, but under another menu there was an option for PCM vs dolby digital. So I've set that to PCM. I'll start again. This may take a while, I don't get much time to experiment with this. I appreciate the input.
 
Well, I thought this might take me a month, but I got lucky and hit the right combination this time. I've got sound!
Here's what worked in case this helps anyone else:

TV is now putting out PCM (not dolby digital) through the optical out..
I set alsamixer to have my usb soundcard set to s/pdif enabled, and pcm capture enabled.
And then on the PAVU configuration tab set everything to 'off' (so no more pulse audio).
and I used this suggestion from charlie laub in another thread here..
ecasound -B:rt -f:16,2,44100 \
-i:alsa,iec958:CARD=Device,DEV=0 \
-o:alsa,front:CARD=Device,DEV=0
and changed it to this
ecasound -B:rt -f:16,2,48000 -i:alsa,iec958:CARD=Device,DEV=0 -o:alsa,front:CARD=Device,DEV=0
and I got TV (optical pcm) sound, but not a crossover.
So then I adapted my crossover to match it more or less (inputs, outputs, and -f are changed)
So the crossover is now:
#!/bin/sh -e
ecasound -d -n:3test \
-B:rt -z:mixmode,sum -z:nointbuf -f:16,2,48000 \
-a:pre1 -i:alsa,iec958:CARD=Device,DEV=0 -el:RTlr4hipass,20 -o:loop,1 \
-a:pre2,subs -i:loop,1 \
-a:pre2 -el:RTlr4hipass,100 -o:loop,2 \
-a:mids,tweeters -i:loop,2 \
-a:subs -el:RTlr4lowpass,100 -eadb:10 -chorder:0,0,0,0,1,2 \
-a:mids -el:RTlr4lowpass,1800 -chorder:1,2,0,0,0,0 \
-a:tweeters -el:RTlr4hipass,1800 -eadb:-8 -chorder:0,0,1,2,0,0 \
-a:tweeters,mids,subs -f:16,6,48000 -o:loop,3 \
-a:delay -i:loop,3 -el:mTAP,0,0,1.9,1.9,0,0 -o:alsa,surround51:CARD=Device,DEV=0

So the good news.. it worked. TV plays through ecasound crossover.
Slightly less good. The TV remote does not control the volume of optical out, so the only TV volume control I have is to adjust 3 separate sliders in alsamixer. Not exactly elegant.

Also a bit awkward is that to switch from TV (iec958) to music (flac files) I need to change crossovers in the terminal (fine for me, but not so simple for young ones in the family).

thanks for the help guys,

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