alsa-lib: alsa dshare endless playback of buffer

When modified version of aplay is used which waits after call
to drain, the last buffer content is played endless until
timeout. Fixed the issue by calling do_silence method in
ALSA pcm dshare plugin source file.

Port of hf2013.11-106-alsa-dshare-endless-playback-of-buffer

JIRA: MEIBPADIT-771

Signed-off-by: Anant Agrawal <Anant_Agrawal@mentor.com>
Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
alsa-lib: Fix for sync issue on xrun recover

Port of hf2013.11-114-alsa-dshare-sync-on-xrun-recover

JIRA: ADK-3329

Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
alsa-lib: Protect from freeing semaphore when already in use

In the case of dshare, dsnoop, and dmix when a device is opened twice
and fails the second time, the semaphore is completely discarded. This
creates dangling semaphore data.

This patch removes the possibility for the semaphore to be destroyed during
a typical open failure by first checking if the shared memory can be destroyed
or not. If the shared memory cannot be released it means both it and the
semaphore are still in use and therefore the semaphore is just released.

Port of hf2013.11-127-alsa-protect-semaphore

JIRA: BGTHREE-232

Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
alsa-lib: New patch for direct plugins variable period size

This patch fixes audio problems with iPhone 5s, iOS 8 beta 5, Siri input.
It addresses cpu performance related issues and allows variable period that are
a multiple of the slave period.

Port of hf2013.11-125-direct-plugins-variable-period-size

JIRA: MEIBPADIT-895

Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
alsa-utils: SIGINT handling corrected

aplay/arecord: interrupt streaming via signal does not close sound devices.

Interrupt aplay via signal (e.g. CTRL-C) shall be handled by closing sound
devices via snd_pcm_close(). With applying Mentor hotfix
hf2013.11-101-alsa-utils-interrupt-signal-handling (i.e. patch
alsa-utils-aplay-interrupt-signal-handling.patch) the signal handler does
a call of exit() directly from signal handler. Calling exit will prevent
calling of snd_pcm_close() which is mandatory for e.g plugin DSHARE to fill
channels with silence.

1. Undo hotfix 101
2. Cherry pick commit c06dbf077459923066c96556678835cd1f55123a upstream

Port of hf2013.11-138-alsa-utils-sigint-handling-corrected

JIRA: MEIBPADIT-933

Signed-off-by: Guruprasad Giddannanavar<Guruprasad_Giddannanavar@mentor.com>
Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
alsa-utils: Move patch from files to alsa-utils folder.

Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
Merge remote-tracking branch 'mdurnev/mdurnev/adit-hotfixes4alsa' into release/2014.12