Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330909 - dev-tcltk/snack audio stops on ALSA underflow
Summary: dev-tcltk/snack audio stops on ALSA underflow
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-02 20:52 UTC by Wade Hampton
Modified: 2010-08-26 19:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wade Hampton 2010-08-02 20:52:43 UTC
The unix/jkAudioIO_alsa.c code does not check results of 
calls to snd_pcm_writei().  In SnackAudioWrite() if the ALSA 
driver underflows audio will be stopped but the application 
will still think that audio is playing and the nWritten counter 
will be incorrectly updated.

Recommend:
  n = snd_pcm_writei(...)
  if (n < 0) {
    /* optional write Snack_WriteLogInt("....") */
    snd_pcm_recover(A->handle, n, 1);
    n = 0;
  } else {
    A->nWritten += n;
  }
  return(n);
}

Note there is another snd_pcm_writei() function call
where the result is not checked....
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-08-03 03:18:54 UTC
Please post the output of `emerge --info dev-tcltk/snack' too.
Comment 2 Wade Hampton 2010-08-26 19:47:31 UTC
Thanks, but I'm currently not running gentoo so I don't have emerge.  I posted to the gentoo list as you seem to be the only ones supporting this package.

Inspect unix/jkAudioIO_alsa.c and look at the points where snd_pcm_writei() is called.  The return value is not checked. Check the functionality of snd_pcm_writei() and view the notes in:
  http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html