hardware/qcom: msm8660: Fix FM audio getting muted at volume level 1

- FM Volume is getting muted at volume level one
- Corresponding linear value for volume level one is lesser than 0.5 and
  it gets rounded to zero and hence volume gets muted
- Fixed this issue by rounding the valid volume values to the nearest
  higher integer value so that such lower values are not ignored

CRs-Fixed: 337127
(cherry picked from commit 9d22f97b17ddcf4bc3c08b200a3606c6ee1f6e73)

Change-Id: I7845e1612afa1c30fc52196ac340fa2d28ec8303
hardware/qcom: 8660: Fix voice call mute issue after VOIP

- Observe CS voice call become silent after Voip call.
- Incase of mDirectOutput is opened multiple times,
MVS driver is not closed and Rx/Tx devices are not
de-routed even after Voip call terminates.
- Avoid creating mDirectOutput if already exists. This will
close the MVS driver properly,Rx/Tx devices are de-routed
and will not result in any issue for next usecase.

CRs-Fixed: 337952
(cherry picked from commit 078cff577844d25baf70126910f8ba89fbc6c73a)

Change-Id: I2295f85f841fa3c2e8009db39e369046dd2a595f
hardware/qcom: 8660: Fix video gtalk call with no voice issue

- While Video voip call, no voice is heard at all.
- Here, Output Stream open does MVS driver open and increments
the voip stream count. Then Input Stream open checks the
MVS driver is already opened and returning without incrementing
the voip stream count. As a result, standby called after Input
Stream open will use this count to check whether both Input
and Output streams are active. But as count is not incremented
in Input stream open, it assumes only one stream is opened and
results in closing of MVS driver which is not expected and
causing no voice packets sent to downlink and uplink.
- Increment the voip stream count both in Output stream
open and Input Stream open even if MVS driver is already
opened. This will reflect the voip stream count correctly
and avoids failure cases like this.

CRs-Fixed: 340102
(cherry picked from commit e935fb0461269b151c3db74d73de0d349c6701db)

Change-Id: Ifbcfb9ba6c60f49b5f2b8f456c24b5d5b0792cb3
hardware/qcom: 8660: Fix voice uplink distortion in VOIP

-When Gtalk voip call is used, observing distortion on
uplink voice.
-There is a sofware bug in the code while returning the
number of bytes read from HAL StreamInVoip read. The
upper layers rely on this value for calculating the delay
to read the next voice uplink packet. As this value is
returned 1280 bytes instead of 640, it is resulting in
20ms more delay for each packet read and causing
packet drops and disortion in uplink voice.
-Fix the issue by returning the actual number of bytes
that are read from MVS and filled into buffer.

CRs-Fixed: 331850
(cherry picked from commit b2a90147720040d6bdf8df0737370052507be7b0)

Change-Id: I662e3d47b919a20198b0203539ddb5d5bb2073ea
Add broadside audio and enable dualmic by default

Change-Id: If64e8e1526a67464350da4f81daa735020b06593
Force headset to use device mic and don't use dualmic for speakerphone.

Change-Id: Ie72f25bb15f38b2757afa93abe04e09a3b4fc9ca
Add 2 system properties: persist.headsetmic.enabled and persist.dualmic.enabled

Change-Id: I2405b1cb697fdb9851417461970f6350a0cc1a7d
Change the name od the properties so they can be set by the settings app.

Change-Id: I4ac2f0de3881c99660d1e4412fb9b34e3f1f29bf