Commit Graph

7 Commits

Author SHA1 Message Date
Vadim Yanitskiy d5cfaa6a52 pq_alsa.c: print error message if device init fails 2017-09-02 17:03:06 +02:00
Vadim Yanitskiy 83aa99e7a9 pq_alsa.c: handle output buffer underrun
On some systems the ALSA output buffer is pretty big, and
if the audio samples are not being passed into the buffer
quickly enough, it becomes starved for data, resulting
in an error called underrun.

Previously, when it happenned, GAPK used to stop processing
with the following message (where X is a random number):

[+] PQ: Adding ALSA output (dev='default', blk_len=320)
[!] pq_execute(): abort, item returned -1
[+] Processed X frames

According to the ALSA documentation, the pcm_handle
changes its state when the problem happens, and should
be recovered using the snd_pcm_prepare() call. This change
actually does that.
2017-09-02 17:02:37 +02:00
Harald Welte ac3517e715 alsa/file input: return -1 on eof (short read)
This will permit for a more graceful error than the next element in the
processing chain complaining that there's a 0-length input.
2017-05-28 20:06:01 +02:00
Harald Welte 0c655bce25 direct all log statements to stderr to avoid breaking stdout data out
The tool has the capability to be used in a pipe, so stdout should
recevie nothing else but actual codec/pcm data.
2017-05-28 19:44:26 +02:00
Harald Welte bd42eba35d Print some useful information while putting together the procqueue 2017-05-28 14:30:05 +02:00
Harald Welte 5912848d2e prepare gapk for dealing with variable-length frames
The existing architecture was modelled around fixed-length codec frame
sizes, which of course fails with multi-rate codecs such as AMR.
2017-05-28 10:44:06 +02:00
Harald Welte 2ae47af0be Add ALSA input/output support to GAPK
The ALSA source/sink uses the pcm-s16le format.
2017-05-28 01:56:33 +02:00