From: khalasa@piap.pl (Krzysztof Hałasa)
To: linux-media <linux-media@vger.kernel.org>
Subject: [PATCH] SOLO6x10: Fix G.723 minimum audio period count.
Date: Mon, 08 Jun 2015 15:35:05 +0200 [thread overview]
Message-ID: <m33822xr06.fsf@t19.piap.pl> (raw)
In-Reply-To: <m3a8waxr86.fsf@t19.piap.pl> ("Krzysztof \=\?utf-8\?Q\?Ha\=C5\=82as\?\= \=\?utf-8\?Q\?a\=22's\?\= message of "Mon, 08 Jun 2015 15:30:17 +0200")
The period count is fixed, don't confuse ALSA.
Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -48,10 +48,8 @@
/* The solo writes to 1k byte pages, 32 pages, in the dma. Each 1k page
* is broken down to 20 * 48 byte regions (one for each channel possible)
* with the rest of the page being dummy data. */
-#define G723_MAX_BUFFER (G723_PERIOD_BYTES * PERIODS_MAX)
+#define PERIODS G723_FDMA_PAGES
#define G723_INTR_ORDER 4 /* 0 - 4 */
-#define PERIODS_MIN (1 << G723_INTR_ORDER)
-#define PERIODS_MAX G723_FDMA_PAGES
struct solo_snd_pcm {
int on;
@@ -130,11 +128,11 @@ static const struct snd_pcm_hardware snd_solo_pcm_hw = {
.rate_max = SAMPLERATE,
.channels_min = 1,
.channels_max = 1,
- .buffer_bytes_max = G723_MAX_BUFFER,
+ .buffer_bytes_max = G723_PERIOD_BYTES * PERIODS,
.period_bytes_min = G723_PERIOD_BYTES,
.period_bytes_max = G723_PERIOD_BYTES,
- .periods_min = PERIODS_MIN,
- .periods_max = PERIODS_MAX,
+ .periods_min = PERIODS,
+ .periods_max = PERIODS,
};
static int snd_solo_pcm_open(struct snd_pcm_substream *ss)
@@ -340,7 +338,8 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
SNDRV_DMA_TYPE_CONTINUOUS,
snd_dma_continuous_data(GFP_KERNEL),
- G723_MAX_BUFFER, G723_MAX_BUFFER);
+ G723_PERIOD_BYTES * PERIODS,
+ G723_PERIOD_BYTES * PERIODS);
if (ret < 0)
return ret;
next prev parent reply other threads:[~2015-06-08 13:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 13:30 A few SOLO6x10 patches Krzysztof Hałasa
2015-06-08 13:35 ` Krzysztof Hałasa [this message]
2015-06-14 21:51 ` [PATCH] SOLO6x10: Fix G.723 minimum audio period count Ismael Luceno
2015-06-08 13:37 ` [PATCH] SOLO6x10: unmap registers only after free_irq() Krzysztof Hałasa
2015-06-14 21:52 ` Ismael Luceno
2015-06-08 13:42 ` [PATCH] SOLO6x10: remove unneeded register locking and barriers Krzysztof Hałasa
2015-06-14 21:53 ` Ismael Luceno
2015-06-08 13:50 ` [PATCH] SOLO6x10: Remove dead code Krzysztof Hałasa
2015-06-14 21:53 ` Ismael Luceno
2015-06-14 21:50 ` A few SOLO6x10 patches Ismael Luceno
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=m33822xr06.fsf@t19.piap.pl \
--to=khalasa@piap.pl \
--cc=linux-media@vger.kernel.org \
/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