alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* snd_mixer handle in two threads
@ 2010-06-09 13:05 Sebastian H.
  2010-06-09 16:59 ` Sebastian H.
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian H. @ 2010-06-09 13:05 UTC (permalink / raw)
  To: alsa-devel

Hello again

This is still about the alsamixer-qt4 application I working on.

This time I wonder if a snd_mixer_t handle created with
snd_mixer_open ( ... ) can be used in two threads concurrently.

One thread should be the main Qt4 GUI thread and the second thread
should only poll ( ... ) blocking for ALSA events on the shared
snd_mixer_t handle in accompany with

  snd_mixer_poll_descriptors_count ( ... )
  snd_mixer_poll_descriptors ( ... )
  snd_mixer_poll_descriptors_revents ( ... )

The second thread then will post Qt4 signals to the main thread
on occassion.

Does this sound feasible?

This approach seems neccessary as I want to avoid timed polls and any
integration of linux poll() in the Qt4 mail loop seems to boil down to
timed polls.


Regards,
Sebastian H.

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

* Re: snd_mixer handle in two threads
  2010-06-09 13:05 snd_mixer handle in two threads Sebastian H.
@ 2010-06-09 16:59 ` Sebastian H.
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian H. @ 2010-06-09 16:59 UTC (permalink / raw)
  To: alsa-devel

Am 09.06.2010 15:05, schrieb Sebastian H.:
> Hello again
> 
> This is still about the alsamixer-qt4 application I working on.
> 
> This time I wonder if a snd_mixer_t handle created with
> snd_mixer_open ( ... ) can be used in two threads concurrently.
> 
> One thread should be the main Qt4 GUI thread and the second thread
> should only poll ( ... ) blocking for ALSA events on the shared
> snd_mixer_t handle in accompany with
> 
>   snd_mixer_poll_descriptors_count ( ... )
>   snd_mixer_poll_descriptors ( ... )
>   snd_mixer_poll_descriptors_revents ( ... )
> 
> The second thread then will post Qt4 signals to the main thread
> on occassion.

Nevermind, QSocketNotifier solved the issue in a better way.

Sebastian

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

end of thread, other threads:[~2010-06-09 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 13:05 snd_mixer handle in two threads Sebastian H.
2010-06-09 16:59 ` Sebastian H.

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).