* [PATCH 1/2] plugin:dshare: wrong state reporting
@ 2017-04-04 6:29 sutar.mounesh
2017-04-05 19:40 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: sutar.mounesh @ 2017-04-04 6:29 UTC (permalink / raw)
To: patch; +Cc: Mounesh Sutar, alsa-devel, Andreas Pape, mounesh_sutar
From: Andreas Pape <apape@de.adit-jv.com>
If plugin dshare detects underrun, it reports this to the user
via return value -EPIPE and setting dshare state to 'xrun' which is correct.
But, if user after this wants to check the stream state, it is misleadingly
reported as 'running' instead of 'xrun'.
With this behavior aplay e.g. will not do a proper underrun handling
(restarting stream) but terminates streaming.
This is due to plugin dshare always returns state of the slave pcm,
in pcm_ops->state() which is not correct.
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 331f799..4c57fb4 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -244,7 +244,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
default:
break;
}
-
+ status->state = snd_pcm_state(pcm);
status->trigger_tstamp = dshare->trigger_tstamp;
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] plugin:dshare: wrong state reporting
2017-04-04 6:29 [PATCH 1/2] plugin:dshare: wrong state reporting sutar.mounesh
@ 2017-04-05 19:40 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-04-05 19:40 UTC (permalink / raw)
To: sutar.mounesh; +Cc: alsa-devel, Andreas Pape, mounesh_sutar
On Tue, 04 Apr 2017 08:29:52 +0200,
sutar.mounesh@gmail.com wrote:
>
> From: Andreas Pape <apape@de.adit-jv.com>
>
> If plugin dshare detects underrun, it reports this to the user
> via return value -EPIPE and setting dshare state to 'xrun' which is correct.
> But, if user after this wants to check the stream state, it is misleadingly
> reported as 'running' instead of 'xrun'.
> With this behavior aplay e.g. will not do a proper underrun handling
> (restarting stream) but terminates streaming.
> This is due to plugin dshare always returns state of the slave pcm,
> in pcm_ops->state() which is not correct.
>
> Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
> Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
Applied now. Thanks.
Takashi
>
> diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
> index 331f799..4c57fb4 100644
> --- a/src/pcm/pcm_dshare.c
> +++ b/src/pcm/pcm_dshare.c
> @@ -244,7 +244,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
> default:
> break;
> }
> -
> + status->state = snd_pcm_state(pcm);
> status->trigger_tstamp = dshare->trigger_tstamp;
> status->avail = snd_pcm_mmap_playback_avail(pcm);
> status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-05 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04 6:29 [PATCH 1/2] plugin:dshare: wrong state reporting sutar.mounesh
2017-04-05 19:40 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).