4 years agoImprove buffer timestamping master
Antonio Ospite [Tue, 3 Oct 2017 10:32:27 +0000 (12:32 +0200)]
Improve buffer timestamping

Make buffer timestamps more accurate and, more importantly, actually
representative of the MIDI events timing.

Previously, buffers were only sent with timetamps aligned at a 10ms
boundary which was just wrong, now the buffer timestamp represents the
real time of the MIDI event.

Conveniently, the ALSA sequence API supports scheduling events in the
future so the sequencing infrastructure can be used to have the tick
delivered at the right time, avoiding any custom scheduling mechanism.

The sequencer queue is started on the first transition to PLAYING, and
the delay is also calculated when the pipeline goes into PLAYING.

4 years agoExpand snd_seq_create_simple_port() and use a queue to timestamp events
Antonio Ospite [Mon, 2 Oct 2017 20:33:35 +0000 (22:33 +0200)]
Expand snd_seq_create_simple_port() and use a queue to timestamp events

Events are timestamped with a real-time value representing the time
passed since the queue timer was started.

The timestamp is not used just yet.

4 years agoDon't set buffer offset and duration
Antonio Ospite [Mon, 2 Oct 2017 08:27:05 +0000 (10:27 +0200)]
Don't set buffer offset and duration

They are not relly needed for a live source in pull mode

4 years agoPrevent Valgrind from reporting cached configuration as memory leaks
Antonio Ospite [Mon, 25 Sep 2017 13:14:45 +0000 (15:14 +0200)]
Prevent Valgrind from reporting cached configuration as memory leaks


4 years agoMake feed_data more robust
Antonio Ospite [Mon, 2 Oct 2017 09:51:54 +0000 (11:51 +0200)]
Make feed_data more robust

Make the function either push a buffer or send EOS in every exit path,
this prevents the pipeline from waiting for data which is not going to

4 years agoMake push_buffer() look similar to the code used in alsamidisrc
Antonio Ospite [Mon, 25 Sep 2017 12:07:05 +0000 (14:07 +0200)]
Make push_buffer() look similar to the code used in alsamidisrc

4 years agoAdd a verbose option, it can be useful for debugging
Antonio Ospite [Mon, 2 Oct 2017 08:25:56 +0000 (10:25 +0200)]
Add a verbose option, it can be useful for debugging

4 years agoSet the debug category name to the same GstAppSrc name used in the pipeline
Antonio Ospite [Fri, 29 Sep 2017 09:25:23 +0000 (11:25 +0200)]
Set the debug category name to the same GstAppSrc name used in the pipeline

4 years agoMake the global App variable static
Antonio Ospite [Fri, 29 Sep 2017 09:22:36 +0000 (11:22 +0200)]
Make the global App variable static

4 years agoReplace g_malloc+memcpy with g_memdup
Antonio Ospite [Mon, 25 Sep 2017 09:47:12 +0000 (11:47 +0200)]
Replace g_malloc+memcpy with g_memdup

4 years agoPort parse_ports() over from alsamidisrc, to reduce the code differences
Antonio Ospite [Mon, 25 Sep 2017 09:39:53 +0000 (11:39 +0200)]
Port parse_ports() over from alsamidisrc, to reduce the code differences

Also, use g_free() to deallocate app->seq_ports: since it is allocated
with g_try_new(), use a glib function to deallocate it as well.

7 years agoDo not use alloca() in app_init(): the memory is used after the return
Antonio Ospite [Tue, 9 Jun 2015 21:21:08 +0000 (23:21 +0200)]
Do not use alloca() in app_init(): the memory is used after the return

Also reorder the cleanup sequence in app_finalize().

7 years agoInitial import
Antonio Ospite [Wed, 15 Oct 2014 13:39:28 +0000 (14:39 +0100)]
Initial import