summaryrefslogtreecommitdiffstats
path: root/binding/radio_impl_kingfisher.c
AgeCommit message (Collapse)AuthorFilesLines
2021-11-03Correction of comments about radio model number in agl-service-radiolamprey_12.1.9lamprey_12.1.8lamprey_12.1.7lamprey_12.1.6lamprey_12.1.5lamprey_12.1.4lamprey_12.1.3lamprey_12.1.20lamprey_12.1.2lamprey_12.1.19lamprey_12.1.18lamprey_12.1.17lamprey_12.1.16lamprey_12.1.15lamprey_12.1.14lamprey_12.1.13lamprey_12.1.12lamprey_12.1.11lamprey_12.1.10lamprey_12.1.1lamprey_12.1.0lamprey/12.1.9lamprey/12.1.8lamprey/12.1.7lamprey/12.1.6lamprey/12.1.5lamprey/12.1.4lamprey/12.1.3lamprey/12.1.20lamprey/12.1.2lamprey/12.1.19lamprey/12.1.18lamprey/12.1.17lamprey/12.1.16lamprey/12.1.15lamprey/12.1.14lamprey/12.1.13lamprey/12.1.12lamprey/12.1.11lamprey/12.1.10lamprey/12.1.1lamprey/12.1.012.1.912.1.812.1.712.1.612.1.512.1.412.1.312.1.2012.1.212.1.1912.1.1812.1.1712.1.1612.1.1512.1.1412.1.1312.1.1212.1.1112.1.1012.1.112.1.0lampreyduerpei1-1/+1
Bug-AGL:SPEC-4116 Signed-off-by: duerpei <duep.fnst@fujitsu.com> Change-Id: Ic5a2f88a3d17743e960d38b0553e735a5b001867 (cherry picked from commit 6191be9c1e4b628f60ccaeabcef2aaa9de00800b)
2021-05-11radio: use pipewiresrc instead of alsasrc on kingfishermarlin_12.90.0marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.012.90.011.92.011.91.0George Kiagiadakis1-1/+3
This fixes the synchronization issues that prevent the radio from working nicely on the kingfisher Bug-AGL: SPEC-3844 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: I5132a135b8203a1f1ceb7cfe5f01d8676e786de4
2021-03-12radio: s/pwaudiosink/pipewiresink/George Kiagiadakis1-2/+2
This is the one and only pipewire sink now. Bug-AGL: SPEC-3844 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: If7c69f9c944f92006bde1aa3b9745b7966501a65
2020-12-06Fix scan start behavior in Kingfisher backendkoi_10.93.0koi_10.92.0koi_10.91.0koi/10.93.0koi/10.92.0koi/10.91.010.93.010.92.010.91.0Scott Murray1-1/+1
Add missing check for playing status in Kingfisher backend "scan_start" function. Bug-AGL: SPEC-3716 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I74a9221b6d2a89a052009a279dd74166569d4766
2020-12-06Rework hardware probing and RTL-SDR helper startupScott Murray1-17/+32
The lazy startup of the separate helper program for the RTL-SDR backend on playback start was incorrect with respect to the expected behavior the frequency setting verbs. This was not visible during usage by the radio application, but was triggering failures in several tests in the pyagl binding wrapper test suite. To facilitate starting the helper during backend initialization, the probing part of the backend "init" has been split into a separate "probe" function, and all backends have been updated to reflect this change. Logic has been added to enforce that "init" is only called after "probe" has succeeded for a backend, and a comment has been added to radio_impl.h to document this intended behavior. Bug-AGL: SPEC-3717 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ic37331a92bae7cc01ee448e69894fa5f49d08a74
2019-12-19Fixes for corking and restart behavioricefish_8.99.4icefish/8.99.48.99.4Scott Murray1-4/+30
Fixes: - Track playing state in binding code to properly ignore signal-composer events when not playing. - Add changing of pipeline state in response to the GstBus GST_MESSAGE_REQUEST_STATE message to the KF code, this is required to have the second request to switch back to PLAYING state be sent, and hence properly keeping track of corked state. Also added required gstreamer main loop so GstBus actually works. - The alsasrc used in the KF code's gstreamer pipeline seems to not handle the switch to READY state on pause (currently required to trigger Wireplumber policy) as expected; it seems to keep feeding the pipeline, causing long stalls on restart. For now, taking the stream fully down to NULL state seems to work around this issue. Bug-AGL: SPEC-3061, SPEC-3046 Change-Id: I31b2759d10087efbe4ccd885600be95b7029c598 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-12-16Add workaround for Wireplumber policy implementationScott Murray1-2/+16
Add hopefully temporary workarounds for current Wireplumber policy implementation that requires taking gstreamer state to READY or STOPPED to trigger policy. Also add a fix for resuming playback from corked state. Bug-AGL: SPEC-3061, SPEC-3023 Change-Id: I1020f9de1fc7dc82c3bb58f0870880ecbf4c09ef Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-12-14radio: check for corking from PipeWireicefish_8.99.3icefish/8.99.38.99.3Matt Ranostay1-0/+27
Check if PipeWire is corking the audio stream and if so don't process signal-composer events till uncorked Bug-AGL: SPEC-3023 Change-Id: I1a4623022bbe28658bc97b5fe0cda58863f20d8c Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-12-02Migration to binding V3icefish_8.99.2icefish/8.99.28.99.2Li Xiaoming1-8/+8
Bug-AGL: SPEC-2745 Change-Id: I5ee9d3118a302f0edf5fe79a43590818d3d829c3 Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
2019-09-09Update Kingfisher support for PipeWire and security changesicefish_8.99.1icefish/8.99.18.99.1Scott Murray1-29/+48
Changes: - Restore the previous Gstreamer pipeline code that used the Si4689 ALSA input device as a source sink, now with an appropriate PipeWire output sink. This will be required until PipeWire adds some form of loopback service, which could be used instead. - Remove usage of the si_init script, as the sysfs accesses it performs cannot obviously be enabled via SMACK labelling in a safe fashion. Since the Si4689 on the KF will not work without the reset toggling done in si_init, the script is now called at boot by a systemd service added in a corresponding change in meta-agl-bsp. Bug-AGL: SPEC-2716 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I5c5007d809efd4144dd5fbb25d1c07cfe1ff2b8f
2019-06-10Remove support for 4A and pulseaudio completelyGeorge Kiagiadakis1-35/+4
Bug-AGL: SPEC-2473 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: I320be57ce48a63c7e85b8daebf7b094423f580f9
2019-06-04kingfisher: initialize variableGeorge Kiagiadakis1-1/+1
Bug-AGL: SPEC-2473 Change-Id: Idade62b5e0248d1a2e9e9387696a5df012f6953f Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
2019-06-04binding: make 4A truly optionalGeorge Kiagiadakis1-25/+7
The non-4A codepaths were totally broken here Bug-AGL: SPEC-2473 Change-Id: I1c3c49688566684455bf9522f68f506eaf6aa6c3 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
2019-01-04Add audio role open/close supportScott Murray1-41/+6
Rework things so that the 4A audio role is only opened while playing, and closed when stopped. Further work will need to be done to handle the possibility of the output device changing on subsequent opens, both the RTL SDR and Kingfisher case have complications around doing so: - The RTL SDR helper application needs to be enhanced to add an output setting command. Killing it and starting it again would also work, but likely will add noticeable UI latency. - On the Kingfisher, the binding currently has no control over the output used for the loopback, as it is being set up down in the soft-mixer based on HAL values. Change-Id: I4aa83c937972ec5d91f7b78421a11148c7fe0afc Signed-off-by: Scott Murray <scott.murray@konsulko.com> (cherry picked from commit f1d5902c92eafd3aad62e29298502603a9b56d81)
2018-07-17fixed the support for 4a frameworkThierry Bultel1-43/+91
Changed the api call for getting an audio role. Mapped the stop/start operations to mute/unmute actions on role verb. No longer uses a gstreamer pipeline for the sound output, since it is 4a-softmixer that performs the read/write loop instead. Change-Id: I91e4f801a0da866c50b2218622e810d7350ab8a9 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-07-17added api verb for RDS informationThierry Bultel1-1/+39
Added a verb to retrieve the RDS information. Notice that it is only supported on the kingfisher implementation. Change-Id: I0e2a830ff77154eb8cbb780bb599fb49f71a5b1c Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-07-17Set the binding version in cmake instead of sourceThierry Bultel1-1/+0
Setting AFB_BINDING_VERSION is cmake makes merges easier between branches, since it is always defined once at a single place instead that in each file that need it. Also removed the "INSTALL" section with LIBRARY_DESTINATION since it is now treated in app-templates. Change-Id: I7ef5f3b4d2009ab6ec296ac70bfc0a5647f9534c Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-07-17Fixed compilation warningsThierry Bultel1-2/+0
Fixed all the compilation warning that appeared with the latest version of gcc. There are still warnings in the gstreamer headers, that would likely be fixed by a gstreamer bump. Change-Id: I3ae7698dbff47303be366d9755a643a013bb4e51 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-06-05Rework output to directly support 4Aflounder_5.99.1flounder/5.99.15.99.1Scott Murray1-46/+69
When building for 4A, switch to new gstreamer-based ALSA output for the RTL-SDR backend, and the Kingfisher backend now uses a gstreamer pipeline for its loopback to either an ALSA or Pulse sink depending on 4A or not. Using gstreamer instead of direct ALSA output has the benefit of transparently handling resampling to the M3ULCB hardware's required 48 KHz sample rate for the RTL-SDR backend. Change-Id: I2bfbf924927bb461cce88b04aba0e626f8d71215 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2018-06-05Always enable Kingfisher supportScott Murray1-4/+9
Make Kingfisher support unconditional to move all platform detection to run-time. This fixes the issue of violating the application build workflow with the SDK. Additionally, the Kingfisher detection has been improved with an added check for the Si4689 device-tree node to differentiate from a regular M3ULCB, and the Kingfisher output has been fixed for recent BSP changes. Change-Id: I28e18a065385205aefec974079b0a9c2d31059b6 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2018-03-20binding: update kingfisher i2c bus numberHarunobu Kurokawa1-4/+4
The Si4689 radio chip I2C bus number has shifted from i2c-11 to i2c-12. This updates I2C bus number in SI scripts accordingly. Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
2018-03-20Add Kingfisher Si4689 supportHarunobu Kurokawa1-0/+396
Add conditionally compilable support for the Si4689 radio on the M3ULCB Kingfisher infotainment board. The codebase has been refactored to allow multiple radio implementations, and when Kingfisher support is enabled, the binding will first look for a USB RTL-SDR adapter, then fallback to the Kingfisher Si4689 if one is not found. This allows easily switching to a RTL-SDR adapter if this initial Kingfisher support encounters issues. The back end implementation relies on a patched version of the "si_ctl" utility from Cogent Embedded's Kingfisher BSP changes. The modifications to it add FM band plan selection and scanning threshold tweaking for poor radio environments. Audio output is achieved by looping the radio's PulseAudio source to the appropriate sink depending on 4A or non-4A operation. For 4A compatibility, the PulseAudio source is created if it does not exist, which currently is the case due to PulseAudio's udev module being disabled when 4A is enabled. Additionally, the FM band plan for Japan has been corrected to go to 95 MHz, and a README.md file has been added documenting the optional configuration that can be done via /etc/xdg/AGL.conf for band plan selection and scanning sensitivity. Change-Id: I204906fed741d917fc3b8be962deadb4e59989db Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>