From alsa-devel-owner@alsa.jcu.cz  Wed Nov 11 07:52:02 1998
Received: from noc.cinternet.net (soren@mail.cinternet.net [206.112.217.12])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id HAA06391
	for <alsa-devel@jcu.cz>; Wed, 11 Nov 1998 07:51:53 +0100
Received: from localhost (soren@localhost) by noc.cinternet.net (8.8.7/8.7.3) with SMTP id BAA05593 for <alsa-devel@jcu.cz>; Wed, 11 Nov 1998 01:51:52 -0500
Date: Wed, 11 Nov 1998 01:51:52 -0500 (EST)
From: Soren Harward <soren@cinternet.net>
To: alsa-devel@jcu.cz
Subject: Re: having trouble getting the hang of alsalib
In-Reply-To: <364925B4.BBB2DE63@alphalink.com.au>
Message-ID: <Pine.LNX.3.96.981111014056.5437A-100000@noc.cinternet.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Wed, 11 Nov 1998, Andrew Clausen wrote:

)Soren Harward wrote:
)> I've tried some work with basic soundcard control with alsalib, and have
)> gotten it to work fairly well expect that no matter what I do, the program
)> segfaults and dumps core at the end.  Even something this simple:
)>
)> main() {
)>   void *handle;
)>   int value;
)>
)>   value = snd_ctl_open( &handle, 0 );
)>   printf("%i\n",value);
)>
)>   value = snd_ctl_close( handle );
)>   printf("%i\n",value);
)>
)>   return 0;
)> }
)
)ALSA does give nice error messages.  Try:
)
)if (value != 0)
)    printf ("%s\n", snd_strerror (value));

WTF?!?!?!  It works now, without any change to the code (though that
error checking is a *nice* feature).  Go figure....

)Error -22 means "Invalid argument".  This probably means that handle hasn't
)been initialised properly by snd_ctl_open.  What does it return?

Card 0 does exist.  snd_ctl_open(&handle, 0) returns 0.

)Where does it dump the core?

In the current directory.

)You're into sound & gnome, aren't you?  Feel like coming to the atech list?
)(It's low volume...)

actually, that's what I'm gearing up for.  I want to get a little more
practice with C by hacking this ALSA support for replay, and then go full
into helping you guys with atech--I've got a bunch of cool ideas for the
project.  I'd love to have a replacement for CoolEdit by the time I take
my linux box to college next year.


--
 Soren Harward <soren@cinternet.net> | Windows DOES come with a tool
 http://www.cinternet.net/~soren/    | to restore a corrupt Registry.
 Internet Information Systems Admin  |
 Cinternet, Inc.  (513) 891-1228     | It's called FDISK.




