Re: [Alsa-user] documentation for error codes?

2020-06-11 Thread Clemens Ladisch via Alsa-user
D. R. Evans wrote:
> Many functions say about the return value:
>   0 on success otherwise a negative error code
>
> Where is the documentation for the various possible "negative error code"s?

 has a list
of error codes defined by ALSA itself.  But for all other errors, ALSA just
uses the (negative) POSIX error code.

> I am seeing a -32 under a specific set of circumstances

32 = EPIPE

> but don't know what that returned value means

PCM stream stopped due to overrun or underrun.


Regards,
Clemens


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] documentation for error codes?

2020-06-10 Thread D. R. Evans
Mark Hills wrote on 6/7/20 9:20 AM:
> On Fri, 5 Jun 2020, D. R. Evans wrote:
> 
>> Many functions say about the return value:
>>   0 on success otherwise a negative error code
>>
>> Where is the documentation for the various possible "negative error code"s? I
>> am seeing a -32 under a specific set of circumstances, but don't know what
>> that returned value means, or even what header value defines it.
> 
> Have you seen the snd_strerror() function?
> 

Yes, thank you; usable at a pinch, but not really what I was trying to find,
which was more like the kind of thing one usually sees in man pages (the
better man pages, anyway); (I'll refrain from commenting on the lack of man
pages for ALSA).

> For any errors you may want to choose to take specific action, these are 
> sometimes documented eg. snd_pcm_writei() has an explanation of the 
> expected errors returned. The ones you will commonly see are summarised 
> here ("Error codes"):
> 
>   https://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html

Yes, that's the kind of thing I was looking for. Thank you. It's a pity that
the individual functions don't tell you which ones they might return. And it
sounds like the list at that page isn't complete. But, as you suggest, it's a
start.

  Doc

-- 
Web:  http://enginehousebooks.com/drevans



signature.asc
Description: OpenPGP digital signature
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] documentation for error codes?

2020-06-07 Thread Mark Hills
On Fri, 5 Jun 2020, D. R. Evans wrote:

> Many functions say about the return value:
>   0 on success otherwise a negative error code
> 
> Where is the documentation for the various possible "negative error code"s? I
> am seeing a -32 under a specific set of circumstances, but don't know what
> that returned value means, or even what header value defines it.

Have you seen the snd_strerror() function?

For any errors you may want to choose to take specific action, these are 
sometimes documented eg. snd_pcm_writei() has an explanation of the 
expected errors returned. The ones you will commonly see are summarised 
here ("Error codes"):

  https://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html

I agree this could be a litle more thoroughly spec'd at a function level, 
which would also keep from implementing lots of unnecessary error paths. 
But hopefully this information is enough to move you forwards.

-- 
Mark


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user