[pulseaudio-discuss] Writing an output module
damien.dejean at ensimag.imag.fr
Sun Jul 17 02:19:23 PDT 2011
I'm writing a sink module to communicate with a home-made audio server.
I follow your advice to use the RAOP module code as a support. So I keep
the structure, I can compile it but I'm not able to load the new module
anymore. I put it in /usr/lib/pulse-0.9.22/modules but when I run
pactl load-module module-spam-sink
it doesn't work (Failure in module initialisation) and the log says me:
pulseaudio: module.c: Failed to open module "module-spam-sink":
file not found
Could you, please, explain me how I can easily load the module ?
Le 29/05/2011 11:19, Colin Guthrie a écrit :
> Hello Damien,
> As your message was waiting moderation and as you asked a question that
> may gather some replies, I've subscribed you to the list. I hope that's
> OK? If it's a problem you can unsubscribe over at:
> We've just moved lists so this is likely a different URL to the one
> shown in your "Your message is on hold pending administrator approval"
> email you'll have received from your original post.
> 'Twas brillig, and Damien DEJEAN at 25/05/11 19:25 did gyre and gimble:
>> I'm working on a little sound server for small computers. I already have
>> a server and a client library to send sound to this server. Now I wish
>> write a pulseaudio module to redirect sound to the library and then send
>> it to the little server.
>> I read the tutorial about modules, but I was noat able to found some
>> informations. For example, I need to get the bit width (8, 16 bits ...),
>> the sample rate (22k, 44khz) and the sound data, but I don't where I can
>> found it.
>> There are very naive questions, but I don't really know where to begin
>> :$, can you help me ?
> Well, overall you'll be writing a "Sink" module. This is an output
> device module and it will likely connect direct to your server.
> The sink itself will advertise a fixed sample format and then PA will
> internally handle any input stream remixing when the stream is connected
> to that sink. It is then the sinks responsibility to process the actual
> data. While it's certainly not perfect, this is how e.g. the ROAP sink
> works, so it may be a good idea to look at the structure of that code
> and just replace the RAOP/RTP things with calls to your library.
> Can I ask what the small sound server is? For small computers
> (especially those run off battery or where power saving is desirable)
> PulseAudio is one of the only systems to do advanced driving of the alsa
> devices using it's timer based scheduling... this approach can save up
> to half a watt in power based on current tests. Why is PulseAudio itself
> not appropriate for these small computers? (it's already used in several
> embedded systems for the reasons of power saving listed above).
More information about the pulseaudio-discuss