Skip to content
Snippets Groups Projects
Commit 2c8742bf authored by Gianfranco Mariotti's avatar Gianfranco Mariotti Committed by Tobias Kahlki
Browse files

[D18] add Bluetooth audio support

* enabled at u-boot: seco_config tool
* audio over SAI3 interface
  * SAI3 --> carrier board or onboard bluetooth (I2S2 SMARC | AUDIO BT)
* Filesystem support --> pulseaudio + bluez5
  * Yocto packages:
    pulseaudio-server pulseaudio-module-cli pulseaudio-misc
    pulseaudio-module-device-manager bluez5-noinst-tools bluez5-obex
    bluez5-testtools pulseaudio-module-bluetooth-discover
    pulseaudio-module-bluetooth-policy pulseaudio-module-bluez5-discover
    pulseaudio-module-bluez5-device pulseaudio-module-switch-on-connect
    pulseaudio-module-loopback
* Test details:
  root@seco-imx8mp-d18:~# pulseaudio -D
  root@seco-imx8mp-d18:~# bluetoothctl
  [bluetooth]# default-agent
  [bluetooth]# power on
  [bluetooth]# scan on
  ...
  Device 74:45:CE:40:2B:DD WH-CH510
  ...
  [bluetooth]# scan off
  [bluetooth]# trust 74:45:CE:40:2B:DD
  [bluetooth]# pair 74:45:CE:40:2B:DD
  [bluetooth]# connect 74:45:CE:40:2B:DD
  [WH-CH510]# info
  Device 74:45:CE:40:2B:DD (public)
    Name: WH-CH510
    Alias: WH-CH510
    Class: 0x00240404
    ...
  [WH-CH510]# exit
  root@seco-imx8mp-d18:~# pactl list sinks short | awk '{print $2}'
  root@seco-imx8mp-d18:~# paplay -d bluez_sink.74_45_CE_40_2B_DD.a2dp_sink test.wav
parent 246faf5a
No related branches found
No related tags found
2 merge requests!455CI: Update gitlab-ci,!374dts:d18: Add support for D18 SMARC (aka Levy) module
DTC_FLAGS ?= -@ -H epapr
dtbo-$(CONFIG_ARCH_MXC) += \
seco-imx8mp-d18-audio-btsco.dtbo
targets += dtbs dtbs_install
targets += $(dtbo-y)
......
/*
* Copyright 2021 SECO
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <dt-bindings/clock/imx8mp-clock.h>
/dts-v1/;
/plugin/;
/ {
compatible = "fsl,imx8mp-evk", "seco,imx8mp-d18", "fsl,imx8mp";
/* __________________________________________________________________________
* | |
* | AUDIO BLUETOOTH |
* |__________________________________________________________________________|
*/
fragment@0 {
target = <&bt_sco_codec>;
__overlay__ {
#sound-dai-cells = <1>;
compatible = "linux,bt-sco";
};
};
fragment@1 {
target = <&soundbtsco>;
__overlay__ {
status = "okay";
compatible = "simple-audio-card";
simple-audio-card,name = "bt-sco-audio";
simple-audio-card,format = "dsp_a";
simple-audio-card,bitclock-inversion;
simple-audio-card,frame-master = <&btcpu>;
simple-audio-card,bitclock-master = <&btcpu>;
btcpu: simple-audio-card,cpu {
sound-dai = <&sai3>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
simple-audio-card,codec {
sound-dai = <&bt_sco_codec 1>;
};
};
};
fragment@2 {
target = <&sai3>;
__overlay__ {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
status = "okay";
};
};
};
......@@ -101,7 +101,7 @@ reg_audio: regulator-soc-audio {
bt_sco_codec: bt_sco_codec {
};
sound-bt-sco {
soundbtsco: sound-bt-sco {
};
sound {
......@@ -896,9 +896,6 @@ MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
>;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment