From: Takashi Iwai <tiwai@suse.de>
To: Sergey <sergemp@mail.ru>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PoC] ahwmon: alsa "hw" what-you-hear recorder
Date: Thu, 21 Jan 2016 12:57:36 +0100 [thread overview]
Message-ID: <s5hio2ntaa7.wl-tiwai@suse.de> (raw)
In-Reply-To: <1452565276.581630768@f237.i.mail.ru>
On Tue, 12 Jan 2016 03:21:16 +0100,
Sergey wrote:
>
> Hello.
>
> I needed a tool to test if anything loud is playing right now. So I wrote
> "ahwmon" - alsa hw monitoring tool. It's based on dmix idea: it gets "hw"
> shared playback buffer, but reads from the buffer instead of writing.
>
> Code is mostly copied from alsa-lib, but it uses kernel /dev/snd/pcm*
> files directly and doesn't depend on alsa-lib or dmix. May work for
> other apps playing to "hw", including pulseaudio and jackd.
>
> What do you think about it? Can something like this get into alsa-lib or
> alsa-utils or alsa-plugins? It could be a capture side of "dmix" plugin,
> which has no capture now. Maybe someone with strong dmix knowledge
> can port it to dmix?
This is an interesting idea. I like the simplicity of your method,
despite the known limitations. I suppose it can be well implemented
as a normal alsa-lib plugin?
thanks,
Takashi
>
> Build:
> gcc -o ahwmon ahwmon.c
>
> Usage:
> ./ahwmon [-v] [-v] <card_index> <device_index> [<subdevice_index>]
> subdevice 0 is used by default
> it outputs .wav stream to stdout
>
> Use cases:
> * Card VUmeter:
> ./ahwmon 0 0 | aplay -V stereo -D null
> * Dump what you hear:
> ./ahwmon 0 0 > audiodump.wav
> * Duplicate output of one card to another:
> ./ahwmon 0 0 | aplay -D plughw:1,0
> * Stream what you hear to another pc:
> ./ahwmon 0 0 | nc 192.168.1.10 12345
>
> Known limitations:
> * supports S16_LE and S32_LE only.
> * breaks clients attempting to close and reopen "hw"
>
> Any ideas are welcome!
> --
> Sergey
prev parent reply other threads:[~2016-01-21 11:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 2:21 [PoC] ahwmon: alsa "hw" what-you-hear recorder Sergey
2016-01-21 11:57 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hio2ntaa7.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=sergemp@mail.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).