[Jack-Devel] Does alsa_in reading from SPDIF input inject pops and clicks?

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
Does it?

Does changing clock source to internal clock or SPDIF make any difference on pops and clicks?

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
On Thu, August 8, 2019 5:10 pm, crocket wrote:
> Does changing clock source to internal clock or SPDIF make any difference
> on pops and clicks?

Your clock setting has to be consistent with the audio data flow.  If you
are sourcing audio data from S/PDIF input and set the clock source to
internal you will definitely get pops and clicks.  Internal clock should
only be used when audio input is through the converters on the interface,
or if you are only using S/PDIF for output.  The clock source should only
be set to S/PDIF if you have a valid S/PDIF data stream present, and you
should also verify that the sample rate you set for the interface matches
the actual rate of the S/PDIF data.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
If there is no audio data from SPDIF out, would SPDIF out still send clock signals?

On Fri, Aug 9, 2019 at 7:21 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 5:10 pm, crocket wrote:
> Does changing clock source to internal clock or SPDIF make any difference
> on pops and clicks?

Your clock setting has to be consistent with the audio data flow.  If you
are sourcing audio data from S/PDIF input and set the clock source to
internal you will definitely get pops and clicks.  Internal clock should
only be used when audio input is through the converters on the interface,
or if you are only using S/PDIF for output.  The clock source should only
be set to S/PDIF if you have a valid S/PDIF data stream present, and you
should also verify that the sample rate you set for the interface matches
the actual rate of the S/PDIF data.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
* Does clock source matter if alsa_in resamples every audio sample to jack server's clock? Is it impossible to extract audio sample without knowing clock?
* How can I have my computer automatically switch clock source between SPDIF and internal? Is there a clock source named "SPDIF or internal"?

On Fri, Aug 9, 2019 at 7:21 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 5:10 pm, crocket wrote:
> Does changing clock source to internal clock or SPDIF make any difference
> on pops and clicks?

Your clock setting has to be consistent with the audio data flow.  If you
are sourcing audio data from S/PDIF input and set the clock source to
internal you will definitely get pops and clicks.  Internal clock should
only be used when audio input is through the converters on the interface,
or if you are only using S/PDIF for output.  The clock source should only
be set to S/PDIF if you have a valid S/PDIF data stream present, and you
should also verify that the sample rate you set for the interface matches
the actual rate of the S/PDIF data.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
If I set the clock source of a USB soundcard to SPDIF, would the headphone jack of the USB soundcard conform to the SPDIF clock, too?
Or, does the SPDIF clock source apply only to SPDIF In?

On Fri, Aug 9, 2019 at 7:21 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 5:10 pm, crocket wrote:
> Does changing clock source to internal clock or SPDIF make any difference
> on pops and clicks?

Your clock setting has to be consistent with the audio data flow.  If you
are sourcing audio data from S/PDIF input and set the clock source to
internal you will definitely get pops and clicks.  Internal clock should
only be used when audio input is through the converters on the interface,
or if you are only using S/PDIF for output.  The clock source should only
be set to S/PDIF if you have a valid S/PDIF data stream present, and you
should also verify that the sample rate you set for the interface matches
the actual rate of the S/PDIF data.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

liebrecht
On 2019-08-08 19:56, crocket wrote:
> If I set the clock source of a USB soundcard to SPDIF, would the
> headphone jack of the USB soundcard conform to the SPDIF clock, too?
> Or, does the SPDIF clock source apply only to SPDIF In?

This is a question I also have and never got an answer for.
I had working spdif and I rely a lot on spdif, but it suddenly stopped
and I could never get it going again. 5 months pending post on alsa
group, no response asking exactly the same thing. LAU also blank.

I know my post is slightly against the rules as it can be viewed as an
Atta Boy, but if it helps motivating someone in the know to explain this
I think we will be both very pleased.
At the moment with alsa SPDIF I get a "clock sour" error message and no
way to sort it out.
Your question lies at the heart of that, as I can maybe use a different
clock source to get spdif to work again.
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
I suspect SPDIF clock sour means that either SPDIF out or SPDIF in is not of high quality and you need better sound cards for both SPDIF out and SPDIF in.

On Fri, Aug 9, 2019 at 9:18 AM <[hidden email]> wrote:
On 2019-08-08 19:56, crocket wrote:
> If I set the clock source of a USB soundcard to SPDIF, would the
> headphone jack of the USB soundcard conform to the SPDIF clock, too?
> Or, does the SPDIF clock source apply only to SPDIF In?

This is a question I also have and never got an answer for.
I had working spdif and I rely a lot on spdif, but it suddenly stopped
and I could never get it going again. 5 months pending post on alsa
group, no response asking exactly the same thing. LAU also blank.

I know my post is slightly against the rules as it can be viewed as an
Atta Boy, but if it helps motivating someone in the know to explain this
I think we will be both very pleased.
At the moment with alsa SPDIF I get a "clock sour" error message and no
way to sort it out.
Your question lies at the heart of that, as I can maybe use a different
clock source to get spdif to work again.
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

liebrecht
On 2019-08-08 21:18, crocket wrote:
> I suspect SPDIF clock sour means that either SPDIF out or SPDIF in is
> not of high quality and you need better sound cards for both SPDIF out
> and SPDIF in.

It still works on AVLinux on the exact same machine, which is the only
good thing I can say about AV.
As soon as I boot into my main MXLinux distro spdif doesnt work on the
same machine.
Therefore it cannot be hardware issues.
It is clearly a problem with Alsa or USB layer.
But whatis causing it5?

I use a lot of spdif as it clears up a lot of cable clutter elegantly.
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 8:18 pm, crocket wrote:
> I suspect SPDIF clock sour means that either SPDIF out or SPDIF in is not
> of high quality and you need better sound cards for both SPDIF out and
> SPDIF in.

It is just because the window is not wide enough, it is the first part of
"SPDIF clock source" but there is not enough room for the last two
letters.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 6:39 pm, crocket wrote:
> If there is no audio data from SPDIF out, would SPDIF out still send clock
> signals?

Often that is the case, but you would have to consult the documentation
for your particular audio interface to verify.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 6:46 pm, crocket wrote:
> * Does clock source matter if alsa_in resamples every audio sample to jack
> server's clock?

Yes, because the audio data has to be transferred through the audio
hardware and into the system memory without error before alsa_in (or
preferrably zita_alsa2jack) can resample to the jack clock.  If your audio
interface is running from an internal clock source but attempting to read
data from S/PDIF there will be an error whenever the internal clock edge
is not lined up with the proper time in the S/PDIF data stream.  There is
a way around that (essentially real time sample rate conversion in the
hardware similar to what alsa_in does), but it adds cost so is rarely
used.

> Is it impossible to extract audio sample without knowing clock?

Yes, clock management is a fundamental part of digital audio.

> * How can I have my computer automatically switch clock source between
> SPDIF and internal?

I am not aware of a general way.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 6:56 pm, crocket wrote:
> If I set the clock source of a USB soundcard to SPDIF, would the headphone
> jack of the USB soundcard conform to the SPDIF clock, too?
> Or, does the SPDIF clock source apply only to SPDIF In?

You would have to check the documentation for your particular interface,
but in most cases yes, the digital to analog converter for the headphone
jack would share a single clock domain with the rest of the audio
interface.  Typically and audio interface will have only one clock source
active for the entire interface.  That does not have to be the case, but
in almost every instance that is what is most useful, so every interface I
have seen works that way.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

liebrecht
In reply to this post by Chris Caudle
On 2019-08-08 22:13, Chris Caudle wrote:

> On Thu, August 8, 2019 8:18 pm, crocket wrote:
>> I suspect SPDIF clock sour means that either SPDIF out or SPDIF in is
>> not
>> of high quality and you need better sound cards for both SPDIF out and
>> SPDIF in.
>
> It is just because the window is not wide enough, it is the first part
> of
> "SPDIF clock source" but there is not enough room for the last two
> letters.

Goog Lord.

Alsa can really put a little more effort in their presentation.
You know how much time that gui glitch wasted me and sent me in the
wrong direction .. for months I( have been chasing down an error message
that doesnt exist.


Insult to injury..Their developers UG doesnt even have the decency to
just tell me that it is not "sour" (an error) but source (a valid
label). Just ignore.

Sorry but I am t'd off (and not right place to vent).
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
I found https://audiophilesoft.ru/articles/realtek_audio_setup/ALC887.pdf
In the pdf file, refer to pages 64, 67, 71, and 72. I don't understand it well, but it doesn't say whether clock signals are emitted when there is no audio signal.

On Fri, Aug 9, 2019 at 11:18 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 6:39 pm, crocket wrote:
> If there is no audio data from SPDIF out, would SPDIF out still send clock
> signals?

Often that is the case, but you would have to consult the documentation
for your particular audio interface to verify.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
Would alsa_in be confused and spew pops and clicks if SPDIF out stops emitting clock signals in the absence of audio signals?

On Fri, Aug 9, 2019 at 11:18 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 6:39 pm, crocket wrote:
> If there is no audio data from SPDIF out, would SPDIF out still send clock
> signals?

Often that is the case, but you would have to consult the documentation
for your particular audio interface to verify.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
If SPDIF Out stops emitting clock signals in the absence of audio signals, would alsa_out working on the headphone jack of the USB soundcard that gets its clock signals from SPDIF Out emit pops and clicks?
Basically, the plan is

1. ALSA dmix(period size 512, periods 3) --> SPDIF Out of onboard soundcard(Realtek ALC887) --> SPDIF In of Creative Sound Blaster X-Fi HD USB --(alsa_in, period_size 512, periods 3)--> netjack1 ==(ethernet)==> ALSA jack backend --> Amplifier --> Speakers
2. netjack1 --(alsa_out, period_size 512, periods 3)--> headphones

I have my own software for managing jack connections. A keyboard shortcut can switch clients between speakers and headphones.

On Fri, Aug 9, 2019 at 11:18 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 6:39 pm, crocket wrote:
> If there is no audio data from SPDIF out, would SPDIF out still send clock
> signals?

Often that is the case, but you would have to consult the documentation
for your particular audio interface to verify.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
I am considering

* Creative Sound Blaster X-Fi HD USB for headphone jack and SPDIF In.
* StarTech.com 7.1 USB Sound Card with https://www.viatech.com/en/silicon/legacy/audio/vt1630a/ chipset for SPDIF Out, SPDIF In, and headphone jack.
* Realtek ALC887 onboard soundcard for SPDIF out and potentially headphone jack.

Obviously, X-Fi HD has far higher signal to noise ratio for DAC.
But, for SPDIF In,  StarTech.com 7.1 USB soundcard might be cheap and good enough. VT1630A might also have a better implementation of SPDIF out that emits clock signals in the absence of audio signals.
But, everything here is a speculation since I haven't tested any.

On Fri, Aug 9, 2019 at 11:18 AM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 6:39 pm, crocket wrote:
> If there is no audio data from SPDIF out, would SPDIF out still send clock
> signals?

Often that is the case, but you would have to consult the documentation
for your particular audio interface to verify.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 10:31 pm, crocket wrote:
> If SPDIF Out stops emitting clock signals in the absence of audio signals,
> would alsa_out working on the headphone jack of the USB soundcard that
> gets its clock signals from SPDIF Out emit pops and clicks?

The USB audio interface is getting clock from the S/PDIF input, but the
audio is coming from USB, not from the S/PDIF input?
Can that configuration be set with the controls available for the Sound
Blaster device you mentioned?

> 1. ALSA dmix(period size 512, periods 3) --> SPDIF Out of onboard
> soundcard(Realtek ALC887) --> SPDIF In of Creative Sound Blaster X-Fi HD
> USB --(alsa_in, period_size 512, periods 3)--> netjack1 ==(ethernet)==>
> ALSA jack backend --> Amplifier --> Speakers
> 2. netjack1 --(alsa_out, period_size 512, periods 3)--> headphones

This description is a little bit confusing regarding where the machine
separations occur.

So the onboard sound card is on one computer, the Sound Blaster X-Fi is
connected to a second computer?  And that second computer drives speakers
via the X-Fi output, and is also connected via Ethernet to a third
computer?
It is not clear where the netjack connection comes in, for the connection
labeled  with a "2." it shows netjack to alsa-out, but it is not clear
which physical interface drives the headphones.

Perhaps a description of the physical connections of which computer is
connected to which interface would help, along with a description again of
what you are trying to achieve.   You probably described that before, but
I think it has been some number of weeks, I'm not sure I could find the
original email.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

Chris Caudle
In reply to this post by crocket
On Thu, August 8, 2019 10:12 pm, crocket wrote:
> Would alsa_in be confused and spew pops and clicks if SPDIF out stops
> emitting clock signals in the absence of audio signals?

You have not given enough information to know.  What interface is alsa_in
receiving audio from in that case?  How is S/PDIF connected, and how are
the interfaces configured?

--
Chris Caudle



_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Does alsa_in reading from SPDIF input inject pops and clicks?

crocket
In reply to this post by Chris Caudle
I'm trying to share speakers with my desktop computer and Raspberry Pi 3 B+. Both machines should be able to play audio simultaneously.

--> is a connection that doesn't cross the boundary of a computer.
==> is a connection that occurs between two computers.

Anything that doesn't cross ==> occurs on my desktop computer. Anything that happens after ==> occurs on Raspberry Pi 3 B+.
netjack1 runs on my desktop computer. Ethernet cable is the only cable that connects two machines.

1. ALSA dmix --> SPDIF out of Realtek ALC887 onboard soundcard --> SPDIF In of X-Fi HD USB --(alsa_in or zita-a2j)--> netjack1 ==(ethernet cable)==> ALSA jack backend --> I2S Amplifier(HiFiBerry Amp2) --> Speakers
2. netjack1 --(alsa_out or zita-j2a)--> headphone jack of X-Fi HD USB on my desktop computer --> headphones

netjack1 can route audio to either headphones or HiFiBerry Amp2. I can control routing via a keyboard shortcut.
netjack1 can accept audio from alsa_in, zita-a2j, or just regular JACK clients like mpv.

Here are questions.

1. If SPDIF out of Realtek ALC887 onboard soundcard stops emitting clock signals, would the following audio route cause pops and clicks in alsa_out or zita-j2a?
mpv --> netjack1 --(alsa_out or zita-j2a)--> headhpone jack of X-Fi HD USB --> headphones
I suspect that if SPDIF out doesn't emit clock signals and the clock source for X-Fi HD is SPDIF, alsa_out can misbehave. If SPDIF out may not emit clock signals in the absence of audio signals, everything should be routed via SPDIF out.
2. If SPDIF out stops emitting clock signals in the absence of audio signals and starts emitting them again in the presence of audio signals, can alsa_in or alsa_out be confused and inject pops and clicks into audio?

On Fri, Aug 9, 2019 at 11:08 PM Chris Caudle <[hidden email]> wrote:
On Thu, August 8, 2019 10:31 pm, crocket wrote:
> If SPDIF Out stops emitting clock signals in the absence of audio signals,
> would alsa_out working on the headphone jack of the USB soundcard that
> gets its clock signals from SPDIF Out emit pops and clicks?

The USB audio interface is getting clock from the S/PDIF input, but the
audio is coming from USB, not from the S/PDIF input?
Can that configuration be set with the controls available for the Sound
Blaster device you mentioned?

> 1. ALSA dmix(period size 512, periods 3) --> SPDIF Out of onboard
> soundcard(Realtek ALC887) --> SPDIF In of Creative Sound Blaster X-Fi HD
> USB --(alsa_in, period_size 512, periods 3)--> netjack1 ==(ethernet)==>
> ALSA jack backend --> Amplifier --> Speakers
> 2. netjack1 --(alsa_out, period_size 512, periods 3)--> headphones

This description is a little bit confusing regarding where the machine
separations occur.

So the onboard sound card is on one computer, the Sound Blaster X-Fi is
connected to a second computer?  And that second computer drives speakers
via the X-Fi output, and is also connected via Ethernet to a third
computer?
It is not clear where the netjack connection comes in, for the connection
labeled  with a "2." it shows netjack to alsa-out, but it is not clear
which physical interface drives the headphones.

Perhaps a description of the physical connections of which computer is
connected to which interface would help, along with a description again of
what you are trying to achieve.   You probably described that before, but
I think it has been some number of weeks, I'm not sure I could find the
original email.

--
Chris Caudle




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
12