Skip to contentSkip to conversation

Handling of serializers

PATCH In review Vishal Thanki 3 participants 7 messages Feb 27, 2018 – May 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Handling of serializers

On a custom AM33xx based platform, we use 4 channels for audio output (2
* Left/Right) by making use of two TX serializers. The audio input path only uses 2 channels, hence one RX serializer. If the recording is started before the playback, the playback cannot make use of all 4 channels because of the imposed max number of channels by recording. And if playback is started before recording, the hw_params set during recording stream would disable an active TX serializer which causes audio distortion. I have tried to fix this unwanted behavior in following patch. Please comment if this should be done differently.

Vishal Thanki (1):
ASoC: davinci-mcasp: Only disable inactive serializer

 sound/soc/davinci/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 ASoC: davinci-mcasp: Only disable inactive serializer

As a side effect of the following commit, the active TX serializer may get disabled which may result in distorted audio output.

ASoC: davinci-mcasp: Add support for multichannel playback (2952b27e2e463b28d5c0f04000f96b968137ca42)

For example, if a 4 channel I2S playback with two TX serializers is activated. Later on, if a recording of 2 channels, with only 1 RX serializer is started, which will also disable one of the TX serializer because max_active_serializers is only calculated for RX (recording) stream. This patch fixes this issue.

---
 sound/soc/davinci/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +1 -1
index 03ba218160ca..f382dd55cae0 100644
@@ -789,7 +789,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
 					rx_ser < max_active_serializers) {
 			mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AXR(i));
 			rx_ser++;
-		} else {
+		} else if (mcasp->serial_dir[i] == INACTIVE_MODE) {
 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
 				       SRMOD_INACTIVE, SRMOD_MASK);
 		}
Signature · 1 line
2.14.3
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] ASoC: davinci-mcasp: Only disable inactive serializer

Quoted 4 lines · Vishal Thanki

As a side effect of the following commit, the active TX serializer may get disabled which may result in distorted audio output.

Quoted 8 lines

ASoC: davinci-mcasp: Add support for multichannel playback (2952b27e2e463b28d5c0f04000f96b968137ca42)

For example, if a 4 channel I2S playback with two TX serializers is activated. Later on, if a recording of 2 channels, with only 1 RX serializer is started, which will also disable one of the TX serializer because max_active_serializers is only calculated for RX (recording) stream. This patch fixes this issue.

Quoted 11 lines
---
 sound/soc/davinci/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +0 -0
index 03ba218160ca..f382dd55cae0 100644

sound/soc/davinci/davinci-mcasp.c static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, · line 795

Quoted 8 lines
sound/soc/davinci/davinci-mcasp.c +1 -1
@@ -789,7 +789,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
 					rx_ser < max_active_serializers) {
 			mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AXR(i));
 			rx_ser++;
-		} else {
+		} else if (mcasp->serial_dir[i] == INACTIVE_MODE) {
 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
 				       SRMOD_INACTIVE, SRMOD_MASK);
 		}

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

Re: [PATCH 1/1] ASoC: davinci-mcasp: Only disable inactive serializer

Hi Mark,

Quoted 10 lines · Peter Ujfalusi
Quoted 7 lines · Vishal Thanki

As a side effect of the following commit, the active TX serializer may get disabled which may result in distorted audio output.

ASoC: davinci-mcasp: Add support for multichannel playback (2952b27e2e463b28d5c0f04000f96b968137ca42)

Quoted 9 lines
Quoted 5 lines

For example, if a 4 channel I2S playback with two TX serializers is activated. Later on, if a recording of 2 channels, with only 1 RX serializer is started, which will also disable one of the TX serializer because max_active_serializers is only calculated for RX (recording) stream. This patch fixes this issue.

Quoted 1 line

Just a gentle reminder, can this patch be accepted for the next release?

Regards,
Vishal

maintainer
#4 lore raw

Re: [PATCH 1/1] ASoC: davinci-mcasp: Only disable inactive serializer

Quoted 1 line · Vishal Thanki

Just a gentle reminder, can this patch be accepted for the next release?

Please don't send content free pings and please allow a reasonable time for review. People get busy, go on holiday, attend conferences and so on so unless there is some reason for urgency (like critical bug fixes) please allow at least a couple of weeks for review. If there have been review comments then people may be waiting for those to be addressed. Sending content free pings just adds to the mail volume (if they are seen at all) and if something has gone wrong you'll have to resend the patches anyway.

maintainer
#5 lore raw

Re: [PATCH 1/1] ASoC: davinci-mcasp: Only disable inactive serializer

In reply to Vishal Thanki
Quoted 7 lines · Vishal Thanki
Quoted 3 lines · Peter Ujfalusi
Quoted 1 line

Just a gentle reminder, can this patch be accepted for the next release?

Oh, and it was just pointed out to me:

As documented in SubmittingPatches please send patches to the maintainers for the code you would like to change. The normal kernel workflow is that people apply patches from their inboxes, if they aren't copied they are likely to not see the patch at all and it is much more difficult to apply patches.

maintainer
#6 lore raw

Applied "ASoC: davinci-mcasp: Only disable inactive serializer" to the asoc tree

In reply to Vishal Thanki

The patch

ASoC: davinci-mcasp: Only disable inactive serializer

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 096a8f835e7d19f0402386353586d285566eee06 Mon Sep 17 00:00:00 2001

From: Vishal Thanki <[email protected]>
Date: Fri, 11 May 2018 14:33:37 +0200
Subject: [PATCH] ASoC: davinci-mcasp: Only disable inactive serializer

As a side effect of the following commit, the active TX serializer may get disabled which may result in distorted audio output.

ASoC: davinci-mcasp: Add support for multichannel playback (2952b27e2e463b28d5c0f04000f96b968137ca42)

For example, if a 4 channel I2S playback with two TX serializers is activated. Later on, if a recording of 2 channels, with only 1 RX serializer is started, which will also disable one of the TX serializer because max_active_serializers is only calculated for RX (recording) stream. This patch fixes this issue.

---
 sound/soc/davinci/davinci-mcasp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +1 -1
index 79fc4aa2fa29..1f96c9dbe9c4 100644
@@ -789,7 +789,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
 					rx_ser < max_active_serializers) {
 			mcasp_clr_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AXR(i));
 			rx_ser++;
-		} else {
+		} else if (mcasp->serial_dir[i] == INACTIVE_MODE) {
 			mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
 				       SRMOD_INACTIVE, SRMOD_MASK);
 		}
Signature · 1 line
2.17.0