[Sumover-tech] RAT on OS X

Piers O'Hanlon p.ohanlon at cs.ucl.ac.uk
Tue Jun 19 13:42:29 BST 2007


Hi Devin,

On 19/06/07, Devin Jones <djones at arsc.edu> wrote:
> Hello, I'm Devin Jones, the student working on this project.  I have
> no experience working with audio nor such complex code.  Any
> suggestions would be appreciated.  Thus far I successfully tried
> building the code on OSX 10.4.  I've also been looking at
> auddev_macosx.c and documentation on CoreAudio's Audio Hardware
> Abstraction Layer API and CoreAudioTypes.h.  Knowing what to study
> certainly helps, so, once again, any suggestions would be appreciated.
>
Take a look at the README files in the RAT directories - they explain
how RAT fits together . Things can get a little complicated given that
RAT is multi-process - basically the two processes are:
main_engine.c - which does all the audio and network stuff
and
main_ui.c - which provides a tcl/tk based user interface.

These two processes are started by the main_control.c process and the
two main processes communicate using the MBUS - which basically sens
messages over a local multicast address.

So you need to look at  main_engine.c and and specifically look at the
other (auddev_*) drivers - so you can see how they work. Basically the
you need to sort out the code such it generates different sample rate
(in Mono or stereo - depending on the fmt->channels). I don;t think
the resampling code (resamp) that's in the driver is needed - Core
Audio should be capable of sourcing appropriate sample rate audio.
Currently the macosx_audio_supports() function is configured so that
RAT only attempts to use 8KHz Mono - you'll need to change that
obviously.

To understand the RAT code - it's handy to use tools like cscope or
ctags - or load it into eclipse or xcode. To debug you need to run
./configure --enable-debug for common and rat. To debug the
multiprocess you can add a sleep(10) into the beginning of the two
engines then you can run gdb to attach to the process of interest
(i.e. rat-media). Though typically the debug_msg() output to stdout is
good enough to tell you were things went wrong.

Also take a look at other audio applications out there that use Core
Audio - Google's codesearch is quite useful for this (e.g search for
AudioDeviceSetProperty).

Good luck,

Piers.

> Devin Jones
>
> On Jun 12, 2007, at 12:46 AM, Piers O'Hanlon wrote:
>
> > Hi Paul,
> >
> > Good to hear from you.
> >
> >> My name is Paul Mercer and I am the Access Grid Project leader at
> >> the Arctic
> >> Region Supercomputing Center (ARSC) in Fairbanks, Alaska.  I have an
> >> undergraduate CS student looking for a project and was wondering
> >> if working
> >> on the RAT application for OS X would be a suitable project.  I
> >> know that
> >> many, including me, that would like to have rat on OS X work with
> >> better
> >> than the 8-kHz sample rate.  His programming skills are very good
> >> and is a
> >> fast learner.  I have two concerns though.  Will there be a person
> >> (s) that
> >> he could contact for help other than the mail list?  And in your
> >> opinion can
> >> RAT be adapted for higher sampling rates on OS X or is a complete
> >> rewrite
> >> needed?
> >>
> > That sounds like a great project - A better OSX driver would be very
> > useful to alot of people. RAT is currently supports up to 32Khz on
> > quite number of platforms (so OSX shouldn't be a problem) - above that
> > it can behave slightly strangely.  The current driver was written for
> > OSX 10.3 but the sound support was a bit more limited in that version
> > of OSX - however we can only afford the resources to support it on OSX
> > 10.4 which is better and has all the functionality to support higher
> > sampling rates (and more channels etc) in its CoreAudio API's:
> > http://en.wikipedia.org/wiki/Core_Audio
> >
> > A couple of people are working in this area though people haven't had
> > the time to work on it directly so far - I'm sure we can assist as
> > needs be - just send questions to the list.
> >
> > We look forward to some developments in this area!
> >
> > Thanks,
> >
> > Piers.
> >
> >> I look forward to all comments.
> >>
> >> thanks
> >>
> >>
> >> Paul Mercer
> >> Arctic Region Supercomputing Center
> >> 907 450 8649
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Sumover-tech mailing list
> >> Sumover-tech at cs.ucl.ac.uk
> >> http://oakham.cs.ucl.ac.uk/mailman/listinfo/sumover-tech
> >>
> >>
>
>
> _______________________________________________
> Sumover-tech mailing list
> Sumover-tech at cs.ucl.ac.uk
> http://oakham.cs.ucl.ac.uk/mailman/listinfo/sumover-tech
>



More information about the Sumover-tech mailing list