Re: Getting SampleHardwarePlugin to work for default device
Re: Getting SampleHardwarePlugin to work for default device
- Subject: Re: Getting SampleHardwarePlugin to work for default device
- From: Stéphane Letz <email@hidden>
- Date: Tue, 07 Aug 2012 10:53:48 +0200
Le 7 août 2012 à 04:06, Jared Sohn a écrit :
> On Monday, August 6, 2012 3:26:54 PM UTC-7, Stéphane Letz wrote:
> > Hi,
> >
> > I have modified the SampleHardwarePlugin example to include a
> > CanBeDefaultDevice() method that returns true and added some logging
> > to the beginning of SHP_Device::Initialize().
> >
> > I am able to get logging information for the master process and one
> > additional process (which dies by the time my system starts up), but
> > do not get information for any others. From searching the mailing
> > list, I've seen this verbiage:
>
>
> On which OSX version are you testing your code?
>
> I am testing on Snow Leopard.
>
>
> >
> > "...the plug-in has to provide the same view on it's device(s) in each
> > process the plug-in is initialized in, especially the coreaudiod
> > process. This entails implementing enough IPC between the instances of
> > your plug-in in each process to synchronize the state."
> >
> > Some questions:
> >
> > 1) I haven't done this yet. Is that why I'm not getting logging
> > information from other processes?
>
> I don't think so. You should be able to trace any process that loads the SampleHardwarePlugin. Loading the SampleHardwarePlugin is caused by the process using the CoreAudio API, and is somewhat separated from what the plugin actually does.
>
> As I mentioned, I'm trying to trace processes that load the SampleHardwarePlugin by logging to a file in SHP_Device::Initialize(). My understanding is that every time I launch a process, my SampleHardwarePlugin code should be injected into that process and I should get a new log entry but I am only seeing two log entries at startup (and IsMaster is true for one and false for the other.) Today, I experimented more by putting the logging in other places (SHP_Plugin) and stripping out code to reduce the chances of crashing but it did not affect my results.
>
> Am I correct to assume that every process, regardless of whether or not it makes sound gets my code injected into it? I am typically testing this by running gedit.
Nope: only processes that use the CoreAudio API will load this plugin. Said differently the CoreAudio framework will load the plugin for you.
>
> >
> > 2) What exactly is meant by the state being the same?
>
> Showing device structure: number of audio streams, configuration of each stream, possibly audio controls.... and possibly a "shared" state that your plugin may have to expose.
>
> Actually it is now clear what you are trying to achieve with the SampleHardwarePlugin sample... It would help if you describe a bit more.
>
> The concept of "shared state" confuses me a bit. My plan is to have every nonmaster send its information to the master device and have every action performed on the master be properly propagated to the nonmaster processes. I am not planning for nonmaster processes to contain full state (i.e. they won't have any information about other processes.)
>
> My goal in this is to be able to retrieve and update the volume of individual processes like one can do on Windows with its volume mixer. (I realize there are products that can do this already, but I need to include the functionality with my product.)
>
> Thanks,
>
>
> Jared
Hum... but how is your version of SampleHardwarePlugin going to handle the audio streams ? SampleHardwarePlugin is supposed to retrieve audio from the audio application and do something with it. I don't see how only changing the volume is going to work.
Stéphane Letz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden