GTA04A3: Allow "Cannot write control '2:0:0:Codec Operation Mode:0' : Device or resource busy" output from alsactl

Previously we'd kill all soundcard users if there was any output at
all from alsactl.  Killing soundcard users is possibly a bad idea in
any case, but it's especially so when the output is actually benign.
For example, it means that the Media Player dies when headphones are
inserted or removed.

Regarding the "Codec Operation Mode" setting, Neil Brown recently
wrote:

> The twl4030 audio codec has 2 operation modes.
> In one the PCM (digital) connections to the bluetooth and Modem are
> disabled.  In the other they are enabled.
> The first is sometimes described as "multimedia player" mode while the
> seconds is "voice" mode.  I think you a limited to lower sample rates in
> voice mode.
>
> You cannot switch modes while the device is active.  i.e. nothing can have
> the device open to play or record.
>
> This error just tells you that it cannot switch mode.  It shouldn't stop
> other settings from being applied.
>
> On the A3 you should never need to switch modes (unless you are playing with
> using the PCM path to get sound to/from the bluetooth).
> On the A4 you need to either leave it in the second mode (which probably
> wastes power, and probably forces low data rates) or switch on the second mode
> at some safe point - maybe between stopping the ring and answering the call,
> or maybe before making the phone ring.

On the A3 board, all the possible ALSA states (i.e. all
except *hw.state) have 'Codec Operation Mode' = 'Option 1 (audio)', so
there are no transitions that actually switch the mode, and it is
not a problem for that setting to fail.  Therefore we should allow
that output and _not_ go killing soundcard users.

This change allows media playback to continue when headphones are
inserted or removed.  It also seems to make Voice Notes work more
reliably, and I suspect it might help with call audio too.

(Unfortunately this change does nothing yet for the A4 board.  On the
A4 things are more complex, as Neil Brown says above, because there
there are some ALSA state transitions that _do_ need to change the
codec operation mode.  So for A4 more thought and work are needed.)
Log and check output from 'pasuspender alsactl' just as when not using pulse
Use pulseaudio for A3 call audio routing
Increase mic volume and use echo cancellation
Recreate accidentally lost recording function

My ALSA state rework accidentally lost recording function, e.g. as
used by the Voice Notes application.  This commit recreates it.

I thought it might be possible for the default Media state - normally
MediaSpeaker - to handle both playback and recording.  But this
produces a nasty feedback loop, because Pulseaudio is by default
always looping the default source (i.e. the microphone) back to the
default sink (i.e. the speaker).  Therefore the default MediaSpeaker
can't have the microphone switch open, and therefore we need a
separate state, MediaRecording, to handle recording.

How then, does an application such as Voice Notes get the
MediaRecording state installed?  My guess is that it happens
automatically when any applications uses a QAudioInput, so long as all
the states have their Input/Output capabilities correctly defined.
Decouple the detail of PA loopback from C source code
Reduce loopback latency and don't do echo cancellation
gta04-gsm-voice-routing: Give the 4 streams clearer names
gta04-gsm-voice-routing: Avoid instability in A3 voice routing code
Remove devices/c3200
Remove devices/greenphone
Remove devices/htcuniversal
Remove devices/n800
Remove devices/n810
Remove devices/zaurusclamshell
Remove bundled atd
Double length of SMS subjects
multipart inside multipart/related
email viewer: support nested multipart levels inside multipart/signed

For example, signed email from KMail, that then goes through a mailing
list, ends up with this structure:

multipart/mixed
 multipart/signed
  multipart/alternative
   text/plain
   text/html
  application/pgp-signature
 text/plain (mailing list trailer)
imap: Don't recheck for mail every time the IDLE connection gives a heartbeat

Sadly, and ironically, this meant that ticking the "Push Enabled"
checkbox for an IMAP account could actually do _more_ data transfer
than without "Push Enabled".  For example I used to have a checking
interval of 10 minutes, but enabling "Push Enabled" reduced that to 2
minutes, because my server emits an "* OK Still here" heartbeat every
2 minutes on the IDLE connection.