This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi all,
I am using tinycap to capture signals from 4 digital mics present in OMAP4460 Blaze tablet .
My tinycap settings are as follows.
tinycap /sdcard/test.pcm -D 0 -d 0 -c 4 -r 48000 -b 32 -p 768 -n 10
The data do get captured on four digital microphones but i see many audio losses in the captured signal.
1) What is the reason for the audio losses.
2) What si the maximum data size that can be allocated to store the captured data ( i.e. period_size * number_of_buffers * sizeof( WORD32) ).
3} how can i stop the Audio loss
Hello Sreenivasa,
Data from digital microphones can be captured in two ways:
- Directly from the OMAP's DMIC peripheral. Data is recorded at the native params (96 or 192kHz, 32-bits, 4-ch)
- Through the ABE's MM_UL. Data is recorded at the ABE frontend's parameters (e.g. 48kHz, 16-bits, 4-ch)
Which ways do you use in your case?
I believe you are using the ABE's MM_UL frontend as per the tinymix settings.
When you say audio loss, do you mean ALSA overruns? The buffer size of 8000 frames is equivalent to 166ms (assuming recording is at 48kHz). That's a large buffer in my opinion, and shouldn't cause ALSA overruns. Take into account that the larger the buffer the more the latency.
What userspace component is reading the dmic data? The AudioHAL? Have you tried recording using tinycap?
ALSA overruns depend a lot on the pace at which the userspace reads the data from the ALSA buffer. You might want to measure the time taken between the end of a pcm_read() and the start of the next.
Best regards,
Yanko
Hello Sreenivasa,
Yes, there is a limit on the ALSA buffer size. See in /kernel/android-3.4/sound/soc/omap/ omap-pcm.c
static const struct snd_pcm_hardware omap_pcm_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
.formats = SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE,
.period_bytes_min = 32,
.period_bytes_max = 64 * 1024,
.periods_min = 2,
.periods_max = 255,
.buffer_bytes_max = 128 * 1024,
};
The maximum buffer size is 128kB. Assuming 4-ch, 32-bits/sample, the max buffer size you can have is 8192 frames.
Support for 16-bits recording on the MM_UL port was dropped. This was an ABE firmware change. The parameters supported by the MM_UL frontend are in sound/soc/omap/omap-abe-pcm.c (see line in yellow). So you can only record at 32-bits/sample.
struct snd_soc_dai_driver omap_abe_dai[] = {
{ /* Multimedia Playback and Capture */
.name = "MultiMedia1",
.probe = omap_abe_dai_probe,
.remove = omap_abe_dai_remove,
.suspend = omap_abe_dai_suspend,
.resume = omap_abe_dai_resume,
.playback = {
.stream_name = "MM1 Playback",
.channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.formats = OMAP_ABE_FORMATS,
},
.capture = {
.stream_name = "MM1 Capture",
.channels_min = 1,
.channels_max = 6,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S32_LE,
},
.ops = &omap_abe_dai_ops,
},
For more information see following patches:
git.omapzoom.org;a=blob;f=sound/soc/omap/omap-pcm.c;h=5a649da9122a3e798713999a766885f0f732a5cd;hb=31b9c766ecb29bbef4b835892ee267ee9aabd21b#l36
Best regards,
Yanko