aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-api-pcm.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-13core-pcm: fixed channels setting issuesThierry Bultel1-4/+8
Recent tries on the minnow board have show that the setting of channels on a PCM must be done -after- the setting of the rate. When not doing that, there can be issues (really, complicated to find) around the boundaries values (open intervals) on the period bytes. Additionally, the number of channels can now be forced in the json file. Change-Id: I2c20853daadf9ccab06be6e04d1a185440f57780 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-05-13alsa-api-pcm: added an 'optional' parameterThierry Bultel1-3/+17
This adds a boolean 'optional' parameter for both playback and capture devices. When the device is not detected, the stream(s) that use is are not created, without leading to the exit of the softmixer. Change-Id: I3effbd61bfe1d1d4a7cde573354b9db791f759cc Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-05-13alsa-api-pcm: added support of quirksThierry Bultel1-4/+30
Adds an optional array of quirks in the parameters of playback and captures. For now, the only known quirk is a needed workarround for writing sound output on the minnow board. Change-Id: I6c65d110a1f9333ccb77cd8f4eeb9c088d0d2eca Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-01-16bluetooth sco: fixed the softvol open errorThierry Bultel1-1/+1
This fixes #SPEC-2125. The fix consists in specifying the number of channels in the softvol pcm configuration. When it is not set, the libasound detects a configuration mismatch (the default number of channels being 2), and attempts to remove the sotfvol control, which for unknown reason, (broken support on kernel side ?) randomly fails. Change-Id: I816b623715e413452e6793ee519e97fac6fdde43 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-12-22Implemented the bug cleanup at application exitStephane Desneux1-19/+26
Fixes most memory leaks in softmixer. The concept of 'transaction' for dynamic streams has been generalized to the objects created at startup. The cleanup is done via a handle set through a atexit() call. Also added a missing strdup in alsa-api-loop, that fixes a double free. Warning, the bluez-alsa PCM are not closed in this version. This is intentional due to a BUG in the bluealsa ioplug PCM, that crashes upon close (pthread_cancel is used to terminate the io_thread and things get very bad. I have a pending fix for that, relying on a cancellation pipe, but deeper testing must be done). As an effect, only one phone call can be made, else 4a needs to be restarted Change-Id: Idb84cafe15f17c0ef02fcc70296d541dc55a2dcf Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh> Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2018-12-19Add support for bluetooth telephonyguppy_6.99.3guppy/6.99.36.99.3Thierry Bultel1-94/+281
This adds support for bluetooth telephony. A big rework in the softmixer internals has been mandatory, in order to support dynamic streams creation and deletions. Bluetooth telephony relies on the recent evolutions of bluez-alsa, the most important one being the support of HFP over Ofono. The softmixer opens PCM ioplugs provided by bluez-alsa. Bluetooth SCO needs 2 streams, one for listening and the other for talking. These streams are created upon requests sent by the hal-manager. The hal manager subscribes for bluez-alsa events and request the list of availalble transports. For each "attach" transaction verb, the softmixer maintains a list of the all created objects (sources, sinks, zones, ramps, streams, and more) Additionnally, it creates a new verb when the attach succeeds, that verb is typically something like "sco_XX:XX:XX:XX:XX:XX", and the only supported action at the present time is {"action":"remove"}, that performs all the cleanup of the registered objects. Change-Id: I1b119e6c079e60daf771e63c083a1ef33a39f379 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-11-07Tweaking debug printsJonathan Aillet1-1/+1
Replace some 'printf' by application framework debug functions. Improve 'ALSA_PCM_UID' macro. Correct minor errors in debug prints. Change-Id: I49899fd904d42b5b3bec46017eb319ed7d321dc5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-08-31Added bluez sound playback supportThierry Bultel1-4/+5
This adds sound playback for incoming sound from connected bluetooth devices. In this version, the softmixer relies on a modified bluez-alsa version (https://github.com/iotbzh/bluez-alsa), that provides an ioplug PCM bluezalsa connection proxy. The softmixer api has a new verb to dynamically set the device to listen to: afb-client-demo ws://localhost:1234/api?token=\uuid=123 smixer bluezalsa_dev '{"interface":"hci0", "device":"F6:32:15:2A:80:70", "profile":"a2dp"}' In this way it is possible to switch from a bluezalsa audio source to another without any further configuration. For now, only interface hci0 is supported. This commit also migrates the softmixer binding to API v3 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-07-11stops the read/write loop when the stream is mutedThierry Bultel1-1/+3
when the stream is muted (due to the configuration, or due to a HAL request), the read/write loop is stopped. The benefit is that muting will work with capture devices that do not implement the mute in their driver. The inconvenient of stopping the read loop is that it has made appear an unexpected side-effect: the poll on capture does not trig for further incoming frames. The workaround is to completely close, then reopen and configure the capture PCM. Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-22pcm: return volume value with null set requestThierry Bultel1-4/+18
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-11Fixed compilation warning with _FORTIFY_SOURCE=2Thierry Bultel1-5/+11
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-11Remove yocto compilation errorsJonathan Aillet1-1/+1
Remove yocto compilation errors concerning : - An unitialized variable in 'alsa-api-pcm.c' - A wrong use of asprintf in 'alsa-api-streams.c' Change-Id: I170993d060a7a1d1a1c20979da0645c5ef2b1b91 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-06-10Added cardid+verb return for capture+playback sndcardfulup1-2/+3
2018-06-10Cleanup and added return of previous volume when setting new valuefulup1-28/+63
2018-06-07code cleanupThierry Bultel1-2/+2
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-07Code cleanup and fixed some typosThierry Bultel1-33/+43
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-05Added per sink/source API for master controlfulup1-4/+8
2018-06-05Update info command and move HTML5 to new APIfulup1-22/+219
2018-06-04Fixed compilation issues with gcc >= 7.2Thierry Bultel1-1/+1
Fixed some warnings about uninitialized variables
2018-06-04Move to Dynamic Mixer API (work in progress)Fulup Ar Foll1-0/+304