alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count
@ 2013-02-10  0:23 Richard Fitzgerald
  2013-02-11  8:53 ` Vinod Koul
  2013-02-22 16:11 ` [PATCH TINYCOMPRESS 14/14 v2] " Richard Fitzgerald
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Fitzgerald @ 2013-02-10  0:23 UTC (permalink / raw)
  To: vinod.koul; +Cc: alsa-devel

Default the fragment size and count to zero to take advantage
of the auto-configuration support that was added to tinycompress.
If user doesn't override these by specifying -f and -b values
on the command line, they will be passed to tinycompress as zero
and tinycompress will query the driver for size and count.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

diff --git a/cplay.c b/cplay.c
index 3af6d13..60995a4 100644
--- a/cplay.c
+++ b/cplay.c
@@ -152,9 +152,9 @@ static int print_time(struct compress *compress)
 int main(int argc, char **argv)
 {
 	char *file;
-	unsigned long buffer_size = 100*1024;
+	unsigned long buffer_size = 0;
 	int c;
-	unsigned int card = 0, device = 0, frag = 4;
+	unsigned int card = 0, device = 0, frag = 0;
 
 
 	if (argc < 2)
@@ -276,8 +276,14 @@ void play_samples(char *name, unsigned int card, unsigned int device,
 	codec.level = 0;
 	codec.ch_mode = 0;
 	codec.format = 0;
-	config.fragment_size = buffer_size/frag;
-	config.fragments = frag;
+	if ((buffer_size != 0) && (frag != 0)) {
+		config.fragment_size = buffer_size/frag;
+		config.fragments = frag;
+	} else {
+		/* use driver defaults */
+		config.fragment_size = 0;
+		config.fragments = 0;
+	}
 	config.codec = &codec;
 
 	compress = compress_open(card, device, COMPRESS_IN, &config);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count
  2013-02-10  0:23 [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count Richard Fitzgerald
@ 2013-02-11  8:53 ` Vinod Koul
  2013-02-11  9:58   ` Richard Fitzgerald
  2013-02-11 10:10   ` Richard Fitzgerald
  2013-02-22 16:11 ` [PATCH TINYCOMPRESS 14/14 v2] " Richard Fitzgerald
  1 sibling, 2 replies; 6+ messages in thread
From: Vinod Koul @ 2013-02-11  8:53 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: alsa-devel

On Sun, Feb 10, 2013 at 12:23:40AM +0000, Richard Fitzgerald wrote:

I tried applying rest, but looks like patches you have generated against is
older one. Can you rebase all your patches on the tip and resend for those I
didnt comment first.

Also would nice to use cover letter while sending a series, --cover-letter
option is your friend

--
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count
  2013-02-11  8:53 ` Vinod Koul
@ 2013-02-11  9:58   ` Richard Fitzgerald
  2013-02-11 10:43     ` Vinod Koul
  2013-02-11 10:10   ` Richard Fitzgerald
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Fitzgerald @ 2013-02-11  9:58 UTC (permalink / raw)
  To: Vinod Koul; +Cc: alsa-devel

> looks like patches you have generated against is
> older one.

Yes this is true, which is how it should be.
These patches and the ones from Charles Keepax
are a single development line, and Charles's patches
were based on top of this sequence.
What's happened is that the patches from Charles
have been upstreamed and applied out-of-order.
These 14 should be applied, and then the set from
Charles.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count
  2013-02-11  8:53 ` Vinod Koul
  2013-02-11  9:58   ` Richard Fitzgerald
@ 2013-02-11 10:10   ` Richard Fitzgerald
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Fitzgerald @ 2013-02-11 10:10 UTC (permalink / raw)
  To: Vinod Koul; +Cc: alsa-devel

>looks like patches you have generated against is
>older one.

This is the git log of our development repository:

cplay: support auto-configuration of fragment size and count <Richard Fitzgerald>
compress: Prevent divide-by-zero faults in get_hpointer() <Richard Fitzgerald>
compress: Do not put newlines on error messages <Charles Keepax>
compress: Return error messages correctly from compress_open <Charles Keepax>
compress: Return error when failing to allocate compress struct <Charles Keepax>
compress: Extend limit on error messages <Charles Keepax>
Add makefile for building under standard linux <Richard Fitzgerald>
Add missing header includes <Richard Fitzgerald>
Block if unable to write all data in single write() <Richard Fitzgerald>
Allow client to pass "don't care" for fragment size/number <Richard Fitzgerald>
Handle case of pause() during compress_write() <Richard Fitzgerald>
Remove hardcoded limit on length of poll() wait <Richard Fitzgerald>
Fix incorrect error message on compress_resume() <Richard Fitzgerald>
Take local copy of compr_config structure <Richard Fitzgerald>
Change running from bitfield to plain int <Richard Fitzgerald>
Remove unused buffer_size member from struct compress <Richard Fitzgerald>
Change compress_write() to take buffer as const void * <Richard Fitzgerald>
Add function to get timestamp in samples <Richard Fitzgerald>
compress: add compress_resume <Namarta Kohli>
compress: write when we have a fragment to write <Vinod Koul>
compress: fix the timestamp calculation <Vinod Koul>
initial creation <Vinod Koul>
Initial test commit... <Jaroslav Kysela>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count
  2013-02-11  9:58   ` Richard Fitzgerald
@ 2013-02-11 10:43     ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2013-02-11 10:43 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: alsa-devel

On Mon, Feb 11, 2013 at 09:58:45AM +0000, Richard Fitzgerald wrote:
> > looks like patches you have generated against is
> > older one.
> 
> Yes this is true, which is how it should be.
> These patches and the ones from Charles Keepax
> are a single development line, and Charles's patches
> were based on top of this sequence.
> What's happened is that the patches from Charles
> have been upstreamed and applied out-of-order.
> These 14 should be applied, and then the set from
> Charles.

That is not how it works. Since Charles sent his patches first I applied those.
Now these will _need_ to based on tip of the tree you are targetting not on some
older rev.

If you have internal dependecies you should have internally sorted that out!

Now pls rebase these

--
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH TINYCOMPRESS 14/14 v2] cplay: support auto-configuration of fragment size and count
  2013-02-10  0:23 [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count Richard Fitzgerald
  2013-02-11  8:53 ` Vinod Koul
@ 2013-02-22 16:11 ` Richard Fitzgerald
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Fitzgerald @ 2013-02-22 16:11 UTC (permalink / raw)
  To: vinod.koul; +Cc: alsa-devel

Default the fragment size and count to zero to take advantage
of the auto-configuration support that was added to tinycompress.
If user doesn't override these by specifying -f and -b values
on the command line, they will be passed to tinycompress as zero
and tinycompress will query the driver for size and count.

---
 cplay.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/cplay.c b/cplay.c
index 3af6d13..60995a4 100644
--- a/cplay.c
+++ b/cplay.c
@@ -152,9 +152,9 @@ static int print_time(struct compress *compress)
 int main(int argc, char **argv)
 {
 	char *file;
-	unsigned long buffer_size = 100*1024;
+	unsigned long buffer_size = 0;
 	int c;
-	unsigned int card = 0, device = 0, frag = 4;
+	unsigned int card = 0, device = 0, frag = 0;
 
 
 	if (argc < 2)
@@ -276,8 +276,14 @@ void play_samples(char *name, unsigned int card, unsigned int device,
 	codec.level = 0;
 	codec.ch_mode = 0;
 	codec.format = 0;
-	config.fragment_size = buffer_size/frag;
-	config.fragments = frag;
+	if ((buffer_size != 0) && (frag != 0)) {
+		config.fragment_size = buffer_size/frag;
+		config.fragments = frag;
+	} else {
+		/* use driver defaults */
+		config.fragment_size = 0;
+		config.fragments = 0;
+	}
 	config.codec = &codec;
 
 	compress = compress_open(card, device, COMPRESS_IN, &config);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-22 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-10  0:23 [PATCH TINYCOMPRESS 14/14] cplay: support auto-configuration of fragment size and count Richard Fitzgerald
2013-02-11  8:53 ` Vinod Koul
2013-02-11  9:58   ` Richard Fitzgerald
2013-02-11 10:43     ` Vinod Koul
2013-02-11 10:10   ` Richard Fitzgerald
2013-02-22 16:11 ` [PATCH TINYCOMPRESS 14/14 v2] " Richard Fitzgerald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).