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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5600DC433E0 for ; Wed, 24 Feb 2021 13:46:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A3C25601FB for ; Wed, 24 Feb 2021 13:46:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3C25601FB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bugs.launchpad.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEuUR-0002lo-AD for qemu-devel@archiver.kernel.org; Wed, 24 Feb 2021 08:46:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEuGO-0000mJ-JA for qemu-devel@nongnu.org; Wed, 24 Feb 2021 08:31:36 -0500 Received: from indium.canonical.com ([91.189.90.7]:50780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEuGE-0003yi-Fz for qemu-devel@nongnu.org; Wed, 24 Feb 2021 08:31:36 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1lEuG9-0005lw-Hn for ; Wed, 24 Feb 2021 13:31:21 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id A76282E8142 for ; Wed, 24 Feb 2021 13:31:20 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Feb 2021 13:23:01 -0000 From: Christian Schoenebeck <1908832@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: koalinux schoenebeck X-Launchpad-Bug-Reporter: =?utf-8?q?Jos=C3=A9_Pekkarinen_=28koalinux=29?= X-Launchpad-Bug-Modifier: Christian Schoenebeck (schoenebeck) References: <160848897234.4298.12739306431901820443.malonedeb@wampee.canonical.com> Message-Id: <161417298187.19816.12289317245607310239.malone@wampee.canonical.com> Subject: [Bug 1908832] Re: jack audio dev produces no sound X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="1cbcae463afd8b78ec54d5c5633aff9545801dde"; Instance="production" X-Launchpad-Hash: 5ff950e56e8c122b4d2d122e8b95778aab4820a8 Received-SPF: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1908832 <1908832@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" c->opt->connect_ports is an optional user supplied configuration argument which allows the user to specify a regular expression pattern which is used by QEMU's JACK audio driver to automatically connect its JACK ports to. From qapi/audio.json: ## # @AudiodevJackPerDirectionOptions: # # Options of the JACK backend that are used for both playback and # recording. # # @server-name: select from among several possible concurrent server instan= ces # (default: environment variable $JACK_DEFAULT_SERVER if set,= else "default") # # @client-name: the client name to use. The server will modify this name to # create a unique variant, if needed unless @exact-name is tr= ue (default: the # guest's name) # # @connect-ports: if set, a regular expression of JACK client port name(s) = to # monitor for and automatically connect to # # @start-server: start a jack server process if one is not already present # (default: false) # # @exact-name: use the exact name requested otherwise JACK automatically # generates a unique one, if needed (default: false) # # Since: 5.1 ## { 'struct': 'AudiodevJackPerDirectionOptions', 'base': 'AudiodevPerDirectionOptions', 'data': { '*server-name': 'str', '*client-name': 'str', '*connect-ports': 'str', '*start-server': 'bool', '*exact-name': 'bool' } } I agree with you that it would be more user friendly to auto connect QEMU's output ports to system:playback_1, system:playback_2 and QEMU's input ports to system:capture_1, system:capture_2 respectively if the user did not specify any argument for "connect-ports". However I think your patch is a bit too simple, i.e. it is more or less luck that the system ports end up as the first two members in the lookup array "ports". It is working right now, but there is no guarantee about the order of the ports returned by jack_get_ports(): https://jackaudio.org/api/group__PortSearching.html So I would suggest changing your patch a bit by passing a lookup pattern like "system:playback_.*" to jack_get_ports() for QEMU output ports and a pattern like "system:capture_.*" for QEMU input ports, if c->opt->connect_ports is empty that is. Would you try to send a patch like this? And if yes, would you mind sending your patch directly to the qemu-devel mailing list? That would allow us to merge your patch more efficiently & quickly. https://wiki.qemu.org/Contribute/SubmitAPatch -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1908832 Title: jack audio dev produces no sound Status in QEMU: New Bug description: Hi, I'm testing the new jack audiodev backend in my laptop. The host system is gentoo, using the ebuild for qemu 5.1.0-r2, and I'm using jack use flag globally in the system so any ebuild that have support for jack should be build with it. The jack setup reportedly works as I use it with firefox, and mumble with no trouble. When I launch the following script, I see the vm connects to jack: /usr/bin/qemu-system-x86_64 -enable-kvm -M q35 -vga virtio -display gtk,g= l=3Don \ -cpu host -smp 2,cores=3D2,threads=3D1 \ -m 4G -L /usr/share/qemu \ -global ICH9-LPC.disable_s3=3D1 -global ICH9-LPC.disable_s4=3D1 \ -drive file=3D/usr/share/edk2-ovmf/OVMF_CODE.fd,if=3Dpflash,forma= t=3Draw,unit=3D0,readonly=3Don \ -drive file=3Ddebian_VARS.fd,if=3Dpflash,format=3Draw,unit=3D1 \ -audiodev id=3Djack,driver=3Djack -device ich9-intel-hda -device = hda-duplex,audiodev=3Djack \ -device virtio-serial-pci \ -device virtserialport,chardev=3Dspicechannel0,name=3Dcom.redhat.= spice.0 \ -chardev spicevmc,id=3Dspicechannel0,name=3Dvdagent \ -device nec-usb-xhci,id=3Dusb \ -device usb-host,vendorid=3D0x04ca,productid=3D0x708e \ -device usb-host,vendorid=3D0x1050,productid=3D0x0407 \ -chardev spicevmc,name=3Dusbredir,id=3Dusbredirchardev1 \ -device usb-redir,chardev=3Dusbredirchardev1,id=3Dusbredirdev1 \ -chardev spicevmc,name=3Dusbredir,id=3Dusbredirchardev2 \ -device usb-redir,chardev=3Dusbredirchardev2,id=3Dusbredirdev2 \ -chardev spicevmc,name=3Dusbredir,id=3Dusbredirchardev3 \ -device usb-redir,chardev=3Dusbredirchardev3,id=3Dusbredirdev3 \ -netdev user,id=3Duser.0 -device virtio-net-pci,netdev=3Duser.0 \ -drive file=3Ddebian.qcow2,cache=3Dnone,aio=3Dio_uring,if=3Dvirtio Output of vm initialization: jack: JACK output configured for 48000Hz (1024 samples) jack: JACK input configured for 48000Hz (1024 samples) gl_version 46 - core profile enabled GLSL feature level 430 Though executing any application that uses sound, for instance, any youtube video through browser, I listen nothing. By executing pkill jackd, and launching the same script replacing the audiodev line for the following: -audiodev id=3Dalsa,driver=3Dalsa -device ich9-intel-hda -device hda-duplex,audiodev=3Dalsa \ The audio works, and I can listen to music, or any other kind of application, though I cannot listen anything else in the host. The guest is a simple debian testing(bullseye) system with plasma desktop, using pulseaudio, nothing fancy. Thanks! Jos=C3=A9 To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1908832/+subscriptions