Received: by 10.192.165.148 with SMTP id m20csp72572imm; Tue, 1 May 2018 17:46:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrYt/EwXk/v/+Yy9DSl7DVLu4lov7GWIO4a/SXF9kevQxsGRRh5W6qgh3b+CgeOO4QuXWCe X-Received: by 2002:a63:a74b:: with SMTP id w11-v6mr14434501pgo.351.1525222011361; Tue, 01 May 2018 17:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525222011; cv=none; d=google.com; s=arc-20160816; b=DCHQhd67euCfzInaJQhTAXFD8JwX1jrgkJ2oPLuDlTqaeklp5MjGSKN2STJBV6i1Qt uQwJCwmCp71C4Vxj6zb45NU0K6Nz8kv+fBl2Oc2jgGItOBuFEHzq0ImS91w4lqslGbfy UHBlM8DicPFUvlgGR5cuFAXlEmb09D9y1rT1X6mjJnf2f0RVAH75SfgtboL8YsKdFATB Vi8DI9BUnd7o2751cIKAvVtyFONkzGh3qfRxrLVgSUwQMFUO/UKOKDLJGssSfMWXRWyQ 1qW/psRTDeOFGmXXRA0G6080hK9cBLipHB7SpAyzy7RQzVDW1FD3rhPu9yn9n+Zoja9L 6Fwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization :content-disposition:mime-version:mail-followup-to:message-id :subject:to:from:date:arc-authentication-results; bh=Th14AxXv3gXt6NuYB6pOgNGob337LkYurSOXNS9Eu9c=; b=dbiWfqdXnpmrTqfGaRCWStCGxT03yNWI58OrNtbhpdPhKMXYlk3D0m7JBhCZKiphGL G/+aMkDPsF0DplTqdwByQI5ZPmffJyEBt8Kcxbl0Iy5AJSSvmpGBvI8rQZBFkWmuCzDu CYvEzgwnTmn1kRWCSfZuiU8apfmtyoFb7HPxsLT2DUVy4u5AOSZo71qLh3CzdDoxkVpU XR28TjAIG0xQxCfFJ1BdPe4CF6DCL/wZJUtMNS5AFjYjSx+2DgkkzM/OWcu6YsTj/Cyp zC6jfLBkj48XuwpHpbGESvBtAkRxebBqaA33NBRAjqISonRcoFZUUcr63haeZyZgStPJ /W7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si8621669pgb.321.2018.05.01.17.46.36; Tue, 01 May 2018 17:46:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751004AbeEBAqZ (ORCPT + 99 others); Tue, 1 May 2018 20:46:25 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:46152 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbeEBAqY (ORCPT ); Tue, 1 May 2018 20:46:24 -0400 X-Greylist: delayed 359 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 May 2018 20:46:24 EDT Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5DCD1122C5; Wed, 2 May 2018 02:40:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E94CVDVQT_jc; Wed, 2 May 2018 02:40:22 +0200 (CEST) Received: from var.youpi.perso.aquilenet.fr (static-176-158-111-12.ftth.abo.bbox.fr [176.158.111.12]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 232E6140B4; Wed, 2 May 2018 02:40:22 +0200 (CEST) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.91) (envelope-from ) id 1fDfog-0004UP-0S; Wed, 02 May 2018 02:40:18 +0200 Date: Wed, 2 May 2018 02:40:17 +0200 From: Samuel Thibault To: gregkh@linuxfoundation.org, w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, speakup@linux-speakup.org Subject: Re: [PATCH] staging: speakup: Add pause command used on switching to graphical mode Message-ID: <20180502004017.hityg7k7cxhn75na@var.youpi.perso.aquilenet.fr> Mail-Followup-To: Samuel Thibault , gregkh@linuxfoundation.org, w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, speakup@linux-speakup.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For software speech syntheses to be able to manage concurrent audio card access, they need to know when speakup stops emitting text to be spoken because the console has switched to graphical mode. This introduces a PAUSE command to do so. Signed-off-by: Samuel Thibault Index: linux-4.15/drivers/staging/speakup/speakup_dummy.c =================================================================== --- linux-4.15.orig/drivers/staging/speakup/speakup_dummy.c +++ linux-4.15/drivers/staging/speakup/speakup_dummy.c @@ -30,6 +30,7 @@ static struct var_t vars[] = { { CAPS_START, .u.s = {"CAPS_START\n" } }, { CAPS_STOP, .u.s = {"CAPS_STOP\n" } }, + { PAUSE, .u.s = {"PAUSE\n"} }, { RATE, .u.n = {"RATE %d\n", 8, 1, 16, 0, 0, NULL } }, { PITCH, .u.n = {"PITCH %d\n", 8, 0, 16, 0, 0, NULL } }, { VOL, .u.n = {"VOL %d\n", 8, 0, 16, 0, 0, NULL } }, Index: linux-4.15/drivers/staging/speakup/speakup_soft.c =================================================================== --- linux-4.15.orig/drivers/staging/speakup/speakup_soft.c +++ linux-4.15/drivers/staging/speakup/speakup_soft.c @@ -45,6 +45,7 @@ static int misc_registered; static struct var_t vars[] = { { CAPS_START, .u.s = {"\x01+3p" } }, { CAPS_STOP, .u.s = {"\x01-3p" } }, + { PAUSE, .u.n = {"\x01P" } }, { RATE, .u.n = {"\x01%ds", 2, 0, 9, 0, 0, NULL } }, { PITCH, .u.n = {"\x01%dp", 5, 0, 9, 0, 0, NULL } }, { VOL, .u.n = {"\x01%dv", 5, 0, 9, 0, 0, NULL } }, @@ -164,7 +165,7 @@ static char *get_initstring(void) var = synth_soft.vars; while (var->var_id != MAXVARS) { if (var->var_id != CAPS_START && var->var_id != CAPS_STOP && - var->var_id != DIRECT) + var->var_id != PAUSE && var->var_id != DIRECT) cp = cp + sprintf(cp, var->u.n.synth_fmt, var->u.n.value); var++; Index: linux-4.15/drivers/staging/speakup/spk_types.h =================================================================== --- linux-4.15.orig/drivers/staging/speakup/spk_types.h +++ linux-4.15/drivers/staging/speakup/spk_types.h @@ -42,7 +42,7 @@ enum var_id_t { SAY_CONTROL, SAY_WORD_CTL, NO_INTERRUPT, KEY_ECHO, SPELL_DELAY, PUNC_LEVEL, READING_PUNC, ATTRIB_BLEEP, BLEEPS, - RATE, PITCH, VOL, TONE, PUNCT, VOICE, FREQUENCY, LANG, DIRECT, + RATE, PITCH, VOL, TONE, PUNCT, VOICE, FREQUENCY, LANG, DIRECT, PAUSE, CAPS_START, CAPS_STOP, CHARTAB, MAXVARS }; Index: linux-4.15/drivers/staging/speakup/varhandlers.c =================================================================== --- linux-4.15.orig/drivers/staging/speakup/varhandlers.c +++ linux-4.15/drivers/staging/speakup/varhandlers.c @@ -44,6 +44,7 @@ static struct st_var_header var_headers[ { "lang", LANG, VAR_NUM, NULL, NULL }, { "chartab", CHARTAB, VAR_PROC, NULL, NULL }, { "direct", DIRECT, VAR_NUM, NULL, NULL }, + { "pause", PAUSE, VAR_STRING, spk_str_pause, NULL }, }; static struct st_var_header *var_ptrs[MAXVARS] = { NULL, NULL, NULL }; Index: linux-4.15/drivers/staging/speakup/main.c =================================================================== --- linux-4.15.orig/drivers/staging/speakup/main.c +++ linux-4.15/drivers/staging/speakup/main.c @@ -76,6 +76,8 @@ short spk_punc_mask; int spk_punc_level, spk_reading_punc; char spk_str_caps_start[MAXVARLEN + 1] = "\0"; char spk_str_caps_stop[MAXVARLEN + 1] = "\0"; +char spk_str_pause[MAXVARLEN + 1] = "\0"; +bool spk_paused = 0; const struct st_bits_data spk_punc_info[] = { {"none", "", 0}, {"some", "/$%&@", SOME}, @@ -1789,6 +1791,11 @@ static void speakup_con_update(struct vc /* Speakup output, discard */ return; speakup_date(vc); + if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0]) + { + synth_printf("%s", spk_str_pause); + spk_paused = 1; + } spin_unlock_irqrestore(&speakup_info.spinlock, flags); } Index: linux-4.15/drivers/staging/speakup/speakup.h =================================================================== --- linux-4.15.orig/drivers/staging/speakup/speakup.h +++ linux-4.15/drivers/staging/speakup/speakup.h @@ -94,7 +94,8 @@ extern struct spk_synth *synth; extern char spk_pitch_buff[]; extern u_char *spk_our_keys[]; extern short spk_punc_masks[]; -extern char spk_str_caps_start[], spk_str_caps_stop[]; +extern char spk_str_caps_start[], spk_str_caps_stop[], spk_str_pause[]; +extern bool spk_paused; extern const struct st_bits_data spk_punc_info[]; extern u_char spk_key_buf[600]; extern char *spk_characters[]; Index: linux-4.15/drivers/staging/speakup/buffers.c =================================================================== --- linux-4.15.orig/drivers/staging/speakup/buffers.c +++ linux-4.15/drivers/staging/speakup/buffers.c @@ -76,6 +76,9 @@ void synth_buffer_add(u16 ch) *buff_in++ = ch; if (buff_in > buffer_end) buff_in = synth_buffer; + /* We have written something to the speech synthesis, so we are not + * paused any more. */ + spk_paused = 0; } u16 synth_buffer_getc(void)