In a recording session , the number of bytes read is
not updated when pcm_read() fails. This results in
silence/invalid data being added during a device switch
from USB headset to handset.
Fix is to reset the number of bytes read if pcm_read()
returns an error indicating removal of USB headset.
Bug: 18611518
Change-Id: I10d578c3cf1037c90a891e63be2bd1c2b7e6126b
Reset ALSA device profile on disconnect event. Entries like
supported sample rates, channel counts, formats will be repopulated
on next connect.
CRs-Fixed: 765434
Change-Id: I27d3b7fd7ff22646996f58c53de08547b1a1fb6a
Bug: 18606219
When reading from a pipe, the output may have been previously
closed, therefore the output state should only be read if it
is still available.
This fixes a race condition observed between in_read() (which
accesses the output stream) and adev_close_output_stream()
(which sets the output reference to NULL).
No issue with out_write() which checks the input reference.
Bug 16009464
Change-Id: I979bc12c8fe91fad9b6f6c9e0be107c1bacae360
The implementation for "remote submix" supported only one pipe
to capture the output of a mix.
This CL adds support for multiple pipes to support capturing
multiple audio routes.
The structure for the r_submix audio device holds an array
of route configurations (route_config), each referencing
the input and output of the pipe dedicated to this route.
Each route is associated to a unique address. Standby
status is maintained per stream.
Bug 16009464
Change-Id: Ie164c4ad2a6d8138f825484e7faf29a974ccf82e
The "remote submix" HAL uses a MonoPipe instance to "pipe" audio
from the sink of this virtual device HAL to its source.
The life-cycle of this pipe is:
- creation when either the input or output stream is open
- destruction when both input and output are closed.
Changes are:
Fix test for pipe destruction: destroy pipe when both
input and output streams are NULL.
Count how many read errors went into the logs and cap them
so as not to spam the logs when the pipe is not properly
set up. Less 'I' logs, 'D' logs instead.
When opening input stream, check for non-null sink before
checking if it's shutdown.
Bug 16653334
Bug 17111907
Change-Id: I634b4192b00f9b74a5109f42242423e9c8cb4c7c
Ignore calls to any HALs that are not 1_0 or 1_3 compliant.
Fix an unused parameter compiler warning.
Bug: 17645248
Change-Id: Ia50f7512dfe35f37973440bba84e1b1b177a7bd3
tinyalsa fails to retrieve the correct value for the period count
from the f_audio_source driver and tries to use zero instead.
This wasn't a problem before because the usb audio HAL used hard coded values
that were compatible with the driver.
Bug: 16799652
Change-Id: I6f5b907a0699c58b071e9f419ed8e053a7d9dc77
Do not read the ALSA PCM device configuration when playback
or capture is active.
Do not force ALSA profile update if card and device passed
to out/in_set_parameters() do not change.
Hold the main HAL lock when closing or opening the
ALSA PCM device.
Bug: 15520724.
Change-Id: I2b6087ed46ce7433de0b6dd8b24ec10de2e55d21
The number of channels can be "forced" using k_force_channels.
If the channel count proposed by AudioFlinger is not permitted
by the device, it is emulated.
Change-Id: Ib20e680c8f95adb84616a4fe52977f659cf4d6ca
This HAL was intended to support doze mode but it is currently
unused and it's best for it to stay that way.
Bug: 16516536
Change-Id: I4f442e27d68f18ff322afd4c1debd2f392687e80