From: Takashi Iwai Subject: Re: [alsa-lib][PATCH] test/seq-decoder: enable timestamping for external subscribers Date: Tue, 03 Oct 2017 09:25:16 +0200 Message-ID: References: <20170926144449.28289-1-ao2@ao2.it> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E479F2672AC for ; Tue, 3 Oct 2017 09:25:16 +0200 (CEST) In-Reply-To: <20170926144449.28289-1-ao2@ao2.it> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Antonio Ospite Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Tue, 26 Sep 2017 16:44:49 +0200, Antonio Ospite wrote: > > Events sent by external clients subscribed to the input port are not > timestamped. > > This inconsistent behavior may surprise newbies who look at seq-decoder as > a reference example. > > See the example below using "vkeybd --addr 128:0" to connect to seq-decoder, > the events sent by vkeybd are on a different queue with no timestamps: > > ... > EVENT>>> Type = 66, flags = 0x0, time = 0 ticks > Source = 0.1, dest = 128.0, queue = 253 > Event = Port Subscribed; 129:0 -> 128:0 > EVENT>>> Type = 66, flags = 0x1, time = 4.829712627 > Source = 0.1, dest = 128.0, queue = 0 > Event = Port Subscribed; 129:0 -> 128:0 > EVENT>>> Type = 10, flags = 0x0, time = 0 ticks > Source = 129.0, dest = 128.0, queue = 253 > Event = Controller; ch=0, param=0, value=0 > EVENT>>> Type = 11, flags = 0x0, time = 0 ticks > Source = 129.0, dest = 128.0, queue = 253 > Event = Program Change; ch=0, program=0 > ... > > After the change events are on the main queue and are timestamped: > > ... > EVENT>>> Type = 66, flags = 0x1, time = 4.280907223 > Source = 0.1, dest = 128.0, queue = 0 > Event = Port Subscribed; 129:0 -> 128:0 > EVENT>>> Type = 66, flags = 0x1, time = 4.280912063 > Source = 0.1, dest = 128.0, queue = 0 > Event = Port Subscribed; 129:0 -> 128:0 > EVENT>>> Type = 10, flags = 0x1, time = 4.280990702 > Source = 129.0, dest = 128.0, queue = 0 > Event = Controller; ch=0, param=0, value=0 > EVENT>>> Type = 11, flags = 0x1, time = 4.280994862 > Source = 129.0, dest = 128.0, queue = 0 > Event = Program Change; ch=0, program=0 > ... > > Signed-off-by: Antonio Ospite > --- > > Hi, > > while looking into improving the alsamidisrc[1,2] GStreamer element, I took > a better look at what the sequencer API could do and started using > test/seq-decoder.c as a reference example. > > I noticed the issue discussed above and I tried to fix it in order to have > a more consistent behavior of event timestamping. > > I think the new behavior is less surprising for newbies but I may still be > missing something, please let me know if I am. This looks like a sensible change, so I applied it now. Thanks! Takashi