From nobody Mon Oct 4 11:02:23 2021 X-Original-To: freebsd-multimedia@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B75E017A9823 for ; Mon, 4 Oct 2021 11:02:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNHqd4HlRz4YxG for ; Mon, 4 Oct 2021 11:02:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 09CE92604DC; Mon, 4 Oct 2021 13:02:35 +0200 (CEST) Subject: Re: tee-like function via virtual_oss To: J P , freebsd-multimedia@freebsd.org References: <03103736-8052-5901-b5bf-288a313af874@selasky.org> <8ff167fe-51e7-2239-2fa6-69a935a5dc11@selasky.org> From: Hans Petter Selasky Message-ID: <71e67a7e-978f-c70b-8d33-848bb41111cb@selasky.org> Date: Mon, 4 Oct 2021 13:02:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Multimedia discussions List-Archive: https://lists.freebsd.org/archives/freebsd-multimedia List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-multimedia@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HNHqd4HlRz4YxG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, On 10/4/21 12:38 PM, J P wrote: > Thank you for your email. > > I think the use-case I am facing is different: the player is using > /dev/dsp0.something, I have no control over it. And there is no environment variable to override this either? Did you try: strings `which mymusicplayer` One hackish way to get what you want is to: sysctl hw.snd.basename_clone=1 rm /dev/dsp0 touch /dev/dsp0.9 sysctl hw.snd.basename_clone=0 And create "dsp0" as a virtual_oss instance, routing all virtual_oss output to /dev/dsp0.9 instead. > Furthermore, since I installed virtual_oss all the audio devices have gone > from PulseAudio, which is a little odd. On top of this, /dev/ is being > populated with a lot of /dev/dsp0.x (now I have 14) and the number grows > the more I use audio. This may indicate a file descriptor leak in your music player. OSSv4 has some limits how many FDs can be opened at the same time. You should check using ktrace, that it really closes this device. > > Can my goal be achieved with virtual_oss or would you suggest some other > tool? See top the the e-mail. --HPS