Statistics
| Branch: | Tag: | Revision:

root / gr-audio-osx / TODO @ 7070c10d

History | View | Annotate | Download (2.9 kB)

1 5d69a524 jcorgan
List as of 2006-Apr-22, by Michael Dickens, primary author
2 5d69a524 jcorgan
3 5d69a524 jcorgan
* Change buffering to use gr_buffer's and necessary related classes.
4 5d69a524 jcorgan
  Currently uses a circular_buffer I wrote myself (in
5 5d69a524 jcorgan
  ./src/circular_buffer.h ), which hides the "circular" part from the
6 5d69a524 jcorgan
  user but otherwise is very fast as well as thread safe.
7 5d69a524 jcorgan
8 5d69a524 jcorgan
* A current limitation of this implementation is that the user cannot
9 5d69a524 jcorgan
  dynamically switch audio devices (input or output) during playback
10 5d69a524 jcorgan
  and use the new device without stopping the current executing GR and
11 5d69a524 jcorgan
  restarting the process.  I would like to figure out how to get a
12 5d69a524 jcorgan
  CoreAudio "listener" for when the default hardware input / output
13 5d69a524 jcorgan
  device changes (e.g. when switched by the user in the "Sound" system
14 5d69a524 jcorgan
  preference pane).  The code in ./src/audio-osx-source.cc creates
15 5d69a524 jcorgan
  listeners for the AudioUnit being used as well as the Hardware
16 5d69a524 jcorgan
  device, but these for some reason don't do the trick.  It's possible
17 5d69a524 jcorgan
  that the Python framework doesn't allow for one to do this.
18 5d69a524 jcorgan
19 5d69a524 jcorgan
* In both the source and sink, move the code which defines the "Audio
20 5d69a524 jcorgan
  Stream Basic Description" (ASBD) to a routine to do this as needed
21 5d69a524 jcorgan
  as start-up as well as in a callback ("listener") if the default
22 5d69a524 jcorgan
  device changes.
23 5d69a524 jcorgan
24 5d69a524 jcorgan
* Tweak the mutex (d_internal) to only where it is truly needed
25 5d69a524 jcorgan
  (around class-specific variables used across all threads) in order
26 5d69a524 jcorgan
  to improve performance.  Currently the mutex is used at the
27 5d69a524 jcorgan
  start and end of any function requiring access to the class variables.
28 5d69a524 jcorgan
29 5d69a524 jcorgan
* Change the instantiation arguments ... once those arguments are
30 5d69a524 jcorgan
  finalized.  Right now gr.audio.source () takes the sample rate (int
31 5d69a524 jcorgan
  - should be double), the device name (std::string), a boolean for
32 5d69a524 jcorgan
  blocking or not, and 2 completely non-standard ones for channel
33 5d69a524 jcorgan
  configuration and the maximum sample count to buffer.  These are
34 5d69a524 jcorgan
  reasonable for OSX, but might not be for other OSs.  Nothing to do
35 5d69a524 jcorgan
  right now but wait and discuss.
36 5d69a524 jcorgan
37 5d69a524 jcorgan
* Once the previous issue has been resolved, then the current method
38 5d69a524 jcorgan
  of determining the number of channels needs to be updated.
39 5d69a524 jcorgan
  Currently the "device_name" for OSX should contain a numeric string
40 5d69a524 jcorgan
  for the maximum number of channels to use (e.g. "3" means 3
41 5d69a524 jcorgan
  channels, generally mapped to 2 channel stereo by OSX).  The
42 5d69a524 jcorgan
  "device_name" is generally input via "-O" in Python scripts, so "-O
43 5d69a524 jcorgan
  3" would allow for 3 incoming output channels (or fewer).  In theory
44 5d69a524 jcorgan
  the "channel_config" argument would make more sense for determining
45 5d69a524 jcorgan
  channel usage.  Example config strings might be "2.1" for stereo w/
46 5d69a524 jcorgan
  subwoofer (3 channels), "5.1" or "6.1" for various surround w/
47 5d69a524 jcorgan
  subwoofer (6 & 7 channels, respectively).  OSX can handle all sorts
48 5d69a524 jcorgan
  of channel configurations, but the names for these will be different
49 5d69a524 jcorgan
  than those use for OSS or ALMA or Windows ... thus the need for a
50 5d69a524 jcorgan
  common naming scheme for all cared-about configurations, possibly
51 5d69a524 jcorgan
  with options for other OS-specific options.