All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Lee Jones <lee.jones@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: omap4-droid4: voice call support was Re: [PATCHv5,5/5] ARM: dts: omap4-droid4: add soundcard
Date: Tue, 27 Mar 2018 22:41:12 +0200	[thread overview]
Message-ID: <20180327204111.GA2254@amd> (raw)
In-Reply-To: <20180326231022.vilvxwqkniffk775@earth.universe>

[-- Attachment #1: Type: text/plain, Size: 3817 bytes --]

Hi!

> > > My understanding is, that we only need to replace the audio-graph-card
> > > driver to something more complex. The VOICE DAI needs to be configured
> > > differently based on the use case:
> > > 
> > > call:
> > > 	* mode=i2s
> > > 	* freq=26000000
> > > 	* samprate=16000 or samprate=8000
> > 
> > Ok, lets ignore bluetooth for now. There is "normal" mode, and then
> > there's "call" mode, right? Where's "normal" mode configured?
> 
> mcbsp3_port: port {
> 	cpu_dai3: endpoint {
> 		dai-format = "dsp_a";
> 		frame-master = <&cpcap_audio_codec1>;
> 		bitclock-master = <&cpcap_audio_codec1>;
> 		remote-endpoint = <&cpcap_audio_codec1>;
> 	};
> };

Hmm. Can't tell mode and freq here easily. Does it default to i2s /
26000000?

> > Could we simply always configure the VOICE DAI in the call mode? Yes,
> > it would limit samplerates to 8 or 16k, but .. that's not too
> > important limitation for voice codec...?
> 
> I think we could configure "normal" mode to use the same settings
> as call mode. But ASoC will disable CPCAP, since there will be no
> active user without ASoC knowing about the modem.

Ok, but then we can just start playback/recording with the call, and
everything should work, no?

But Motorola code seems to do different magic according to modem type,
so things may not be as easy.

                if (pdata->voice_type == VOICE_TYPE_STE) {
                        /* STE_M570 */
                        ret = cpcap_audio_reg_write(codec, 2, 0xAE06);
                        if (rate == 16000)
				ret |= cpcap_audio_reg_write(codec, 1, 0x8720);
                        else
                                ret |= cpcap_audio_reg_write(codec, 1, 0x8120);
                } else if (pdata->voice_type == VOICE_TYPE_QC) {
                        /* MDM6600 */
                        ret = cpcap_audio_reg_write(codec, 2, 0xAE02);
                        if (rate == 16000) {
                                ret |= cpcap_audio_reg_write(codec, 1, 0x6720);
                        } else {
                                ret |= cpcap_audio_reg_write(codec, 1, 0x6120);
                        }


> > > "audio-graph-card" is not capable of doing this. I was planning to
> > > try "audio-graph-scu-card" in combination with adding codecs for the
> > > modem and BT to DT. If that does not work we need a Droid 4 specific
> > > soundcard driver.
> > > 
> > > Either way "audio-graph-card" is not the correct driver for D4. I
> > > added it nevertheless, since it gets audio working for now and there
> > > is no risk of DT breakage. Old *.dtb will continue to work with the
> > > "audio-graph-card" even after we switch to something else.
> > 
> > Well, you'll still cause regressions when you change the dts, as
> > people will have wrong .config for new dts.
> 
> That's correct, the .config needs to change. I think that's
> ok, because the only alternative is having no audio support
> at all until the soundcard driver is ready. This means, that
> you also need to change .config once its ready (in case you
> want to use it).

Ok, another problem seems to be that spaces in audio device name seem
to confuse the userland.

Aha, here:

user@devuan:~$ cat /proc/asound/cards
 0 [H58006000encode]: HDMI_58006000_e - HDMI 58006000.encoder
                       HDMI 58006000.encoder
 1 [Audio          ]: Droid_4_Audio - Droid 4 Audio
                       Droid 4 Audio
		       
See how the card is refered simply as "Audio"? Same thing then happens
in alsa "state" file:

state.Audio {
        control.1 {

.

Best regards,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	kernel@collabora.com, Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Mark Brown <broonie@kernel.org>,
	linux-omap@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Subject: Re: omap4-droid4: voice call support was Re: [PATCHv5, 5/5] ARM: dts: omap4-droid4: add soundcard
Date: Tue, 27 Mar 2018 22:41:12 +0200	[thread overview]
Message-ID: <20180327204111.GA2254@amd> (raw)
In-Reply-To: <20180326231022.vilvxwqkniffk775@earth.universe>


[-- Attachment #1.1: Type: text/plain, Size: 3817 bytes --]

Hi!

> > > My understanding is, that we only need to replace the audio-graph-card
> > > driver to something more complex. The VOICE DAI needs to be configured
> > > differently based on the use case:
> > > 
> > > call:
> > > 	* mode=i2s
> > > 	* freq=26000000
> > > 	* samprate=16000 or samprate=8000
> > 
> > Ok, lets ignore bluetooth for now. There is "normal" mode, and then
> > there's "call" mode, right? Where's "normal" mode configured?
> 
> mcbsp3_port: port {
> 	cpu_dai3: endpoint {
> 		dai-format = "dsp_a";
> 		frame-master = <&cpcap_audio_codec1>;
> 		bitclock-master = <&cpcap_audio_codec1>;
> 		remote-endpoint = <&cpcap_audio_codec1>;
> 	};
> };

Hmm. Can't tell mode and freq here easily. Does it default to i2s /
26000000?

> > Could we simply always configure the VOICE DAI in the call mode? Yes,
> > it would limit samplerates to 8 or 16k, but .. that's not too
> > important limitation for voice codec...?
> 
> I think we could configure "normal" mode to use the same settings
> as call mode. But ASoC will disable CPCAP, since there will be no
> active user without ASoC knowing about the modem.

Ok, but then we can just start playback/recording with the call, and
everything should work, no?

But Motorola code seems to do different magic according to modem type,
so things may not be as easy.

                if (pdata->voice_type == VOICE_TYPE_STE) {
                        /* STE_M570 */
                        ret = cpcap_audio_reg_write(codec, 2, 0xAE06);
                        if (rate == 16000)
				ret |= cpcap_audio_reg_write(codec, 1, 0x8720);
                        else
                                ret |= cpcap_audio_reg_write(codec, 1, 0x8120);
                } else if (pdata->voice_type == VOICE_TYPE_QC) {
                        /* MDM6600 */
                        ret = cpcap_audio_reg_write(codec, 2, 0xAE02);
                        if (rate == 16000) {
                                ret |= cpcap_audio_reg_write(codec, 1, 0x6720);
                        } else {
                                ret |= cpcap_audio_reg_write(codec, 1, 0x6120);
                        }


> > > "audio-graph-card" is not capable of doing this. I was planning to
> > > try "audio-graph-scu-card" in combination with adding codecs for the
> > > modem and BT to DT. If that does not work we need a Droid 4 specific
> > > soundcard driver.
> > > 
> > > Either way "audio-graph-card" is not the correct driver for D4. I
> > > added it nevertheless, since it gets audio working for now and there
> > > is no risk of DT breakage. Old *.dtb will continue to work with the
> > > "audio-graph-card" even after we switch to something else.
> > 
> > Well, you'll still cause regressions when you change the dts, as
> > people will have wrong .config for new dts.
> 
> That's correct, the .config needs to change. I think that's
> ok, because the only alternative is having no audio support
> at all until the soundcard driver is ready. This means, that
> you also need to change .config once its ready (in case you
> want to use it).

Ok, another problem seems to be that spaces in audio device name seem
to confuse the userland.

Aha, here:

user@devuan:~$ cat /proc/asound/cards
 0 [H58006000encode]: HDMI_58006000_e - HDMI 58006000.encoder
                       HDMI 58006000.encoder
 1 [Audio          ]: Droid_4_Audio - Droid 4 Audio
                       Droid 4 Audio
		       
See how the card is refered simply as "Audio"? Same thing then happens
in alsa "state" file:

state.Audio {
        control.1 {

.

Best regards,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-03-27 20:41 UTC|newest]

Thread overview: 173+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 20:02 [PATCHv5 0/5] Motorola Droid 4 Audio Support Sebastian Reichel
2018-02-23 20:02 ` Sebastian Reichel
2018-02-23 20:02 ` [PATCHv5 1/5] dt-bindings: mfd: motorola-cpcap: document audio-codec Sebastian Reichel
2018-02-23 20:02   ` Sebastian Reichel
2018-02-26 10:08   ` Mark Brown
2018-02-26 10:08     ` Mark Brown
2018-03-02 19:07   ` Rob Herring
2018-03-02 19:07     ` Rob Herring
2018-03-07 16:30   ` Lee Jones
2018-03-07 16:30     ` Lee Jones
2018-02-23 20:02 ` [PATCHv5 2/5] ASoC: codec: cpcap: new codec Sebastian Reichel
2018-02-23 20:02   ` Sebastian Reichel
2018-02-26  1:36   ` [alsa-devel] " kbuild test robot
2018-02-26  1:36     ` kbuild test robot
2018-02-27 11:03   ` Mark Brown
2018-02-28 11:06   ` Applied "ASoC: cpcap: new codec" to the asoc tree Mark Brown
2018-02-28 11:06     ` Mark Brown
2018-02-23 20:02 ` [PATCHv5 3/5] mfd: motorola-cpcap: Add audio-codec support Sebastian Reichel
2018-02-23 20:02   ` Sebastian Reichel
2018-03-07 16:32   ` Lee Jones
2018-03-07 16:32     ` Lee Jones
2018-03-08  9:46     ` Sebastian Reichel
2018-03-08  9:53       ` Lee Jones
2018-03-08  9:53         ` Lee Jones
2018-03-08 10:27         ` Sebastian Reichel
2018-03-08 10:48           ` Lee Jones
2018-03-08 10:48             ` Lee Jones
2018-03-08 11:25             ` Mark Brown
2018-03-08 11:25               ` Mark Brown
2018-03-09  8:34               ` Lee Jones
2018-03-09 11:19                 ` Sebastian Reichel
2018-03-09 11:19                   ` Sebastian Reichel
2018-03-09 12:40                 ` Mark Brown
2018-03-09 12:40                   ` Mark Brown
2018-03-09 15:11                   ` Tony Lindgren
2018-03-09 16:48                     ` Sebastian Reichel
2018-03-09 16:48                       ` Sebastian Reichel
2018-03-08 12:54             ` Sebastian Reichel
2018-03-08 17:07       ` Tony Lindgren
2018-03-09 11:29         ` Sebastian Reichel
2018-03-12  9:08           ` Lee Jones
2018-03-12  9:08             ` Lee Jones
2018-02-23 20:02 ` [PATCHv5 4/5] ARM: dts: motorola-cpcap-mapphone: add audio-codec Sebastian Reichel
2018-02-23 20:02   ` Sebastian Reichel
2018-02-23 20:02 ` [PATCHv5 5/5] ARM: dts: omap4-droid4: add soundcard Sebastian Reichel
2018-02-23 20:02   ` Sebastian Reichel
2018-03-22 20:48   ` [PATCHv5,5/5] " Pavel Machek
2018-03-22 20:48     ` [PATCHv5, 5/5] " Pavel Machek
2018-03-22 23:48     ` [PATCHv5,5/5] " Sebastian Reichel
2018-03-23 10:09       ` Pavel Machek
2018-03-23 10:09         ` [PATCHv5, 5/5] " Pavel Machek
2018-03-23 10:30         ` [PATCHv5,5/5] " Sebastian Reichel
2018-03-23 10:30           ` [PATCHv5, 5/5] " Sebastian Reichel
2018-03-23 11:06           ` [PATCHv5,5/5] " Pavel Machek
2018-03-23 11:06             ` [PATCHv5, 5/5] " Pavel Machek
2018-03-23 11:08           ` [PATCHv5,5/5] " Pavel Machek
2018-03-23 11:08             ` [PATCHv5, 5/5] " Pavel Machek
2018-03-23 14:09           ` [PATCHv5,5/5] " Pavel Machek
2018-03-23 14:11           ` Pavel Machek
2018-03-23 14:11             ` [PATCHv5, 5/5] " Pavel Machek
2018-03-26 14:16           ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-26 15:58             ` Sebastian Reichel
2018-03-26 20:31               ` Pavel Machek
2018-03-26 23:10                 ` Sebastian Reichel
2018-03-27 20:41                   ` Pavel Machek [this message]
2018-03-27 20:41                     ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-27 20:51                     ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-27 12:14               ` Mark Brown
2018-03-27 12:14                 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Mark Brown
2018-03-27 22:22                 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Sebastian Reichel
2018-03-27 22:22                   ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Sebastian Reichel
2018-03-28  2:29                   ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Mark Brown
2018-03-28  2:29                     ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Mark Brown
2018-03-28 14:02                     ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Sebastian Reichel
2018-03-28 14:02                       ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Sebastian Reichel
2018-03-29  1:45                       ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-29 13:36                         ` Sebastian Reichel
2018-03-29 13:59                           ` Tony Lindgren
2018-03-29 15:46                             ` Sebastian Reichel
2018-03-29 16:06                               ` Tony Lindgren
2018-03-30 10:57                                 ` Sebastian Reichel
2018-03-30 10:57                                   ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Sebastian Reichel
2018-03-30 22:31                                 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-29 16:37                               ` Pavel Machek
2018-03-29 16:41                                 ` Tony Lindgren
2018-03-29 18:40                                   ` Pavel Machek
2018-03-29 18:40                                     ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-29 21:56                                     ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-30 10:37                                       ` Pavel Machek
2018-03-30 13:07                                         ` Merlijn Wajer
2018-03-30 15:22                                           ` Tony Lindgren
2018-03-30 15:25                                             ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Michael Nazzareno Trimarchi
2018-03-30 15:44                                               ` [alsa-devel] " Tony Lindgren
2018-03-30 15:44                                                 ` Tony Lindgren
2018-03-30 17:46                                                 ` [alsa-devel] " Tony Lindgren
2018-03-30 15:34                                             ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-30 15:34                                               ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-30 17:50                                           ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-30 18:01                                             ` Pavel Machek
2018-03-30 18:01                                               ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-30 20:46                                               ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-29 14:09                         ` Pavel Machek
2018-03-29 14:21                           ` Tony Lindgren
2018-03-29 16:08                         ` Pavel Machek
2018-03-29 16:08                           ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-29 16:34                           ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-29 16:34                             ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Tony Lindgren
2018-03-29 18:05                             ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-29 18:05                               ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-29 21:58                               ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-29 21:58                                 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Tony Lindgren
2018-04-01 23:17                                 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-04-01 23:17                                   ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Tony Lindgren
2018-03-31 14:55                         ` call/normal switch was Re: omap4-droid4: voice call support was Pavel Machek
2018-03-31 14:55                           ` Pavel Machek
2018-03-31 18:19                           ` Tony Lindgren
2018-03-31 19:19                             ` Pavel Machek
2018-03-31 19:19                               ` Pavel Machek
2018-03-31 19:46                               ` Pavel Machek
2018-03-31 19:46                                 ` Pavel Machek
2018-03-31 19:55                                 ` Pavel Machek
2018-03-31 19:55                                   ` Pavel Machek
2018-03-31 23:43                                   ` Tony Lindgren
2018-04-01  6:48                                     ` Pavel Machek
2018-04-01 13:18                                     ` Pavel Machek
2018-04-01 13:18                                       ` Pavel Machek
2018-04-01 15:36                                       ` Tony Lindgren
2018-04-01 15:36                                         ` Tony Lindgren
2018-04-01 17:30                                         ` Tony Lindgren
2018-04-02 15:50                                           ` Dan Williams
2018-04-02 15:57                                             ` Tony Lindgren
2018-04-03 15:04                                               ` Tony Lindgren
2018-04-03 15:04                                                 ` Tony Lindgren
2018-04-03 15:50                                                 ` Pavel Machek
2018-04-03 15:50                                                   ` Pavel Machek
2018-04-03 19:44                                                   ` Tony Lindgren
2018-04-06 12:04                                                     ` Pavel Machek
2018-04-06 12:04                                                       ` Pavel Machek
2018-04-06 12:23                                                       ` Merlijn Wajer
2018-04-06 12:23                                                         ` Merlijn Wajer
2018-04-06 12:45                                                         ` Pavel Machek
2018-04-06 12:45                                                           ` Pavel Machek
2018-04-06 22:02                                                         ` Pavel Machek
2018-04-07  8:10                                                         ` simultaneous voice/data works (was Re: call/normal switch was Re: omap4-droid4: voice call support was) Pavel Machek
2018-04-07  8:10                                                           ` Pavel Machek
2018-04-07 12:22                                                           ` Pavel Machek
2018-04-07 12:22                                                             ` Pavel Machek
2018-04-08  2:44                                                             ` Dan Williams
2018-04-08  7:41                                                               ` Pavel Machek
2018-04-09  3:15                                                                 ` Dan Williams
2018-04-09 14:08                                                               ` Tony Lindgren
2018-04-09 15:53                                                                 ` Dan Williams
2018-04-09 20:21                                                                 ` Pavel Machek
2018-04-09 20:21                                                                   ` Pavel Machek
2018-04-10 10:58                                                                 ` Pavel Machek
2018-04-10 10:58                                                                   ` Pavel Machek
2018-04-10 13:50                                                                   ` Tony Lindgren
2018-04-10 13:50                                                                     ` Tony Lindgren
2018-04-11 11:43                                                                     ` Pavel Machek
2018-04-11 11:43                                                                       ` Pavel Machek
2018-04-03 22:11                                         ` call/normal switch was Re: omap4-droid4: voice call support was Pavel Machek
2018-04-03 22:11                                           ` Pavel Machek
2018-03-31 19:46                               ` Tony Lindgren
2018-03-31 19:46                                 ` Tony Lindgren
2018-04-02 15:06                       ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] ARM: dts: omap4-droid4: add soundcard Mark Brown
2018-04-02 15:06                         ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Mark Brown
2018-03-28  9:00               ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-28  9:36                 ` Pavel Machek
2018-03-28  9:36                   ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-04-03  8:52       ` [PATCHv5,5/5] " Pavel Machek
2018-02-23 22:24 ` [PATCHv5 0/5] Motorola Droid 4 Audio Support Tony Lindgren
2018-02-23 22:24   ` Tony Lindgren
2018-03-02 20:57   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180327204111.GA2254@amd \
    --to=pavel@ucw.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.reichel@collabora.co.uk \
    --cc=tiwai@suse.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.