Get max audio channels available from alsasink

Antonio Ospite ao2 at ao2.it
Mon Feb 4 14:08:51 UTC 2019


On Sat, 2 Feb 2019 07:10:43 -0600 (CST)
"moritz.vieli" <moritz.vieli at gmail.com> wrote:

> Hi Pavel
> 
> You. Are. The. Man! This really works!
> 
> It correctly shows the 6 available channels. There is even more information,
> like buffer sizes, available audio rates and so on.

Useful info indeed, thanks Pavel.
 
> Only downside: You have to provide a file (not even an audio file), which
> makes the usage a little bit strange. But it seems to work well.

If you don't want an extra file on the filesystem you could provide a
fake header on the standard input, the minimal accepted header for
non-raw formats seems to be 26 bytes:

  printf "\x00%.0s" {1..26} | aplay --dump-hw-params -D hw:0 -

or 

  head -c 26 /dev/zero | aplay --dump-hw-params -D hw:0 -

or even better, use the raw format and /dev/null:

  aplay --dump-hw-params -D hw:0 -t raw /dev/null

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the gstreamer-devel mailing list