public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"alsa-devel@vger.kernel.org" <alsa-devel@vger.kernel.org>
Subject: Re: [alsa-devel] Please help in adding ams-delta support to ASoC
Date: Tue, 09 Jun 2009 17:17:42 +0200	[thread overview]
Message-ID: <4A2E7D16.1010504@tis.icnet.pl> (raw)
In-Reply-To: <200906091012.41800.peter.ujfalusi@nokia.com>

Peter Ujfalusi wrote:
> I'm kind of bad at visualizing things, is it possible to put somewhere the 
> screenshoot of the scope showing at least one sample?

Good idea. I'll take some screenshots for future reference and let you 
know when available.

> I have been looking for clues around the net, and it seams that the codec in 
> question has stereo 16 bit format.

 From the very minimal mcbsp setup I get best audio experience with 
(using original omap-alsa based driver - see below), it looks like the 
codec speeks DSP (single phase), 16-bit mono @8kHz on output, but 8-bit 
stereo @8kHz on input. Capturing one channel only (the first one) I 
can't hear myself speaking, so audio from the microphone must be sent 
over the second input channel.

+static struct omap_mcbsp_reg_cfg mcbsp_regs = {
+       .spcr2 = FREE | XINTM(3) | XRST,
+       .spcr1 = RINTM(3) | RRST,
+       .rcr1 = RFRLEN1(2 - 1) | RWDLEN1(OMAP_MCBSP_WORD_8),
+       .xcr1 = XFRLEN1(1 - 1) | XWDLEN1(OMAP_MCBSP_WORD_16),
+};


+static snd_pcm_hardware_t vc_snd_omap_alsa_playback = {
+       .info = (SNDRV_PCM_INFO_INTERLEAVED | 
SNDRV_PCM_INFO_BLOCK_TRANSFER |
+                SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
+       .formats = (SNDRV_PCM_FMTBIT_S16_LE),
+       .rates = (SNDRV_PCM_RATE_8000 |
+                 SNDRV_PCM_RATE_KNOT),
+       .rate_min = 8000,
+       .rate_max = 8000,
+       .channels_min = 1,
+       .channels_max = 1,
+       .buffer_bytes_max = 128 * 1024,
+       .period_bytes_min = 32,
+       .period_bytes_max = 8 * 1024,
+       .periods_min = 16,
+       .periods_max = 255,
+       .fifo_size = 0,
+};
+
+static snd_pcm_hardware_t vc_snd_omap_alsa_capture = {
+       .info = (SNDRV_PCM_INFO_INTERLEAVED | 
SNDRV_PCM_INFO_BLOCK_TRANSFER |
+                SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
+       .formats = (SNDRV_PCM_FMTBIT_U8),
+       .rates = (SNDRV_PCM_RATE_8000 |
+                 SNDRV_PCM_RATE_KNOT),
+       .rate_min = 8000,
+       .rate_max = 8000,
+       .channels_min = 2,
+       .channels_max = 2,
+       .buffer_bytes_max = 128 * 1024,
+       .period_bytes_min = 32,
+       .period_bytes_max = 8 * 1024,
+       .periods_min = 16,
+       .periods_max = 255,
+       .fifo_size = 0,
+};

For other combinations of single/dual phase, sample size, mono/stereo, 
sound I get is much more distorted. Playing with polarisation and delays 
for getting still better experience remains on my todo list.

BTW, I can't see any way of specifying a similiar mcbsp setup in new 
omap asoc framework.

--------------
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -193,11 +193,15 @@ static int omap_pcm_trigger(struct snd_pcm_substream 
> *substream, int cmd)
>         case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
>                 prtd->period_index = 0;
>                 omap_start_dma(prtd->dma_ch);
> +               printk("omap_pcm_trigger START: DMA pointer at 0x%08x\n",
> +                       (unsigned)omap_get_dma_src_pos(prtd->dma_ch));
>                 break;
> 
>         case SNDRV_PCM_TRIGGER_STOP:
>         case SNDRV_PCM_TRIGGER_SUSPEND:
>         case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> +               printk("omap_pcm_trigger STOP: DMA pointer at 0x%08x\n",
> +                       (unsigned)omap_get_dma_src_pos(prtd->dma_ch));
>                 prtd->period_index = -1;
>                 omap_stop_dma(prtd->dma_ch);
>                 break;
> 
> 
> Than start a playback, and stop it with CTRL+C, see if the two pointers are 
> different...

Both playback and capture start with their own but always the same value 
(something like 0x1101a0d0 for playback, 0xe101a0d0 for capture), and 
always stop with this value unchanged.

> 2) I would I think try to port the 2.6.28 pure ALSA version to the head of l-
> o, with minimal (only the needed) changes and see if it is still working.

Trying to use the new driver on the last l-o revision supporting both 
omap-alsa and omap asoc, I got a broken system that hanged up completely 
at sound device first access. The same for earlier and later l-o 
revisions I have ever tried, unlike mainline that at least does not 
hang. From all that I would conclude that porting the old driver could 
be just waste of time, as the problem is probably omap asoc related, not 
just omap, probably existed from the start of omap asoc life, and could 
be solved on any l-o or mainline revision, including those eariler l-o 
that supported both frameworks. But I can be wrong, of course.

Cheers,
Janusz

  reply	other threads:[~2009-06-09 15:17 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 13:17 Please help in adding ams-delta support to ASoC Janusz Krzysztofik
2009-05-27  5:57 ` Peter Ujfalusi
2009-05-27 13:07   ` Janusz Krzysztofik
2009-06-02  5:47     ` Peter Ujfalusi
2009-06-02 11:38       ` Janusz Krzysztofik
2009-05-27  6:59 ` Jarkko Nikula
2009-05-27 14:33   ` Janusz Krzysztofik
2009-05-27 15:19     ` Jarkko Nikula
2009-05-27 18:58   ` Janusz Krzysztofik
2009-06-01 12:41     ` Janusz Krzysztofik
2009-06-01 18:04       ` Jarkko Nikula
2009-06-02  6:08         ` Peter Ujfalusi
2009-06-02  6:22         ` Jarkko Nikula
2009-06-02 13:35           ` Janusz Krzysztofik
2009-06-02 17:32             ` Jarkko Nikula
2009-06-03  7:24               ` Janusz Krzysztofik
2009-06-05 13:55                 ` Jarkko Nikula
2009-06-05 22:28                   ` Janusz Krzysztofik
2009-06-05 22:45                     ` [alsa-devel] " Mark Brown
2009-06-06 17:42                       ` Janusz Krzysztofik
2009-06-07  9:40                         ` Mark Brown
2009-06-09  7:12                         ` Peter Ujfalusi
2009-06-09 15:17                           ` Janusz Krzysztofik [this message]
2009-06-10  8:12                             ` Peter Ujfalusi
2009-06-10 10:27                               ` [alsa-devel] " Janusz Krzysztofik
2009-06-10 10:53                                 ` Peter Ujfalusi
2009-06-10 12:20                                   ` Janusz Krzysztofik
2009-06-10 18:05                                   ` Janusz Krzysztofik
2009-06-10 14:20                             ` Janusz Krzysztofik
2009-06-08  6:40                     ` Jarkko Nikula
2009-06-09 15:00                       ` Janusz Krzysztofik
2009-06-15 13:22                         ` Janusz Krzysztofik
2009-06-15 15:16                           ` Jarkko Nikula
2009-06-16 14:43                             ` Janusz Krzysztofik
2009-06-17 14:12                               ` Progress in adding ams-delta support to ASoC? Janusz Krzysztofik
2009-06-18  9:02                                 ` Peter Ujfalusi
2009-06-18  7:58                                   ` Tony Lindgren
2009-06-18 11:51                                     ` Janusz Krzysztofik
2009-06-18 10:21                                       ` Tony Lindgren
2009-06-18  6:07                               ` Please help in adding ams-delta support to ASoC Jarkko Nikula
2009-06-18 11:40                                 ` Janusz Krzysztofik
2009-06-19  3:50                                   ` Arun K S
2009-06-19 11:20                                     ` Janusz Krzysztofik
2009-06-19 18:55                                       ` Arun K S
2009-06-22 11:47                                   ` Jarkko Nikula
2009-06-23 11:58                                     ` Janusz Krzysztofik
2009-06-02 10:50         ` *SPAM* " Janusz Krzysztofik
2009-06-03  5:28           ` Peter Ujfalusi
2009-06-03  8:28             ` Janusz Krzysztofik
     [not found] ` <20090527104711.GA1970@sirena.org.uk>
2009-06-02  7:24   ` Janusz Krzysztofik
2009-06-02  9:37     ` Mark Brown

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=4A2E7D16.1010504@tis.icnet.pl \
    --to=jkrzyszt@tis.icnet.pl \
    --cc=alsa-devel@alsa-project.org \
    --cc=alsa-devel@vger.kernel.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@nokia.com \
    --cc=postmaster@icnet.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox