Skip to content

ASoC: intel: sof_sdw: add rt711 rt1316 rt714 codecs support. - #2340

Merged
plbossart merged 2 commits into
thesofproject:topic/sof-devfrom
bardliao:rt711-rt1316-rt714-machine
Aug 13, 2020
Merged

ASoC: intel: sof_sdw: add rt711 rt1316 rt714 codecs support.#2340
plbossart merged 2 commits into
thesofproject:topic/sof-devfrom
bardliao:rt711-rt1316-rt714-machine

Conversation

@bardliao

Copy link
Copy Markdown
Collaborator

Add rt711, rt1316, and rt614 sdca codecs support in sof_sdw machine driver.

Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com

@plbossartplbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor change request so that we can have different inits for rt711-sdca and rt714, this will be useful if we want a separate component string to select a different UCM file, or if we have different maps/widgets.

Comment threadsound/soc/intel/boards/sof_sdw.c Outdated
Comment threadsound/soc/intel/boards/sof_sdw.c Outdated
.part_id = 0x714,
.direction = {false, true},
.dai_name = "rt715-aif2",
.init = sof_sdw_rt715_init,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, should probably be a different init function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao is there a reason why you added a new file for sof_sdw_rt1316 but not for rt711-sdca and also not for rt714?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao is there a reason why you added a new file for sof_sdw_rt1316 but not for rt711-sdca and also not for rt714?

I thought rt711 and rt715 sdca version are basically the same as non-sdca version when I was implementing this. However, I checked with @shumingfan today and found they can be considered as different codecs. So I am going to add a new file for each codec.

@bardliao
bardliaoforce-pushed the rt711-rt1316-rt714-machine branch from f9550ac to 4f370d7CompareAugust 4, 2020 10:00
@bardliao

Copy link
Copy Markdown
CollaboratorAuthor

minor change request so that we can have different inits for rt711-sdca and rt714, this will be useful if we want a separate component string to select a different UCM file, or if we have different maps/widgets.

I would like to move the component string setting outside the init function. The maps/widgets are the same (at least for now). See the update commits.

Comment threadsound/soc/intel/boards/sof_sdw_rt1316.c
{ "Speaker", NULL, "rt1316-2 SPOR" },
};

static const struct snd_kcontrol_new rt1316_controls[] = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <sound/control.h>

@plbossart

Copy link
Copy Markdown
Member

minor change request so that we can have different inits for rt711-sdca and rt714, this will be useful if we want a separate component string to select a different UCM file, or if we have different maps/widgets.

I would like to move the component string setting outside the init function. The maps/widgets are the same (at least for now). See the update commits.

ok, but where would it be? in the codec-info table?

@bardliao

Copy link
Copy Markdown
CollaboratorAuthor

minor change request so that we can have different inits for rt711-sdca and rt714, this will be useful if we want a separate component string to select a different UCM file, or if we have different maps/widgets.

I would like to move the component string setting outside the init function. The maps/widgets are the same (at least for now). See the update commits.

ok, but where would it be? in the codec-info table?

Yes, I add const char *card_components; in struct sof_sdw_codec_info{}, and append components string when a dai link is created.

@plbossart

Copy link
Copy Markdown
Member

Yes, I add const char *card_components; in struct sof_sdw_codec_info{}, and append components string when a dai link is created.

You'd want the component string to be added when the codec is initialized. There are cases where we have more than one dailink per codec (e.g. capture/playback for rt711).

@bardliao

Copy link
Copy Markdown
CollaboratorAuthor

Yes, I add const char *card_components; in struct sof_sdw_codec_info{}, and append components string when a dai link is created.

You'd want the component string to be added when the codec is initialized. There are cases where we have more than one dailink per codec (e.g. capture/playback for rt711).

Yes, that's why I test !strstr(card->components, info->card_components) before appending the string.

@plbossart

Copy link
Copy Markdown
Member

Yes, I add const char *card_components; in struct sof_sdw_codec_info{}, and append components string when a dai link is created.

You'd want the component string to be added when the codec is initialized. There are cases where we have more than one dailink per codec (e.g. capture/playback for rt711).

Yes, that's why I test !strstr(card->components, info->card_components) before appending the string.

This works but it's a bit of a hack, no?

@bardliao

Copy link
Copy Markdown
CollaboratorAuthor

Yes, I add const char *card_components; in struct sof_sdw_codec_info{}, and append components string when a dai link is created.

You'd want the component string to be added when the codec is initialized. There are cases where we have more than one dailink per codec (e.g. capture/playback for rt711).

Yes, that's why I test !strstr(card->components, info->card_components) before appending the string.

This works but it's a bit of a hack, no?

Yes, I thought that but I didn't find a better way to do it if I want to reuse the init functions

Comment threadsound/soc/intel/boards/sof_sdw.c Outdated
@bardliao
bardliaoforce-pushed the rt711-rt1316-rt714-machine branch 2 times, most recently from 24f9f65 to 09cb1a2CompareAugust 11, 2020 07:46
Comment threadsound/soc/intel/boards/sof_sdw.c
@bardliao
bardliaoforce-pushed the rt711-rt1316-rt714-machine branch from 09cb1a2 to 050bf2aCompareAugust 12, 2020 12:46
Add rt711, rt1316, and rt614 sdca codecs support in sof_sdw machine driver.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao
bardliaoforce-pushed the rt711-rt1316-rt714-machine branch from 050bf2a to c866b7bCompareAugust 12, 2020 12:51
"struct snd_soc_dapm_widget" and "struct snd_kcontrol_new" are used in most
of these .c files. Adding the header files to prevent from depending on
<sound/soc.h>
Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@lyakh
lyakh self-requested a review August 13, 2020 06:20

@lyakhlyakh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a formal ack

@plbossart
plbossart merged commit 793a083 into thesofproject:topic/sof-devAug 13, 2020
oder-chiou pushed a commit to oder-chiou/linux-soundwire that referenced this pull request May 5, 2026
…format
For incoming SCO connection with transparent coding format, alt setting
of CVSD is getting applied instead of Transparent.
Before fix:
< HCI Command: Accept Synchron.. (0x01|0x0029) plen 21 thesofproject#2196 [hci0] 321.342548
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02)
Packet type: 0x003f
HV1 may be used
HV2 may be used
HV3 may be used
EV3 may be used
EV4 may be used
EV5 may be used
> HCI Event: Command Status (0x0f) plen 4 thesofproject#2197 [hci0] 321.343585
Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
Status: Success (0x00)
> HCI Event: Synchronous Connect Comp.. (0x2c) plen 17 thesofproject#2198 [hci0] 321.351666
Status: Success (0x00)
Handle: 257
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Link type: eSCO (0x02)
Transmission interval: 0x0c
Retransmission window: 0x04
RX packet length: 60
TX packet length: 60
Air mode: Transparent (0x03)
........
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2336 [hci0] 321.383655
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#2337 [hci0] 321.389558
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2338 [hci0] 321.393615
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2339 [hci0] 321.393618
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2340 [hci0] 321.393618
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#2341 [hci0] 321.397070
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2342 [hci0] 321.403622
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2343 [hci0] 321.403625
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2344 [hci0] 321.403625
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2345 [hci0] 321.403625
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#2346 [hci0] 321.404569
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#2347 [hci0] 321.412091
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2348 [hci0] 321.413626
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2349 [hci0] 321.413630
> SCO Data RX: Handle 257 flags 0x00 dlen 48 thesofproject#2350 [hci0] 321.413630
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#2351 [hci0] 321.419674
After fix:
< HCI Command: Accept Synchronou.. (0x01|0x0029) plen 21 thesofproject#309 [hci0] 49.439693
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02)
Packet type: 0x003f
HV1 may be used
HV2 may be used
HV3 may be used
EV3 may be used
EV4 may be used
EV5 may be used
> HCI Event: Command Status (0x0f) plen 4 thesofproject#310 [hci0] 49.440308
Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
Status: Success (0x00)
> HCI Event: Synchronous Connect Complete (0x2c) plen 17 thesofproject#311 [hci0] 49.449308
Status: Success (0x00)
Handle: 257
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Link type: eSCO (0x02)
Transmission interval: 0x0c
Retransmission window: 0x04
RX packet length: 60
TX packet length: 60
Air mode: Transparent (0x03)
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#312 [hci0] 49.450421
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#313 [hci0] 49.457927
> HCI Event: Max Slots Change (0x1b) plen 3 thesofproject#314 [hci0] 49.460345
Handle: 256
Max slots: 5
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#315 [hci0] 49.465453
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#316 [hci0] 49.470502
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#317 [hci0] 49.470519
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#318 [hci0] 49.472996
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#319 [hci0] 49.480412
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#320 [hci0] 49.480492
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#321 [hci0] 49.487989
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#322 [hci0] 49.490303
< SCO Data TX: Handle 257 flags 0x00 dlen 60 thesofproject#323 [hci0] 49.495496
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#324 [hci0] 49.500304
> SCO Data RX: Handle 257 flags 0x00 dlen 60 thesofproject#325 [hci0] 49.500311
Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Lokendra Singh <lokendra.singh@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@bardliao@plbossart@lyakh@RanderWang