Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] pcm_file report EIO when fail to write to debug file
@ 2019-07-01 13:25 Adam Miartus
  2019-07-01 13:25 ` [PATCH 1/3] pcm_file: use EIO instead of EPIPE when failing to write output file Adam Miartus
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Adam Miartus @ 2019-07-01 13:25 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel

Previously, I introduced a patch that may return EPIPE error when pcm_file
plugin fails to write to output file for some reason.

The purpose of reporting the error was to evade assert in code to allow
API user error handling and recovery, or more clarity in debugging.

Failing to write to a file usually means bad file descriptor, running
out of free memory, insufficient file permissions or in case file
is a pipe there may be other reasons preventing the write operation.
All these are not easily recoverable by restaring playback as EPIPE
error which is used to signal XRUN might suggest. Therefore, use EIO
to signal a different kind of error.

write_wav_header function is refactored a bit for more detailed
error handling in case of failed write operation.

Adam Miartus (3):
  pcm_file: use EIO instead of EPIPE when failing to write output file
  pcm_file: improve error checking in write_wav_header function
  pcm_file: in case of failed write clear file buffer variables

 src/pcm/pcm_file.c | 54 +++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 41 insertions(+), 13 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-03 12:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-01 13:25 [PATCH 0/3] pcm_file report EIO when fail to write to debug file Adam Miartus
2019-07-01 13:25 ` [PATCH 1/3] pcm_file: use EIO instead of EPIPE when failing to write output file Adam Miartus
2019-07-03 12:23   ` Takashi Iwai
2019-07-01 13:25 ` [PATCH 2/3] pcm_file: improve error checking in write_wav_header function Adam Miartus
2019-07-03 12:21   ` Takashi Iwai
2019-07-01 13:25 ` [PATCH 3/3] pcm_file: in case of failed write clear file buffer variables Adam Miartus
2019-07-03 12:23   ` Takashi Iwai
2019-07-03 12:23 ` [PATCH 0/3] pcm_file report EIO when fail to write to debug file Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox