From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71CC4E7AD57 for ; Tue, 3 Oct 2023 14:28:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qngNb-0002vA-DG; Tue, 03 Oct 2023 10:28:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qngNa-0002um-84 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 10:28:06 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qngNY-0006h3-M7 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 10:28:06 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-327b7e08456so1026412f8f.2 for ; Tue, 03 Oct 2023 07:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696343283; x=1696948083; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=m5XqRQp04AsH44pLV6Aa8BlwoHTiJuARREuFYewK/oo=; b=KhWuIZKNyHNwfsqLfk6AvtJKskA96tlvuSHCNQA1RipIGUK8or1iWj1J6puv62+m4X lsAparkz8ZF850lor90FSZEFLXOzUE9nrw1KOOjSEdEfNQa/wMuRDlkyTBGSwXwsaosH EnNFr4HqUtoYiq0TwSigCusyw635k1wwNn1ND4RO3zdz7C0LeHjlgdKaSVaHMSya8u6e beoKId4lItVUUVhep6dnqYVB0X0cNDi1xMW9sVEM0Oc7xdEEGXbQio5Ms+xkvtLw8/pC gfpxOPgwTh0fe21++vikCeLRr8B5aErk/KAvhDHeOdhnL+5yLfdE5Df67DgI31KlKyca 3lvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696343283; x=1696948083; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m5XqRQp04AsH44pLV6Aa8BlwoHTiJuARREuFYewK/oo=; b=jbZ1f0amOsg+CRSUT64C3ZK+9XiPv9vTxkW63JgKuP9+jUIW3eYEPGYhYCI3b3mdI7 IQbgRUraoeGJzOjF/UuDjyMVaCKOmFz95oxYp7+hihbR5RFrFRVop8XvYAwLLeu18mhb Ixh09c2deY5dyhd0cuPqHkxsJaAuiJq6fAfUFx4Z3EOsU/DG5EZHUQAyVfIbls6COw12 momZfFxTWhWxQFZV2bB7VpYoTawtnjgKh9fI4mpwGSLmHGtQ2VZPdsXZKrYEiwSVTEnw LLLHXk+2yjGuw/xKHSplEEGoghPcxb2MOuZcLkvs/UiWN6dVG5jZd8dlB/Ck22yehBaI FTgQ== X-Gm-Message-State: AOJu0YzsLM1M0MGTMwy461M8Sbgtb+dDjfftZlCY7hoaJupx9b7oS0Z+ e7hICcXZO/YFlxPbIh3ysvJOrA== X-Google-Smtp-Source: AGHT+IEuppAHHSPKnCizCWmTgCnSkYygN2Cidkd+gRa5at1QsjwM33Uc91g86pjFJMv0jMHa5f9WTw== X-Received: by 2002:a05:6000:1112:b0:31f:d3e3:a53d with SMTP id z18-20020a056000111200b0031fd3e3a53dmr13356229wrw.2.1696343282467; Tue, 03 Oct 2023 07:28:02 -0700 (PDT) Received: from [192.168.69.115] (176-131-222-246.abo.bbox.fr. [176.131.222.246]) by smtp.gmail.com with ESMTPSA id i15-20020adfefcf000000b00317f70240afsm1712738wrp.27.2023.10.03.07.28.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 07:28:01 -0700 (PDT) Message-ID: <12d588b8-a276-4de9-cce1-82b473494c25@linaro.org> Date: Tue, 3 Oct 2023 16:27:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v10 09/11] virtio-sound: implement audio output (TX) Content-Language: en-US To: Manos Pitsidianakis , qemu-devel@nongnu.org Cc: Igor Skalkin , Anton Yakovlev , Paolo Bonzini , Gerd Hoffmann , "Michael S. Tsirkin" , Marcel Apfelbaum , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Eduardo Habkost , =?UTF-8?Q?Marc-Andr_=c3=a9_Lureau?= , =?UTF-8?Q?Volker_R_=c3=bc_melin?= , =?UTF-8?B?S8WRIHbDoSBnw7MgLCBab2x0w6Egbg==?= , =?UTF-8?Q?Alex_Benn_=c3=a9_e?= , Mark Cave-Ayland References: <4cbb908742ba1820d72ac60086460df357976ba6.1695996196.git.manos.pitsidianakis@linaro.org> <1rgxd.z1377ck6xsdb@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <1rgxd.z1377ck6xsdb@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.09, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hi Manos, On 29/9/23 20:59, Manos Pitsidianakis wrote: > On Fri, 29 Sep 2023 17:08, Emmanouil Pitsidianakis > wrote: >> Handle output IO messages in the transmit (TX) virtqueue. > [..] >> +            if (!stream->active) { >> +                /* Stream has stopped, so do not perform AUD_write. */ >> +                goto return_tx_buffer; >> +            } > [..] >> +return_tx_buffer: >> +                    virtio_snd_pcm_status resp = { 0 }; >> +                    resp.status = cpu_to_le32(VIRTIO_SND_S_OK); > > > It seems I was too hasty to submit this patch. It does not build with > clang on macos because it does not allow labels before declarations. > > It needs the following changes to compile: > > --- a/hw/virtio/virtio-snd.c > +++ b/hw/virtio/virtio-snd.c > @@ -1187,7 +1187,7 @@ static void virtio_snd_pcm_out_cb(void *data, int > available) >                 buffer->offset += size; >                 available -= size; >                 if (buffer->size < 1) { > -return_tx_buffer: > +return_tx_buffer:; >                     virtio_snd_pcm_status resp = { 0 }; >                     resp.status = cpu_to_le32(VIRTIO_SND_S_OK); >                     resp.latency_bytes = 0; Extract a tiny return_tx_buffer() function, which you can then call in the 2 different places.