Wish: add other audio backends through a plugin approach

Bug #594940 reported by Alexandre Demers
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Lightspark
Fix Released
Wishlist
Unassigned

Bug Description

One interesting way of doing it would be to split the audio backend from the player. But it would need some rework to implement a plugin approach where Lightspark would query a directory of plugins, if one is found, to ask what it is, if it implements a sound backend and gives lightspark all it needs to play audio correctly (according to a pre-determined communication API between the binary and the plugin to make sure both can communicate correctly and implement the needed stuff on each side), then list it in the different backends available. One could create a plugin for alsa, pulseaudio, gstreamer, xine, openAL as long as it implements what LS needs to decode audio, then it could used.

However, a plugin should be listed as available if :
- it is present in the plugin directory
- it answers to the audio API defined for LS
And to be selectable only if :
- it detects that the backend is present on the system

Then, the user would have to choose between the different plugins which one should be used.

I don't know if this plugin idea could be extended to help the implementation of some other functionalities in the future...

But for sure it would be useful for the sound backend part. It could even be used under Windows or OSX where a plugin for DirectSound (or whatever it is called now under Win7) or Core Audio (which is an OpenAL implementation) could be used without having to code it in LS. For now, personally, I'll wait until work on the audio interface finishes, I know it is still changing a lot. But after that, I could make a fork and try to do something about it.

Tags: wish
Changed in lightspark:
importance: Undecided → Wishlist
Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

I'm not really a fan of multi backend plugin architectures. I'd prefer to have a single well working and fast backend. Actually pulseaudio is also supported on windows and so should be pretty ok. I will of course accept any contribution.

Revision history for this message
Chi-Thanh Christopher Nguyen (chithanh) wrote :

I know I'm late to the party, but I would like to suggest to use SDL for audio. Lightspark already depends on libsdl, and libsdl already has a plugin architecture which allows output to alsa, esd, oss, pulseaudio, etc.

Revision history for this message
Alexandre Demers (oxalin) wrote :

Hi Chi-Thanh, just to let you know that I'm working on it on my spare time and the audioManager rework is almost over. For now, I have a plugin for pulse, since the work was already done directly in LS.

With the new approach, the AudioManager will select an audio plugin (the user will be able to select the one he prefers) from all the ones detected. If none is available, LS will still work, but won't be able to output audio, obviously.

If everything goes well, I'll have a working AudioManager with a first plugin next week. When that will be done, I may add a pluginManager to separate the plugin detection and management from the audioManager, which should be easy to do. At the same time, I should be adding an ALSA, a SDL and an OpenAL plugins (this will happen slowly, depending of the time I'll have. I don't know which one will be the first to be added).

Another modification that will be done to the audioManager at some point is adding an input stream management (for now, we only have an output stream) since this is something offered by Flash.

So I still have plenty of things to do that I hope to see merged one step at a time in LS and evolve by me and others.

Revision history for this message
Chi-Thanh Christopher Nguyen (chithanh) wrote :

SDL already provides audio output switching by means of the SDL_AUDIODRIVER environment variable, I think it duplicating this effort in lightspark might not be the best idea.

Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

SDL is only used in the standalone mode and cannot be used at all in the more important plugin mode

Revision history for this message
Alexandre Demers (oxalin) wrote :

The plugin/audio architecture is done. It will need more work to be used for other things, but it does what it is intended from it at the moment and it's ready to be used with other audio backends.

Changed in lightspark:
milestone: none → lightspark-0.4.5
Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

The plugin based audio architecture is now merged in master and available since 0.4.4.2

Changed in lightspark:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.