alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Warning Big Yield
@ 2014-08-14 12:33 Joël Krähemann
  2014-08-14 15:45 ` Clemens Ladisch
  0 siblings, 1 reply; 5+ messages in thread
From: Joël Krähemann @ 2014-08-14 12:33 UTC (permalink / raw)
  To: alsa-devel mailing list

I'd really like to know if there's a common way to do syncing
applications. What frequencies are required to run a GUI?  How does Xorg
work and how can I prevent interfering with ALSA output? And what base
frequency is recommended to threads?

Warning you may experience big yield.

please take a look at ags_thread_loop() in:
http://sourceforge.net/p/ags/code/HEAD/tree/src/ags/thread/ags_thread-posix.c

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

* Re: Warning Big Yield
  2014-08-14 12:33 Warning Big Yield Joël Krähemann
@ 2014-08-14 15:45 ` Clemens Ladisch
  2014-08-14 22:58   ` Matt Flax
  0 siblings, 1 reply; 5+ messages in thread
From: Clemens Ladisch @ 2014-08-14 15:45 UTC (permalink / raw)
  To: Joël Krähemann, alsa-devel mailing list

Joël Krähemann wrote:
> I'd really like to know if there's a common way to do syncing
> applications. What frequencies are required to run a GUI?

GUIs should be event based; the term "frequency" is not applicable.

> How does Xorg work

It's event based.

> how can I prevent interfering with ALSA output?

By doing sound stuff in a separate thread with higher priority.

> Warning you may experience big yield.

???


Regards,
Clemens

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

* Re: Warning Big Yield
  2014-08-14 15:45 ` Clemens Ladisch
@ 2014-08-14 22:58   ` Matt Flax
  2014-08-15 18:48     ` Joël Krähemann
  2014-08-18 23:41     ` Joël Krähemann
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Flax @ 2014-08-14 22:58 UTC (permalink / raw)
  To: alsa-devel


On 15/08/14 01:45, Clemens Ladisch wrote:
> Joël Krähemann wrote:
>> I'd really like to know if there's a common way to do syncing
>> applications. What frequencies are required to run a GUI?
> GUIs should be event based; the term "frequency" is not applicable.
>
>> How does Xorg work
> It's event based.

Yes, event based.
For example, when using gtk ... if you want to update your GUI, you 
probably want to use the gtk timer to regularly update at a rate which 
suits your visual aesthetic.

You may already know this, but you can trigger a user function at 
regular intervals :
g_timeout_add
https://developer.gnome.org/glib/2.37/glib-The-Main-Event-Loop.html

>> how can I prevent interfering with ALSA output?
> By doing sound stuff in a separate thread with higher priority.
You can do something similar to what Jack does to ensure higher 
priority, check the file libjack/thread.c and look at the way they 
increment the priority.

You may already know this, however in case not, you can get low 
millisecond latency without dropping samples when using Linux ... i.e. 
no interferance.
That was last time I checked ... it is possible that this has improved 
to a lower threshold since then !

Matt

>> Warning you may experience big yield.
> ???
>
> Regards,
> Clemens
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: Warning Big Yield
  2014-08-14 22:58   ` Matt Flax
@ 2014-08-15 18:48     ` Joël Krähemann
  2014-08-18 23:41     ` Joël Krähemann
  1 sibling, 0 replies; 5+ messages in thread
From: Joël Krähemann @ 2014-08-15 18:48 UTC (permalink / raw)
  To: Matt Flax; +Cc: alsa-devel

On Fri, 2014-08-15 at 08:58 +1000, Matt Flax wrote:
> On 15/08/14 01:45, Clemens Ladisch wrote:
> > Joël Krähemann wrote:
> >> I'd really like to know if there's a common way to do syncing
> >> applications. What frequencies are required to run a GUI?
> > GUIs should be event based; the term "frequency" is not applicable.
> >
> >> How does Xorg work
> > It's event based.
> 
> Yes, event based.
> For example, when using gtk ... if you want to update your GUI, you 
> probably want to use the gtk timer to regularly update at a rate which 
> suits your visual aesthetic.
> 
> You may already know this, but you can trigger a user function at 
> regular intervals :
> g_timeout_add
> https://developer.gnome.org/glib/2.37/glib-The-Main-Event-Loop.html
> 
> >> how can I prevent interfering with ALSA output?
> > By doing sound stuff in a separate thread with higher priority.
> You can do something similar to what Jack does to ensure higher 
> priority, check the file libjack/thread.c and look at the way they 
> increment the priority.
> 
> You may already know this, however in case not, you can get low 
> millisecond latency without dropping samples when using Linux ... i.e. 
> no interferance.
> That was last time I checked ... it is possible that this has improved 
> to a lower threshold since then !
> 
> Matt
> 
> >> Warning you may experience big yield.
> > ???
> >
> > Regards,
> > Clemens
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

I use 250 iterations of g_main_context_iteration() per second and
application uses 1000 iterations per second.

And Herz is definitely a frequency.

regards
Joël

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

* Re: Warning Big Yield
  2014-08-14 22:58   ` Matt Flax
  2014-08-15 18:48     ` Joël Krähemann
@ 2014-08-18 23:41     ` Joël Krähemann
  1 sibling, 0 replies; 5+ messages in thread
From: Joël Krähemann @ 2014-08-18 23:41 UTC (permalink / raw)
  To: Matt Flax; +Cc: alsa-devel

Am Freitag, den 15.08.2014, 08:58 +1000 schrieb Matt Flax:
> On 15/08/14 01:45, Clemens Ladisch wrote:
> > Joël Krähemann wrote:
> >> I'd really like to know if there's a common way to do syncing
> >> applications. What frequencies are required to run a GUI?
> > GUIs should be event based; the term "frequency" is not applicable.
> >
> >> How does Xorg work
> > It's event based.
> 
> Yes, event based.
> For example, when using gtk ... if you want to update your GUI, you 
> probably want to use the gtk timer to regularly update at a rate which 
> suits your visual aesthetic.
> 
> You may already know this, but you can trigger a user function at 
> regular intervals :
> g_timeout_add
> https://developer.gnome.org/glib/2.37/glib-The-Main-Event-Loop.html
> 
> >> how can I prevent interfering with ALSA output?
> > By doing sound stuff in a separate thread with higher priority.
> You can do something similar to what Jack does to ensure higher 
> priority, check the file libjack/thread.c and look at the way they 
> increment the priority.
> 
> You may already know this, however in case not, you can get low 
> millisecond latency without dropping samples when using Linux ... i.e. 
> no interferance.
> That was last time I checked ... it is possible that this has improved 
> to a lower threshold since then !
> 
> Matt
> 
> >> Warning you may experience big yield.
> > ???
> >
> > Regards,
> > Clemens
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

With big yield I mean you hear a noise assumed you would call
pthread_yield to often.

It is strange how can I recognize more than 8 beats per second or even
more ...

I have modified my application not to do so, anymore.


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2014-08-18 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 12:33 Warning Big Yield Joël Krähemann
2014-08-14 15:45 ` Clemens Ladisch
2014-08-14 22:58   ` Matt Flax
2014-08-15 18:48     ` Joël Krähemann
2014-08-18 23:41     ` Joël Krähemann

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