All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsactl fixes
@ 2003-06-20  7:09 Clemens Ladisch
  2003-06-20 18:13 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Clemens Ladisch @ 2003-06-20  7:09 UTC (permalink / raw)
  To: alsa-devel


When a card doesn't have any controls, the state.cardid.control node
isn't written to the output file because the node's join flag has been
set. This patch modifies alsactl not to set the join flag in this case
to prevent the "no state is present for card" message from "alsactl
restore".

And the check in line 510 used the wrong variable.



Index: alsa-utils/alsactl/alsactl.c
===================================================================
RCS file: /cvsroot/alsa/alsa-utils/alsactl/alsactl.c,v
retrieving revision 1.52
diff -u -r1.52 alsactl.c
--- alsa-utils/alsactl/alsactl.c	1 Apr 2003 15:51:16 -0000	1.52
+++ alsa-utils/alsactl/alsactl.c	20 Jun 2003 07:00:26 -0000
@@ -507,7 +507,7 @@
 	}
 	err = snd_config_search(state, id, &card);
 	if (err == 0 &&
-	    snd_config_get_type(state) != SND_CONFIG_TYPE_COMPOUND) {
+	    snd_config_get_type(card) != SND_CONFIG_TYPE_COMPOUND) {
 		error("config state.%s node is not a compound", id);
 		err = -EINVAL;
 		goto _close;
@@ -527,18 +527,22 @@
 			goto _close;
 		}
 	}
-	err = snd_config_compound_add(card, "control", 1, &control);
-	if (err < 0) {
-		error("snd_config_compound_add: %s", snd_strerror(err));
-		goto _close;
-	}
 	err = snd_ctl_elem_list(handle, list);
 	if (err < 0) {
 		error("Cannot determine controls: %s", snd_strerror(err));
 		goto _close;
 	}
 	count = snd_ctl_elem_list_get_count(list);
-	if (count <= 0) {
+	if (count < 0) {
+		err = 0;
+		goto _close;
+	}
+	err = snd_config_compound_add(card, "control", count > 0, &control);
+	if (err < 0) {
+		error("snd_config_compound_add: %s", snd_strerror(err));
+		goto _close;
+	}
+	if (count == 0) {
 		err = 0;
 		goto _close;
 	}




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] alsactl fixes
  2003-06-20  7:09 [PATCH] alsactl fixes Clemens Ladisch
@ 2003-06-20 18:13 ` Takashi Iwai
  2003-06-24 23:57   ` Jeremy Hall
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2003-06-20 18:13 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

At Fri, 20 Jun 2003 09:09:43 +0200 (METDST),
Clemens Ladisch wrote:
> 
> 
> When a card doesn't have any controls, the state.cardid.control node
> isn't written to the output file because the node's join flag has been
> set. This patch modifies alsactl not to set the join flag in this case
> to prevent the "no state is present for card" message from "alsactl
> restore".
> 
> And the check in line 510 used the wrong variable.

applied to cvs.


thanks,

Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] alsactl fixes
  2003-06-20 18:13 ` Takashi Iwai
@ 2003-06-24 23:57   ` Jeremy Hall
  2003-06-25 11:05     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Hall @ 2003-06-24 23:57 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Clemens Ladisch, alsa-devel

anoncvs has not picked up changes.

I am seeing a core dump when I try to run alsactl store and don't know 
why.  gdb isn't helping me on this machine.

_J

In the new year, Takashi Iwai wrote:
> At Fri, 20 Jun 2003 09:09:43 +0200 (METDST),
> Clemens Ladisch wrote:
> > 
> > 
> > When a card doesn't have any controls, the state.cardid.control node
> > isn't written to the output file because the node's join flag has been
> > set. This patch modifies alsactl not to set the join flag in this case
> > to prevent the "no state is present for card" message from "alsactl
> > restore".
> > 
> > And the check in line 510 used the wrong variable.
> 
> applied to cvs.
> 
> 
> thanks,
> 
> Takashi
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: INetU
> Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] alsactl fixes
  2003-06-24 23:57   ` Jeremy Hall
@ 2003-06-25 11:05     ` Takashi Iwai
  2003-06-25 12:22       ` Paul Davis
  2003-06-25 16:54       ` Jeremy Hall
  0 siblings, 2 replies; 6+ messages in thread
From: Takashi Iwai @ 2003-06-25 11:05 UTC (permalink / raw)
  To: Jeremy Hall; +Cc: Clemens Ladisch, alsa-devel

At Tue, 24 Jun 2003 19:57:49 -0400 (EDT),
Jeremy Hall wrote:
> 
> anoncvs has not picked up changes.
 
i just compared the file with the repository and it looks ok for me.
perhaps it wasn't notified correctly.
could you check it again?

> I am seeing a core dump when I try to run alsactl store and don't know 
> why.  gdb isn't helping me on this machine.

grrr, works for me.  which soundcard are you using?
does it happen even if you remove (or rename) the existing
/etc/asound.state?

btw, you don't have to run alsactl as root.  you can specify the file
to store via -f option if you run alsactl store as the normal user.

well, in the worst case, printf() is your friend ;)


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] alsactl fixes
  2003-06-25 11:05     ` Takashi Iwai
@ 2003-06-25 12:22       ` Paul Davis
  2003-06-25 16:54       ` Jeremy Hall
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Davis @ 2003-06-25 12:22 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jeremy Hall, Clemens Ladisch, alsa-devel

>> anoncvs has not picked up changes.
> 
>i just compared the file with the repository and it looks ok for me.

are you forgetting the 24+hr delay imposed by sf.net for anoncvs?


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] alsactl fixes
  2003-06-25 11:05     ` Takashi Iwai
  2003-06-25 12:22       ` Paul Davis
@ 2003-06-25 16:54       ` Jeremy Hall
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremy Hall @ 2003-06-25 16:54 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jeremy Hall, Clemens Ladisch, alsa-devel

it's in the lib somewhere

I saw it both with es1938 and intel8x0 (I don't have es1938 anymore) and 
yes I removed both my /etc/asound.state and .asoundrc

_J

In the new year, Takashi Iwai wrote:
> At Tue, 24 Jun 2003 19:57:49 -0400 (EDT),
> Jeremy Hall wrote:
> > 
> > anoncvs has not picked up changes.
>  
> i just compared the file with the repository and it looks ok for me.
> perhaps it wasn't notified correctly.
> could you check it again?
> 
> > I am seeing a core dump when I try to run alsactl store and don't know 
> > why.  gdb isn't helping me on this machine.
> 
> grrr, works for me.  which soundcard are you using?
> does it happen even if you remove (or rename) the existing
> /etc/asound.state?
> 
> btw, you don't have to run alsactl as root.  you can specify the file
> to store via -f option if you run alsactl store as the normal user.
> 
> well, in the worst case, printf() is your friend ;)
> 
> 
> Takashi
> 



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

end of thread, other threads:[~2003-06-25 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-20  7:09 [PATCH] alsactl fixes Clemens Ladisch
2003-06-20 18:13 ` Takashi Iwai
2003-06-24 23:57   ` Jeremy Hall
2003-06-25 11:05     ` Takashi Iwai
2003-06-25 12:22       ` Paul Davis
2003-06-25 16:54       ` Jeremy Hall

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.