Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugtrack@alsa-project.org
To: alsa-devel@alsa-project.org
Subject: [ALSA - lib 0001819]: Monitor capability feature request
Date: Sat, 4 Feb 2006 19:42:54 +0100	[thread overview]
Message-ID: <77aa774024bd084e0cd6d916137307b5@bugtrack.alsa-project.org> (raw)


The following issue has been SUBMITTED.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1819> 
======================================================================
Reported By:                djandruczyk
Assigned To:                
======================================================================
Project:                    ALSA - lib
Issue ID:                   1819
Category:                   0_general
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             02-04-2006 19:42 CET
Last Modified:              02-04-2006 19:42 CET
======================================================================
Summary:                    Monitor capability feature request
Description: 
 I'd like to suggest a potential feature with the capability of monitoring
ANY pcm output (or combination of simultaneous outputs).  The aim being to
be able to do the following via alsa-lib:

1. record output from arbritrary applications or combination thereof
without requiring any application modification and without looping back
the physical outputs to inputs on the sound hardware (which introduces
noise and unwanted latency and use of a recording source that might
otherwise be in use.
2. perform monitoring of select streams (in the case of multiple pcm
streams running at once)

>From the application's point of view that would want to use this I
envision something along these lines:

- App registers a callback with ALSA-lib to be notified if a new stream is
created or destroyed.
- App then queries alsa lib for a current list of running streams (whether
to physical devices or streams feeding into dmix)
- App requests a "monitor connection" to a stream or combination of
streams and registers a callback function to be called anytime this stream
is upated from an application (limitation in that all streams requested
share same SW params for simplicity)  This should be flexible in the case
of dmix to be able to monitor 1 feed  up to n feeds where n being the max
number of streams that dmix is handling concurrently. The monitored
connection will have a total number of channels equal to the sum of
monitored channels selected.  
for example: lets say dmix is multiplexing 3 applications to one physical
hw:0 device.  the monitor requests 2 out of those three (for wahtever
reason, it doesn't matter) The monitor callback should deliver the data to
the callback as a 4 channel stream in the format of:
 L (stream 1),R(stream 1), L(Stream 2), R(stram2) (interleaved).  The
restriction being that the SW params of the streams that are to be
monitored must all match, otherwise it would become very difficult to
calculate and handle all the possible permutations of handling mixmatched
streams.

- App's callback function is called each time the outside application
issues a write to ALSA lib and is able to monitor the audio stream from
said app in realtime.  If outside application closes, the notification
callback will be called and the app monitoring the stream will gracefully
handle the event, deregister the monitor callbacks, and if wanted,
re-query also lib for current streams and connect to another.

Potential issues:
  This would ONLY work for applications using the ALSA lib library and PCM
plugins plughw, dmix, etc.  It would (probably) NOT function for direct
access, to hw:0 (thought it may be implementable, I don't know enough of
ALSA internals to know if it would be possible). It most definitely would
not work for things that mmap the sound device buffer directly, but I
would guess that a large portion of applications do not use that method.
(though I may be wrong and would appreciate a correction if I am so)

======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
02-04-06 19:42 djandruczyk    New Issue                                    
======================================================================




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

             reply	other threads:[~2006-02-04 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-04 18:42 bugtrack [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-02-04 18:53 [ALSA - lib 0001819]: Monitor capability feature request bugtrack
2006-02-04 19:22 bugtrack
2006-02-04 19:58 bugtrack
2006-02-05  3:39 bugtrack
2006-02-07 15:24 bugtrack

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=77aa774024bd084e0cd6d916137307b5@bugtrack.alsa-project.org \
    --to=bugtrack@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    /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