Menu

AGS - Advanced Gtk+ Sequencer / Blog: Recent posts

Revised different threading strategy

I'll introduce at the topmost thread a frequency used for timing.
Planed is to try the following frequencies:

Thread Frequency
Audio Loop 1000 Hz
Devout Thread 100 Hz
Gui Thread 100 Hz
Task Thread 1000 Hz

This will probably fix almost all faults. And the threads stay synced.

Posted by Joël Krähemann 2014-08-12

Different threading strategy

Since synchronizing every thread causes some real bad faults. I just won't do it anymore. I'm really looking forward to test new copying function using 128 bit registers.

Posted by Joël Krähemann 2014-08-12

Frustrated about fedora and lfs

Development was never so annoying than with those distributions.

That's why I'm considering to switch back to debian GNU/Linux.
Most problematic was performance. I experienced some really strangeous faults like shooting down ags in sync with me and the engine.

Posted by Joël Krähemann 2014-08-11

Artwork

Posted by Joël Krähemann 2014-08-10 Labels: wallpaper

The Big Nanosleep - revision 1800

I just need to get approved the frequencies to do Multiplexing by time. Therefor Advanced Gtk+ Sequencer may not interfere with Linux VM, anymore.

Objectives, in order to perform safe operations you have to do multiplexing by time with nanosleep() and pthread_yield().

Every program doing endless loops or at least with a abortion routine has a need for this kind of operations. Nothing can't work without it and has to be declared as unsafe. This rule is applicable mostly to C Programming.... read more

Posted by Joël Krähemann 2014-08-02

Using timers to target unspecified problems

This is a part of Advanced Gtk+ Sequencer out of ags_async_queue.h

#define AGS_ASYNC_QUEUE_CLOCK_ID CLOCK_REALTIME
#define AGS_ASYNC_QUEUE_SIGNAL_HIGH SIGRTMAX
#define AGS_ASYNC_QUEUE_SIGNAL_LOW SIGRTMIN

Instead queueing nanosleep there will be timers used. Another interesting function is pthread_yield() which relinquishes the cpu.

Posted by Joël Krähemann 2014-07-31

Howto throttle systems

Thesis:

  • assumed the net runs at a certain clock speed you can throttle the entire system by doing some overclocking
  • reverse case you underload the net by overclocking on the high end

This isn't such trivial because the powerline and the clock modulator runs asynchronously. This is relevant because everything is interconnected. Further could exact timings cause power tops?

To adjust frequency you need execution stack and the ability to synchronize. This is further the prerequisite to do capacity hacks!... read more

Posted by Joël Krähemann 2014-07-30

Revising XML RPC code in front of 0.4.0

Absented by going further ...
This means the oncoming release later. At least for a year or something like this.
The XML RPC code get revised therefor. Further OCaml 4.01.0 will be required assumed you want to use the client.

AgsApplicationContext will be provided, too.

Posted by Joël Krähemann 2014-07-30

Singleton And Multiplexing By Data

The singleton is the only logic opposite of multiplexing by data. Further it acts as simple interface within API. Therefore the most famous example would be the Factory Pattern. Advanced Gtk+ Sequencer implements the AgsRecallFactory in order to use with plugins. There exists an AgsTimestampFactory as well reserved for future use.

An other pattern in its infancy is the AgsAsyncQueue pattern a singleton, too. It should be responsible to caught up software based interrupts caused by its nature. Not a least is it needed to avoid crashes caused by assumptions of logical systems.... read more

Posted by Joël Krähemann 2014-07-29

Exception & Interrupt Handling

Doing some researches about exception handling and interrupts. Not at least cause of the nature of time, capacity and reliability of thread computing power.

If your familiar with these topics what would you say to exchange after researches or giving some hints or answering open questions:

  • What to do if you go faster than computing power is calling nanosleep() sufficient?
  • Can I time the tree and set its frequency in a polymorph form?
  • What can the operating system do for me should I take a look at timers?
  • Is there a open specification to target this problem and is it protected by patent laws?
Posted by Joël Krähemann 2014-07-28


Compiling Helper Libraries

Table of Content

Prerequisite

The only requirements are you did the steps in previous blog post Installing Dependencies. This page completes Other dependencies and is according to linuxfromscratch.org... read more

Posted by SourceForge Robot 2014-07-28

New thread implementation using kernel threads

In order to get objectives there will be a new thread implementation using kernel threads. Since there were enormous problems using posix threads on GNU/Linux. I experienced many strange crashes in the nature of unexpected.

Posted by Joël Krähemann 2014-07-27 Labels: threads


Revision 1774 - engine seems to be stable

I just tested drum machine and it ran over 10 minutes. But at the moment, it wastes memory like mad. Approximately 1GB of RAM was used during this short period.

To be continued.

Posted by Joël Krähemann 2014-07-18

To many threads hung up

It was a long and painful exercise to develop the thread tree whereby many different strategies tried. Probably even all that's why I'll do a revert. Not at least due to all thread concepts were used. From AgsAsyncQueue to toplevel locking.

** (ags:26306): WARNING **: thread tree hung up

toplevel locking has one bad attitude. Namely hanging up the tree.

It seems never ending ...

The thread loop will be revised once again. Finally got to say, there too many commits dedicated to threads.... read more

Posted by Joël Krähemann 2014-07-18

fail of first attempts using AgsAsyncQueue

It probably has no meaning. There is a need for further investigation. By timing can be done much more.

Trying other scheduling strategies or virtual machines may bring more reliability.

Posted by Joël Krähemann 2014-07-18

doing AgsAsyncQueue

Finally took decision to implement AgsAsyncQueue to achieve thread reliability. Assumed the object gives expected advantages ags will be soon released in its very first version 0.4.0

Due to strange crashes likewise crashing while returning true or corrupted double linked lists. This is all indicates thread safety related problems.

There was much time wasted with uncertainty but new courage has come not at least while reflecting and doing some forum posts.... read more

Posted by Joël Krähemann 2014-07-16 Labels: async queue thread tree sync 0.4.0 release

No need for Async-Queues

Could someone explain me:

sigaction(SA_RESTART, &ags_sigact, (struct sigaction *) NULL);

Posted by Joël Krähemann 2014-07-08

mathematical properties of timing

Today I did some thoughts of timing. Whereby this formula created:

δt1 = 1 / |t1| - (va * vb) / δt1

Therefore the thread functionality will be modified in the manner of async queues with the functionality of the tree.

Further thoughts needed to solve thread reliability.

What about:

zn = 1 / 45 * sin(n / zn - 1) / 300'000... read more

Posted by Joël Krähemann 2014-07-04

Last steps for ags 0.4.0

Configuration by config file is planned.

You should be able selecting thread tree model, doing individual lock strategies and basic device setup.

These were the bad things. Now, telling what is already done so far. Auto-save to file namely in $HOME/ags-autosave.xml. Further rudimentary process signal handling is done.

Advanced Gtk+ Sequencer uses pcm alsa configuration, again. New, under-run recovery performed as needed.... read more

Posted by Joël Krähemann 2014-06-28 Labels: ags conf auto-save under-run pcm signal process short write

Probably has a need for global locking

I making thoughts about more global locking within threads, since I got the following errors:

...

            fff917cc000-7fff91fcc000 rw-p 00000000 00:00 0
            7fff91fcc000-7fff91fcd000 ---p 00000000 00:00 0
            7fff91fcd000-7fff927cd000 rw-p 00000000 00:00 0
            7fff927cd000-7fff927ce000 ---p 00000000 00:00 0
            7fff927ce000-7fff92fce000 rw-p 00000000 00:00 0
            7fff92fce000-7fff92fcf000 ---p 00000000 00:00 0
            7fff92fcf000-7fff937cf000 rw-p 00000000 00:00 0
            7fff937cf000-7fff937d0000 ---p 00000000 00:00 0
            7fff937d0000-7fff93fd0000 rw-p 00000000 00:00 0
            7fff93fd0000-7fff93fd1000 ---p 00000000 00:00 0
            7fff93fd1000-7fff947d1000 rw-p 00000000 00:00 0
            7fff947d1000-7fff947d2000 ---p 00000000 00:00 0
            7fff947d2000-7fff94fd2000 rw-p 00000000 00:00 0
            7fff94fd2000-7fff94fd3000 ---p 00000000 00:00 0
            7fff94fd3000-7fff957d3000 rw-p 00000000 00:00 0
            7fff957d3000-7fff957d4000 ---p 00000000 00:00 0
            7fff957d4000-7fff95fd4000 rw-p 00000000 00:00 0
            7fff95fd4000-7fff95fd5000 ---p 00000000 00:00 0
            7fff95fd5000-7fff967d5000 rw-p 00000000 00:00 0
            Program received signal SIGABRT, Aborted.
            [Switching to Thread 0x7fffeec86700 (LWP 15013)]
            0x00007ffff0303349 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
            (gdb) make ags
            (gdb) bt
            #0 0x00007ffff0303349 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
            #1 0x00007ffff0304748 in __GI_abort () at abort.c:89
            #2 0x00007ffff03411d4 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff04334b8 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
            #3 0x00007ffff034695e in malloc_printerr (action=3, str=0x7ffff042f608 "free(): invalid size", ptr=<optimized out>) at malloc.c:4991
            #4 0x00007ffff0347666 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3837
            #5 0x00007ffff290dec8 in g_free () from /usr/lib/../lib64/libglib-2.0.so.0
            #6 0x00007ffff2902518 in g_list_foreach () from /usr/lib/../lib64/libglib-2.0.so.0
            #7 0x00007ffff2901ac8 in g_list_free_full () from /usr/lib/../lib64/libglib-2.0.so.0
            #8 0x000000000046a74f in ags_audio_signal_finalize (gobject=0x7fffdc18adc0) at ./src/ags/audio/ags_audio_signal.c:329
            #9 0x00007ffff2df1282 in g_object_unref () from /usr/lib/../lib64/libgobject-2.0.so.0
            #10 0x000000000046c752 in ags_recall_recycling_set_property (gobject=0x7fffdc793cf0, prop_id=<optimized out>, value=0x7fffeec83d50, param_spec=0x7fffe17ed280) at ./src/ags/audio/ags_recall_recycling.c:367
            #11 0x00007ffff2dec876 in object_set_property () from /usr/lib/../lib64/libgobject-2.0.so.0
            #12 0x00007ffff2dee774 in g_object_set_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #13 0x00007ffff2deef54 in g_object_set () from /usr/lib/../lib64/libgobject-2.0.so.0
            #14 0x000000000046c2d6 in ags_recall_recycling_destination_add_audio_signal_callback (destination=<optimized out>, audio_signal=0x7fffc8003990, recall_recycling=0x7fffdc793cf0) at ./src/ags/audio/ags_recall_recycling.c:728
            #15 0x00007ffff2de986a in g_cclosure_marshal_VOID__OBJECT () from /usr/lib/../lib64/libgobject-2.0.so.0
            #16 0x00007ffff2de4d5f in g_closure_invoke () from /usr/lib/../lib64/libgobject-2.0.so.0
            #17 0x00007ffff2e01f24 in signal_emit_unlocked_R () from /usr/lib/../lib64/libgobject-2.0.so.0
            #18 0x00007ffff2e00f7c in g_signal_emit_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #19 0x00007ffff2e014cf in g_signal_emit () from /usr/lib/../lib64/libgobject-2.0.so.0
            #20 0x000000000046871b in ags_recycling_add_audio_signal (recycling=0x7fffe00ac4f0, audio_signal=0x7fffc8003990) at ./src/ags/audio/ags_recycling.c:278
            #21 0x0000000000481630 in ags_loop_channel_run_create_audio_signals (loop_channel_run=0x7fffe000aae0) at ./src/ags/audio/recall/ags_loop_channel_run.c:607
            #22 0x00007ffff2de8607 in g_cclosure_marshal_VOID(unsigned int0_t, void) () from /usr/lib/../lib64/libgobject-2.0.so.0
            #23 0x00007ffff2de4ff7 in _g_closure_invoke_va () from /usr/lib/../lib64/libgobject-2.0.so.0
            #24 0x00007ffff2e002f9 in g_signal_emit_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #25 0x00007ffff2e014cf in g_signal_emit () from /usr/lib/../lib64/libgobject-2.0.so.0
            #26 0x000000000047d73a in ags_count_beats_audio_run_sequencer_loop (count_beats_audio_run=0x7fffdc05c4c0, run_order=0) at ./src/ags/audio/recall/ags_count_beats_audio_run.c:861
            #27 0x000000000047d93b in ags_count_beats_audio_run_sequencer_alloc_output_callback (delay_audio_run=<optimized out>, run_order=0, delay=<optimized out>, attack=<optimized out>, count_beats_audio_run=0x7fffdc05c4c0)
            at ./src/ags/audio/recall/ags_count_beats_audio_run.c:948
            #28 0x00007ffff2de4d5f in g_closure_invoke () from /usr/lib/../lib64/libgobject-2.0.so.0
            #29 0x00007ffff2e01c62 in signal_emit_unlocked_R () from /usr/lib/../lib64/libgobject-2.0.so.0
            #30 0x00007ffff2e00f7c in g_signal_emit_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #31 0x00007ffff2e014cf in g_signal_emit () from /usr/lib/../lib64/libgobject-2.0.so.0
            #32 0x0000000000477045 in ags_delay_audio_run_sequencer_alloc_output (delay_audio_run=0x7fffe0392480, run_order=0, delay=<optimized out>, attack=492) at ./src/ags/audio/recall/ags_delay_audio_run.c:574
            #33 0x00000000004773ba in ags_delay_audio_run_run_pre (recall=<optimized out>) at ./src/ags/audio/recall/ags_delay_audio_run.c:420
            #34 0x00007ffff2de8607 in g_cclosure_marshal_VOID(unsigned int0_t, void) () from /usr/lib/../lib64/libgobject-2.0.so.0
            #35 0x00007ffff2de5434 in g_type_class_meta_marshalv () from /usr/lib/../lib64/libgobject-2.0.so.0
            #36 0x00007ffff2de4ff7 in _g_closure_invoke_va () from /usr/lib/../lib64/libgobject-2.0.so.0
            #37 0x00007ffff2e002f9 in g_signal_emit_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #38 0x00007ffff2e014cf in g_signal_emit () from /usr/lib/../lib64/libgobject-2.0.so.0
            #39 0x0000000000471d36 in ags_recall_run_pre (recall=0x7fffe0392480) at ./src/ags/audio/ags_recall.c:1239
            #40 0x000000000046fdb9 in ags_audio_play (audio=audio@entry=0x7fffe00039f0, recall_id=recall_id@entry=0x7fffdc0ee100, stage=0) at ./src/ags/audio/ags_audio.c:2252
            #41 0x000000000048ca8b in ags_channel_recursive_play_output (output=output@entry=0x7fffe00c2c70, output_recall_id=output_recall_id@entry=0x7fffdc0ee100) at ./src/ags/audio/ags_channel.c:2011
            #42 0x000000000048d03e in ags_channel_recursive_play (channel=channel@entry=0x7fffe00c2c70, recall_id=0x7fffdc0ee100, stage=stage@entry=0) at ./src/ags/audio/ags_channel.c:2088
            #43 0x00000000004c329f in ags_audio_loop_play_audio (audio_loop=audio_loop@entry=0x902fd0) at ./src/ags/thread/ags_audio_loop.c:779
            #44 0x00000000004c34a8 in ags_audio_loop_run (thread=<optimized out>) at ./src/ags/thread/ags_audio_loop.c:540
            #45 0x00007ffff2de7dd0 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/../lib64/libgobject-2.0.so.0
            #46 0x00007ffff2de5434 in g_type_class_meta_marshalv () from /usr/lib/../lib64/libgobject-2.0.so.0
            #47 0x00007ffff2de4ff7 in _g_closure_invoke_va () from /usr/lib/../lib64/libgobject-2.0.so.0
            #48 0x00007ffff2e002f9 in g_signal_emit_valist () from /usr/lib/../lib64/libgobject-2.0.so.0
            #49 0x00007ffff2e014cf in g_signal_emit () from /usr/lib/../lib64/libgobject-2.0.so.0
            #50 0x00000000004c1736 in ags_thread_run (thread=0x902fd0) at ./src/ags/thread/ags_thread.c:1914
            #51 0x00000000004c1a17 in ags_thread_loop (ptr=<optimized out>) at ./src/ags/thread/ags_thread.c:1804
            #52 0x00007ffff245f032 in start_thread (arg=0x7fffeec86700) at pthread_create.c:309
            #53 0x00007ffff03b3d0d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            (gdb)
Posted by Joël Krähemann 2014-06-28

gdb sucks / application crashed while returning TRUE

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe7477700 (LWP 11454)]
0x0000000000462075 in ags_notation_remove_note_at_position (notation=0x7fffe0034200, x=x@entry=13, y=y@entry=9) at ./src/ags/audio/ags_notation.c:650
650 return(TRUE);

Posted by Joël Krähemann 2014-06-19 Labels: strange crash

implementing auto backup of ags

The coming release will include auto backup and recovery facilities.
0.4.0 is therefore delayed because this feature is considered as critical.
Release candidate 5 is released, soon. It has major improvements within stability and usability.

New release planed in 2 or 3 weeks.

Posted by Joël Krähemann 2014-06-16 Labels: ags pre-release rc5

Software failure / broken OS

I installed grub in partitions it didn't belong to ...
That's why release 0.4.0 will be late for a week.

My computer wasn't bootable.

Annoyed about complaining that there is not enough disk space on master boot record!

Posted by Joël Krähemann 2014-06-01
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.