<div dir="auto"><div class="gmail_extra" dir="auto"><div class="gmail_quote">12 июля 2017 г. 23:58 пользователь "Tanu Kaskinen" <<a href="mailto:tanuk@iki.fi">tanuk@iki.fi</a>> написал:<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text" dir="auto">I don't know how the endpoints are supposed to agree on the format, and<br></div>
what kind of interface alsa provides for that (if any). The alsa-devel<br>
list might be more appropriate for questions about spdif details.<br></blockquote></div></div><div dir="auto"><br></div><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="quoted-text"></div></blockquote></div></div><div dir="auto">Ok, I will ask there. I've found datasheet for my hardware (CM106) and I can see it that the information about whether the stream is compressed and its sample rate is available to the driver. I just need to figure out if ALSA gets it and propagates to PA.</div><div dir="auto"><br></div><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">I don't think it's necessary to figure out whether the data looks like<br></div>
white noise. I believe compressed formats have some identification<br>
bits, and if the data matches no compressed format, then I think it's<br>
fine to assume that it's stereo 16-bit PCM data. Figuring out the<br>
sample rate may require waiting for a bit to see at which rate the<br>
sound card is producing audio. Maybe this is why at least some spdif<br>
receivers lose a bit of audio from the beginning when starting to play<br>
over spdif.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">After some more googling I've found that there is IEC61937 standard that defines which audio codec is used.</div><div dir="auto"><br></div><div dir="auto">Thank you for your support, I'll now try to understand how ALSA works first.</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Denis Shulyaka</div><div class="gmail_extra" dir="auto"><br></div></div>