TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: R.WIESER
date: 2020-01-03 17:59:00
subject: Re: ALSA sound cut short

Folderol,

> Does it return the same number of channels as you want to send?

Yes, two.

> so if your sample is longer than 1/2 buffer you'll lose the rest

Thats not what the code I linked to (in my initial message) seems to
indicate.

And as far as I know "snd_pcm_writei( )" function will block until all
frames are written (which some other, later found code (link also posted)
seems to confirm)..

Besides, even if the code in the first link I've provided causes half of the
frames to be dropped I should get two-and-a-half seconds worth (instead of
five), not just shy of a single one.   Apart from me assuming that the
"snd_pcm_writei( )" will than either return a different number of accepted
frames than what gets provided, or throw an error - both of which are
catched and displayed.

Next to that, I /do/ get the full five seconds worth of writes (even though
I write as many frames as returned by the
"snd_pcm_hw_params_set_period_size_near( )" call) - as long as I preceede
"snd_pcm_drain( )" with a few seconds of "usleep( )".

That is part of the problem: I can not make head-or-tails of how/when the
cut-off happens.   And no errors of any kind.

Regards,
Rudy Wieser

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.