diydrones/apm_planner — pull request #172 by wolkstein (2014-01-27 00:05:43+00:00)
Title: AlsaAudio driver

I create this pull request even though it is a little bit bigger.
I building a armhf based groundstation and decide to use apm_planner because it can run native under linux. after first try I noticed that there was no audio available. on looking into code I see that phonon was commented in gaudiooutput class. if activating phonon, I see that phonon crashed if application will closed and gaudiooutput destructor is called. trying to find out what goes wrong ended with no concrete results.
next I try qgroundstation which of course also use phonon. same result it crash on destructor. I never test qgroundstation or apmplanner on other systems than linux. thats, why i do not know if audio is available there.
also i do not know if audio is an feature of interest for apm_planner. if yes, maybe this pull request can be interesting for the project(linux only).

the request contains
* a simple alsa driver implemented as QThread
* small improvement in UAS.cc to message battery current in percent as audio message.
* small change in gaudiooutput. now the soundfiles which are created from flite speak synthesiser are not temporally any more. now they will stored in an extra directory in ~/apmplanner2/tmp_audio. all files named by spoken content.

this is no problem because the files are not so big. mostly between 20 - 60kib. the goal here is that flite step will skipped if file already exist. this will save cpu load and reduce write access to storage. interesting for small embedded systems with low cpu and sdcard based storage.
because wav files no longer temporally, it is also possible to queue messages. at least this was needed mostly for the QThread AlsaDriver. if files temporally created and erased in main thread there was no possibility from QThread AlsaDriver to successfully open them.

ok,
long text, short info:)

new dependences:
libasound
libsndfile

I try to use persistent platform independent settings which are defined in QSettings. so hopefully there are no problems to build and execute on other systems. of course without alsa driver and improvements. at least I have not the possibility here to build&test on windows and osx systems.

/g
wolke