Age | Commit message (Collapse) | Author |
|
Change-Id: I2d44f26fd61aee841dcf0ca82460f5b5ff40b48a
|
|
Exempt-From-Owner-Approval: meta data
BUG:67772237
Change-Id: I5ca35c96805b9915e263c273f11ff86f57541695
|
|
Change-Id: I62463c94e5158bc52758c4ecee1cb83efad07f0c
|
|
This reverts commit 411e27db5c92c0ceec717902c9623916c8af34fd.
Reason for revert: Breaks the build of multiple devices
Change-Id: I41944cad673add62782cd6591685bcca43bfef85
|
|
audio.h and its dependencies (audio-effect.h, sound_trigger.h...)
used to be shared between system and vendor code.
This led to multiple problems:
1) Such sharing contradicts the Treble policy of
strict independence of framework and vendor code.
2) When audio.h was changed, every vendor needed to update
its code in the next release. This meant that audio*.h
headers were mostly changed in backward compatible manner.
Nevertheless, for P the HIDL interface and thus the audio.h
interface are changed in backward incompatible way.
(Some enum are becoming 64 bit long).
3) As the headers were common, some API used only by the framework
needed to be visible to the vendors (mostly enum values).
4) Treble policy is to support at least one previous HAL version
As a result the audio*.h headers are now duplicated,
one set for the framework, and one for the vendor.
Each set will evolve independently. After this split,
the framework-only APIs will be removed from the vendor headers
and vice versa.
The split is implements as such:
+ for system code
- NOT moving the libaudio_system_headers
Eg: system/audio.h and system/audio_effects/effect_equalizer.h
are still in system/media/audio
- the legacy audio HAL API that were in libhardware headers
are now in libaudiohal_legacy_headers
Eg: hardware/audio.h and hardware/audio_effect.h
are now in frameworks/av/media/libaudiohal/legacy/
+ for vendor code
- moving libaudio_system_headers and the legacy audio HAL API
that were in libhardware_headers in
android.hardware.audio.common.legacy@2.0
Note that those headers are now versioned, so migrating to a @4.0
HIDL HAL will mean changing the legacy dependency too.
Eg: system/audio.h, system/audio-effect.h, hardware/audio.h
are now in hardware/interfaces/audio/common/2.0/legacy
- the legacy audio effect HAL API that was in libaudioeffects
is now moved in android.hardware.audio.effect.legacy@2.0
Eg: audio_effects/effect*.h are now in
hardware/interfaces/audio/effect/2.0/legacy
- the legacy sound trigger HAL API that were in libhardware_headers
is now moved in android.hardware.soundtrigger.legacy@2.0
Eg: hardware/sound_trigger.h is now in
hardware/interfaces/audio/effect/2.0/legacy
libaudioutil being used by both system and vendor, had
to be renamed for system to libaudioutil_system.
Vendor libs that now depend on the audio.h of a specific
version and are not extensively referenced in non google code,
append @2.0 to their name.
Note that headers that are not expected to change in the 4.0 HAL are
left in all-versions folder to avoid duplication.
This is an implementation detail as the versioned libraries export
the all-versions headers.
Note that strict vendor-system separation is enforced by the
build-system. The system headers are not available for vendor
libs and vice-versa.
Note that this patch is split between numerous git repository (>10),
all the commits having the same Change-id for searchability.
Note that audio_policy.h is no longer exposed to vendors
as the legacy audio policy HAL API was never officially supported.
As a result the audiopolicy stub implementation has been removed.
Test: compile taimen-userdebug walleye-userdebug
sailfish-userdebug marlin-userdebug
gce_x86_phone-userdebug gce_x86_phone
full-eng aosp_arm aosp_x86-eng
Test: check that the emulator booted and played audio
Test: full QA on sailfish-userdebug and taimen-userdebug
Bug: 38184704
Change-Id: I950f4e0a55613d72e32eba31bd563cb5bafe2d1a
Signed-off-by: Kevin Rocard <krocard@google.com>
|
|
Change-Id: Ic36376a7c3bad1944b7358b8cb26441709b07614
|
|
* Suppress non-critical warnings.
* Keep other existing warnings to fix later.
Bug: 66996870
Test: build with WITH_TIDY=1
Exempt-From-Owner-Approval: owners file contains unregistered email addresses
Change-Id: Ia3f93bdc6fd8b14e5f88c9d382a6b04741b9c4f8
|
|
Nothing currently builds the master branch here. Update it for use on
Bertha.
Change-Id: I9e3e2c4e2a50383e810b21608b61f72c3027c72c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
|
|
Routes from user selected input to user selected
output to create closed loop testing environment.
Now functions as a command line program with options.
Seperate commit from cras_test_helper.
DSP will be on seperate commit after discussing
exactly where to put the change.
Select input/output now removed from router as it is
now done with python on the front end.
BUG=None
TEST=ran file to/from various outputs/inputs on samus
Change-Id: I21ec7c6cd62f9b711a58ae0fcd28fb4db86c0192
Reviewed-on: https://chromium-review.googlesource.com/358130
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Python script that uses cherrypy framework to run
GUI for audio testing tool. Tool allows for user
to select their input and output source on the GUI
and sets those nodes using the cras_test_client.
If the user chooses to run a loop through test then
a subprocess runs the cras_router program in the background.
BUG=None
TEST=ran various times on samus with various options set
Change-Id: I34d530cee187eb4aa42705e91bcfc3464a8960c5
Reviewed-on: https://chromium-review.googlesource.com/372321
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Speaker should be switched off when headphone is enabled.
Otherwise, when CRAS starts with headphone plugged, and headphone is
enumerated as the first node, speaker switch will still remain on, and
cause sound to be played to speaker and headphone at the same time.
BUG=chromium:726175
TEST=Boot with headphone plugged. Check audio does not play to speaker.
Change-Id: Ifcae91342ae1a227a36c61f285b8fee36ffc7e88
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/516325
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
This reverts commit 70182dd089ce9646f371ce0188ce4423d7f64f6a.
Reason for revert: broke the external mic on cyan and celes
Original change's description:
> CRAS: Deduplicate snd_pcm_open calls when opening a device.
>
> The current open device flow includes several functions like
> cras_alsa_fill_properties and update_channel_layout. They are used only
> once in the flow but each calls snd_pcm_open and then snd_pcm_close the
> device. Since snd_pcm_open is one of the most time-consuming hardware
> operations, the CL extracts the snd_pcm_open calls to the beginning of
> the device open flow to save time.
>
> 1. Update cras_alsa_fill_properties and update_channel_layout to take a
> handle as argument and do not invoke snd_pcm_open.
> 2. Rename existing open_dev functions to configure_dev. open_dev is now
> called at the beginning of the device open flow and invokes the
> snd_pcm_open call.
> 3. Put open_dev, cras_iodev_set_format, and configure_dev inside the
> cras_iodev_open function.
>
> BUG=b:719812
> TEST=make check and tested on reef
> Cuts time to open speakers from 78ms to 42ms
>
> Change-Id: I9b161217def5e87bf892f4ca8148f07bed5e71a5
> Reviewed-on: https://chromium-review.googlesource.com/505974
> Commit-Ready: Chinyue Chen <chinyue@chromium.org>
> Tested-by: Chinyue Chen <chinyue@chromium.org>
> Reviewed-by: Dylan Reid <dgreid@chromium.org>
>
BUG=b:719812
Change-Id: I22eb2fc70b4a5003a861be62d31bc2337b9918c3
Reviewed-on: https://chromium-review.googlesource.com/511982
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
The current open device flow includes several functions like
cras_alsa_fill_properties and update_channel_layout. They are used only
once in the flow but each calls snd_pcm_open and then snd_pcm_close the
device. Since snd_pcm_open is one of the most time-consuming hardware
operations, the CL extracts the snd_pcm_open calls to the beginning of
the device open flow to save time.
1. Update cras_alsa_fill_properties and update_channel_layout to take a
handle as argument and do not invoke snd_pcm_open.
2. Rename existing open_dev functions to configure_dev. open_dev is now
called at the beginning of the device open flow and invokes the
snd_pcm_open call.
3. Put open_dev, cras_iodev_set_format, and configure_dev inside the
cras_iodev_open function.
BUG=b:719812
TEST=make check and tested on reef
Cuts time to open speakers from 78ms to 42ms
Change-Id: I9b161217def5e87bf892f4ca8148f07bed5e71a5
Reviewed-on: https://chromium-review.googlesource.com/505974
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
The update_supported_formats is called when a device is being opened
(as part of cras_iodev_set_format) so we don't need to call it when a
device is created.
BUG=b:719812
TEST=make check && tested on reef.
Change-Id: I6b901aff4a2d1b6a07bd3c40b1014d5b828e7dfb
Reviewed-on: https://chromium-review.googlesource.com/503947
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
If the requested channel count when opening an output device <= 2
then we can skip the update channel layout call and reduce the time
spent to init a device.
BUG=chromium:719812
TEST=Tested on reef.
Change-Id: I46cba552751440a2043b0778b8b22a51a6113e3e
Reviewed-on: https://chromium-review.googlesource.com/499910
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
|
|
BUG=chromium:643039
TEST=Start playback and verify the stream type is displayed in
cras_test_client --dump_a output.
Change-Id: I4eb0d9835260a01fc7c07b56e19b41ffbbd61131
Reviewed-on: https://chromium-review.googlesource.com/479515
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
This makes it easy to create different type of streams to test audio use
cases.
BUG=chromium:643039
TEST=cras_test_client --playback_file /dev/urandom --stream_type 1
Change-Id: I379b87293ae5fbeca8534d271ab6f47c2e3149d6
Reviewed-on: https://chromium-review.googlesource.com/479495
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
BUG=None
TEST=emerge-${BOARD} adhd
Change-Id: Iced6470310c66209fc39dce38270f96cb3afe767
Reviewed-on: https://chromium-review.googlesource.com/479592
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
|
|
Consider both master switch and output specific switch for mute and
unmute.
To unmute, we need to unmute both master switch and output specific
switch.
To mute, we can only mute one of them, but mute both of them is simpler.
BUG=chromium:701079
TEST=Plug headphone on butterfly and boot. Check it has function.
Change-Id: I03e8737fdf98b1504bebe91082fc0e0e9d3fc9af
Reviewed-on: https://chromium-review.googlesource.com/476393
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Set ramp duration for new stream to 0.01 so user does not miss the
start of new stream.
Set ramp duration for mute to 0.1 so mute can happen sooner.
BUG=chromium:709323
TEST=make check
TEST=check ramp duration for new stream is almost not noticeable.
TEST=check ramp duration for mute is much shorter than before.
Change-Id: If74d094aad11748e3198e8e9402a4d4de9631694
Reviewed-on: https://chromium-review.googlesource.com/472327
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
The log doesn't have hw_level anymore. So just remove it.
BUG=None
TEST=Parse log from latest cras and check the html file.
Change-Id: I2a01bce1043ac5c7545035a32f35e2c561c56039
Reviewed-on: https://chromium-review.googlesource.com/469666
Commit-Ready: Hsu Wei-Cheng <mojahsu@chromium.org>
Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Remove non-critial logs in libcras and cras_utils.
Only logs when important call fails.
Fix the return code checking in cras_set_thread_priority.
BUG=chromium:705124
TEST=check there is no redundant logs about server_fd_state.
TEST=check there is message warning that schedparam call fails on board
that does not allow realtime priority (because rt-limit is not set yet)
Change-Id: I4a182001fb661e42bcbc22104b354fc01a81eaa5
Reviewed-on: https://chromium-review.googlesource.com/461699
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
BUG=chromium:700247
TEST=make check
Change-Id: Ibd3ef6b81d3e55baa35dcfe84229b96b77cd34d3
Reviewed-on: https://chromium-review.googlesource.com/464489
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
When a pinned stream is connected, the active node on the iodev-
to-pin might not work properly due to it was left in disabled
state when user's last action was switching to the other iodev.
Fix this problem by calling update_active_node() when a pinned
stream connected and removed.
BUG=chromium:700247
TEST=Plug 3.5mm headphone and a USB headset, select to headphone
in UI tray and then select to USB headset as output.
Execute 'cras_test_client --pin_device <id-of-internal-card>' to
play something, and verify audio coming out from headphone.
Next, click on UI to select to internal speaker and then select to
USB headset as output. Execute cras_test_client --pin_device to
play something, verify audio coming out from internal speaker this
time.
Change-Id: I438fdfc591b52186ed5a5079f8d3125b47f3499a
Reviewed-on: https://chromium-review.googlesource.com/462736
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
There are two HDMI ports on Skylake platform.
Disable DSP on them.
BUG=chromium:636038
TEST=run audio_AudioBasicHDMI test on chell.
Change-Id: Ifc6016b5ab28556ba96ea57938c847d3a618d1bf
Reviewed-on: https://chromium-review.googlesource.com/458618
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
|
|
When a hctl jack is to be freed, its callback should be removed too.
Otherwise, callback will be called when snd_hctl_close is called, and at
that time, iodev and jack might already be destroyed.
BUG=chromium:701542
TEST=make check
Change-Id: If08f98f5323aef75cb45dfe81bf5980da891e2f7
Reviewed-on: https://chromium-review.googlesource.com/455618
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Now that dev_stream provides dev_stream_wake_time, audio_thread can use
that to determine wake up time for input device. The wake up time for
input device will be the earliest one among dev_stream_wake_time of all
streams on this device.
BUG=chrome-os-partner:60786
TEST=make check
TEST=check audio thread log when cras_test_client --loopback_f
/tmp/lb.raw is running. Check there is no busy wake up in audio thread.
Change-Id: Icd41b4c6880dbabcbcc3ecfc813ab62cdb361d85
Reviewed-on: https://chromium-review.googlesource.com/446622
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Add dev_stream_wake_time to get the wake up time for an input stream.
This wake up time needs to satisfy both sample and time requirements:
- Sample requirement: At wake up time, there should be enough samples
from device to fill 1 cb_threshold in stream's shm.
- Time requirement: This wake up time should be later than next callback
time, which is one time interval later than last callback time.
BUG=chrome-os-partner:60786
TEST=make check
Change-Id: I40dd75170485abc68e25cba9638f22cd02f85b8d
Reviewed-on: https://chromium-review.googlesource.com/446621
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
When there are enough captured samples, only send captured data to input
stream when time is late enough. Otherwise, client can not handle this
much data.
Note that stream with BULK_AUDIO_OK flag can still send data when there
is enough data.
BUG=chrome-os-partner:60786
TEST=make check
TEST=Play sine tone use sox command. At the same time, use
cras_test_client --loopback_f /tmp/lb.raw to record using loopback
device. Check num_overruns in audio thread log. Also, check CAPTURE_POST
in audio thread log and see the interval is roughly sleep interval.
Change-Id: I1a6e7056cd0bab40e2e597ca08ef524b7ff1207f
Reviewed-on: https://chromium-review.googlesource.com/447184
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Logs number of overruns of streams in audio thread log.
Also, makes the device and stream info easier to read.
BUG=chrome-os-partner:60786
TEST=cras_test_client --dump_a /tmp/log and check stream info contains
num_overruns
Change-Id: If6bcee4710fbbc976a736b48a95e612c999243e4
Reviewed-on: https://chromium-review.googlesource.com/447185
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
The device ID is displayed in decimal in server info and in hexadecimal
in audio thread info. This makes it a little weird when matching the
device ID between the 2 views. This patch updates all the occurrences
to decimal.
BUG=None
TEST=cras_test_client --dump_a
Change-Id: Ib23c04fc74261b8ef85cb95dff82a1efb5a4c354
Reviewed-on: https://chromium-review.googlesource.com/451065
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
When adjusted active node volume is zero, or system volume is zero,
samples of a device will be suppressed to zero.
Since the device is already playing zeros, there is no need to ramp down
or up for mute/unmute change.
BUG=chromium:697511
TEST=on kevin, check there is no extra ramp when pressing volume down
when volume is 0.
TEST=make check
Change-Id: I648fab83f2e6dcfbd2db5370db0509d513d3b40d
Reviewed-on: https://chromium-review.googlesource.com/447852
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
This function queries whether a device is enabled, so it should take a
pointer to const iodev.
BUG=chromium:695711
TEST=make check
Change-Id: I14f3460089b66059fd0b9315bc0bf79672769827
Reviewed-on: https://chromium-review.googlesource.com/448241
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Add a method to query if a device should mute its samples because
adjusted node volume is zero.
This will be used when cras_iodev_list decides whether it should start
ramping down a device's samples.
BUG=chromium:697511
TEST=make check
Change-Id: I18b09cba5dc34c8419e0ee17ec7dae9128759731
Reviewed-on: https://chromium-review.googlesource.com/447851
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Disable DSP on HDMI node.
BUG=chromium:636038
TEST=run audio_AudioBasicHDMI test on chell.
Change-Id: I49b86ee79b266be372e8dbddc381665c25bf1f86
Reviewed-on: https://chromium-review.googlesource.com/444627
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
Use this style:
/*
* Comments
*/
BUG=None
TEST=make check
Change-Id: I0bf65e25ef110279f4584d05946e08d858a43355
Reviewed-on: https://chromium-review.googlesource.com/443685
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Some boards require different default gain rather than 2000 dBm defined
in cras_system_state. Now we expose a new UCM config DefaultNodeGain
so we can use different default node gain for board customization.
Note that user can still change gain after the node is selected, so AGC
still works either on system gain or on node gain.
BUG=chrome-os-partner:60744
TEST=make check
TEST=On chell, add DefaultNodeGain to "Mic" and "Internal Mic" section.
Select active input node and see recorded audio gain is changed.
TEST=On chell, switch active node, goto appr.tc and append
?debug=loopback in the URL, and check AGC in WebRTC works.
Change-Id: Ibf8ad7a1252d4a53ba700e5dc355efa7ce3e70f1
Reviewed-on: https://chromium-review.googlesource.com/430528
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
System capture gain is subjected to supported gain range.
This causes a problem that when desired capture gain is out of supported
gain range, it can not be retained after supported gain range is
changed because the information is lost.
To solve above problem, system state can add a field capture_gain_target
to store the desired capture gain. Then, when the supported range is
changed, system state can try to re-apply capture_gain_target.
Initalize device setting in alsa_iodev_set_active_node so the gain limit
and system gain can be adjusted based on the latest active device and
active node.
BUG=chrome-os-partner:60744, chromium:692187
TEST=make check
TEST=on kevin, check cras_test_client --dump_s and see default system
gain is 20.0 dB, not 0.0dB.
TEST=Use apprtc, switch between internal mic and external mic and see
the gain adjusted on one node is retained after switching back to that node.
Change-Id: I48653c7d5035ec2ca8a53d300772bfc529c8b7ad
Reviewed-on: https://chromium-review.googlesource.com/430527
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Both A2DP and HFP iodev register an audio thread callback to
read/write data from/to a file descriptor. When device is closed
to remove this callback on main thread, audio thread could still
accessing it and cause problem. The symptom on A2DP iodev is that
BT transport has closed and set its fd to -1, but audio thread
accidentally writes data to it so an error is thrown and results
BT disconnection.
Fix this issue by creating a separate function for main thread to
remove audio thread callback in a synchronized way.
TEST=Connect Powerbeats3 headset and repeatedly open and then close
YouTube to verify there is no unexpected disconnection.
BUG=chrome-os-partner:62623
Change-Id: If8171afc5b2462616492551b5e6c586c1c2c1342
Reviewed-on: https://chromium-review.googlesource.com/445844
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Commit-Ready: Miao-chen Chou <mcchou@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
|
|
BT headset could send SCO Interval Rejected (0x1c) command right
after SCO connection established when switches to HFP/HSP.
Handle this error by checking the revent code of ppoll and suspend
this bt device so user has a chance to re-connect it.
BUG=chrome-os-partner:59015
TEST=Manual test MDR-XB950BT headset switch from A2DP to HFP,
disconnect and reconnect a few times to verify that headset won't
fall into the state that stay connected but not working.
Change-Id: I6d16ddcea1608f024b5bd0780941d1f17db5de75
Reviewed-on: https://chromium-review.googlesource.com/440048
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
BUG=chromium:690348
TEST=None
Change-Id: I6cb889b19358014b5c8dd655c1ecb24bde2e6f91
Reviewed-on: https://chromium-review.googlesource.com/440047
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
BUG=chromium:681891
TEST=trybot
CQ-DEPEND=CL:432256
Change-Id: I3914158f27d6a628d7fa403e6c277a8aa265da91
Reviewed-on: https://chromium-review.googlesource.com/432157
Commit-Ready: Rajat Jain <rajatja@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
Currently if sound card doesn't have mixer control for 'Speaker', CRAS
won't associate the volume curve specified by [Speaker] label in card
config.
Fix this issue by moving volume curve from mixer control to alsa output
node.
BUG=chromium:682164
TEST=unittest. On platform without 'Speaker' control, verify volume
curve for speaker can be loaded.
Change-Id: I75411bf238f25f69ec383877df7278c7b7ff2949
Reviewed-on: https://chromium-review.googlesource.com/429813
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
BUG=None
TEST=unittest
Change-Id: Ifb454ec2c54c2a3da3069ecef121c0055ff0d762
Reviewed-on: https://chromium-review.googlesource.com/429812
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|
|
We should only notify observer when mute/unmute state is changed.
Otherwise, there will be redundant ramping for mute/unmute.
BUG=chromium:669662
TEST=make check
TEST=Play sine tone. Press mute multiple times. System remains silence.
Change-Id: Ie0c97d4e7f0ef34dce46dc61720c43db12db9933
Reviewed-on: https://chromium-review.googlesource.com/428732
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
When device is not in normal run state, there is no need to start
ramping. This avoid the unwanted ramping down where device is
in no_stream state, and user changes mute state.
The scenario is:
1. Start playback
2. Stop playback
3. Device in no_stream state.
4. Press mute. Device starts ramping down.
5. Ramping does not proceed because there is no valid sample being
played.
6. Start playback. Valid sample is being played. Ramping proceeds.
cras_iodev_put_output_buffer does not mute samples because ramping is
in progress, therefore, we have unexpected audio.
This CL avoids the unwanted ramping down request at 5 to avoid
unexpected audio.
BUG=chromium:669662
TEST=make check
TEST=Follow above scenario and check there is no unexpected audio.
Change-Id: Ia7c20d41f2e1def93ba0e966d8d482b6f703b038
Reviewed-on: https://chromium-review.googlesource.com/428731
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
When output should be muted, do not ramping up for sample being ready.
This is for the case where stream is added and removed while system
remains muted.
BUG=chromium:669662
TEST=make check
TEST=Let system remain muted, play sine tone and stop repeatedly.
Unexpected audio happens only in the first time, and system remains
silence for all other trials. The unexpected audio will be fixed in the
next CL.
Change-Id: I55cd544faac42cf1ac72b9b5445bc7a5c18a3a05
Reviewed-on: https://chromium-review.googlesource.com/428730
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
|
|
UCM suffix is used for CRAS to choose UCM config customized
for specific device. We should treat the empty suffix case
as not specified.
BUG=chromium:680701
TEST=verify UCM is loaded on Reef
Change-Id: Ib498cc385e650a360a3bb26974ec0acb5a17c72a
Reviewed-on: https://chromium-review.googlesource.com/428670
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
|
|
Previously, new node selection would bail out early if the new node
was already active - this did not take into account that this might
not be the only active node, so other nodes remained active.
To be consistent with the case the new node was not active previously,
when all nodes but the new one are disabled, make sure that
the new node becomes the only enabled node when it's enabled using
SetActive*Node method.
BUG=chromium:672665,chromium:679852
TEST=Using chrome.audio apps API, (where A, B are ID of distinct
existing audio nodes):
setActiveDevices([A]);
setActiveDevices([A, B]);
setActiveDevices([B]);
Verify that only audio node B is enabled.
Change-Id: Ic602d31183286caa36dd16e2ae8ec6ef03791f68
Reviewed-on: https://chromium-review.googlesource.com/427043
Commit-Ready: Toni Barzic <tbarzic@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
|
|
USB card info is used to derive the device's stable ID.
If any of USB properties that are part of card info is not
properly initialized (which was the case when reading USB
system attributes failed), stable ID will be derived from
unpredictable data - and end up being unstable across reboots.
BUG=chromium:678090
TEST=1. plug in USB headset,
2. change active output to another device,
3. unplug the USB headset
4. reboot
5. plug the USB headset again
6. verify that the USB headset is not activated
Change-Id: I986be152ca6bd97431766d745ffa023afe973237
Reviewed-on: https://chromium-review.googlesource.com/424938
Commit-Ready: Toni Barzic <tbarzic@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
|