Eric Laurent 7f8c5c273e Fix issue 2410159: Camcorder: audio capture is sometimes silent when a wired headset is plugged on Passion.
This change fixes two issues:

1 There is a problem with the mutex mA1026Lock protecting access to Audience chip configuration. The mutex is always locked
after the driver is opened and unlocked before the driver is closed. There is a risk that the driver is closed by an instance
of doAudience_A1026_Control() ready to exit while it had already been tested as opened by another instance of doAudience_A1026_Control()
entering and waiting for mA1026Lock to be released. This is what happens when a record is starting and that at the same time the output routing
is changed because the record jingle is playing.
The fix consists in locking mA1026Lock before opening the driver and unlocking it after closing the driver.

2 There is a problem on both 7k and 8k with the way doRouting() handles the routing requests for inputs and outputs. Current implementation
of doRouting() has a parameter indicating if the requestest comes from an input or from an output. The input device is only considered if the
request comes from this particular input. This creates a problem when the input is already active and a routing request is received on an output.
In this case, the new device is chosen as if no record was active resulting in potential change in input routing and a1026 configuration.

The fix consists in checking if at least one input is active when entering doRouting() and always take its device selection into account.
If no input is active, the device selected for the output is used.

For 8k platform, also call doRouting() instead of doAudience_A1026_Control() when record is started or stopped to make sure that all audio path and
accoustic parameters are properly selected and not only the A1026 configuraiton applied.
2010-02-02 02:22:34 -08:00
Description
No description provided
1.3 MiB
Languages
C++ 90.2%
Objective-C 4.6%
C 2.8%
Makefile 2.4%