On Wed, 2017-07-12 at 22:29 +0300, Denis Shulyaka wrote: > Well, that was more or less expected. Is such support planned? I haven't heard of anyone planning to implement the feature. > It means I need to write my own decoding application. But that leads me to > another question: > When I open the stream, how do I know its format? And how can I detect when > it changes? I don't know how the endpoints are supposed to agree on the format, and what kind of interface alsa provides for that (if any). The alsa-devel list might be more appropriate for questions about spdif details. > I've came up with an idea to try different codecs and sample rates until I > get something without decoder errors and not looking like a white noise, > but well... you know... there must be a less ugly solution for that! (And I > will have a really hard time detecting the format if my source _is_ a white > noise for some reason). I don't think it's necessary to figure out whether the data looks like white noise. I believe compressed formats have some identification bits, and if the data matches no compressed format, then I think it's fine to assume that it's stereo 16-bit PCM data. Figuring out the sample rate may require waiting for a bit to see at which rate the sound card is producing audio. Maybe this is why at least some spdif receivers lose a bit of audio from the beginning when starting to play over spdif. -- Tanu https://www.patreon.com/tanuk