Utilities icon indicating copy to clipboard operation
Utilities copied to clipboard

Volume: Allow to select different devices for playback and recording

Open probonopd opened this issue 4 years ago • 7 comments

Allow to select different devices for playback and recording.

Use case: Input = Guitar device, Output = Speaker. Is this even possible on FreeBSD with stock OSS? How?

Reference: https://github.com/helloSystem/hello/issues/172#issuecomment-862579613

cc @darkoverlordofdata and @ILoveGadgets

probonopd avatar Jun 16 '21 18:06 probonopd

I don't know yet whether it is possible to set this as the default for all applicatiions.

But at least some applications allow to do this inside the application. Here is Audacity for example:

image

In this example, I have attached two USB sound devices, which show up as pcm3 and pcm4 in Applications -> Preferences -> Sound -> File -> Settings. (I wish Audacity was using "speaking names" from cat /dev/sndstat instead of /dev/pcmX.)

In Audacity, I have selected /dev/dsp3 for recording and /dev/dsp4 for playback.

probonopd avatar Jun 16 '21 21:06 probonopd

Should this not be sufficient, we need to consider using virtual_oss (advanced) as described at https://wiki.freebsd.org/Sound.

probonopd avatar Jun 16 '21 21:06 probonopd

More useful information about sound in FreeBSD including "real time" (low latency) and jitter is available at https://archive.fosdem.org/2019/schedule/event/freebsd_in_audio_studio/ by @mekanix.

probonopd avatar Jun 16 '21 22:06 probonopd

Thanks, I'll read thru this. I've never used audacity before, maybe it will help me to understand what settings are needed.

On Wed, Jun 16, 2021 at 6:10 PM probonopd @.***> wrote:

More useful information about sound in FreeBSD including "real time" (low latency) is available at https://archive.fosdem.org/2019/schedule/event/freebsd_in_audio_studio/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/helloSystem/Utilities/issues/71#issuecomment-862763358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJUE4QN3FBTTRXB64ITLPDTTEOO5ANCNFSM46Z7BL4A .

--

Bruce Davidson

darkoverlordofdata avatar Jun 16 '21 22:06 darkoverlordofdata

Maybe you'll find https://meka.rs/blog/2017/01/25/sing-beastie-sing/ to be more informative, but do ignore the virtual_oss part as it is outdated (since that blog post I sent PR for virtual_oss to have a rc.d service, for example). The virtual_oss options are the same in case you need them, but starting it is way easier and flexible now.

Also, you might consider having virtual_oss by default, as it can create one /dev/dsp and use one device for recording and the other for playback. All of this can be changed in runtime (no need for service virtual_oss restart) via virtual_oss_cmd, so it might be useful to wide range of people (eg. having bluetooth headphones and USB microphone). Anyway, if I can help, do ping me.

mekanix avatar Jun 16 '21 22:06 mekanix

As far as I'm aware, FreeBSD's stock sound system can only remember a default audio device/soundcard using the "hw.snd.default_unit" system property. I'm pretty sure that sndio and sndiod would be able to handle this? Or is something built-in like virtual_oss preferred?

CodeforEvolution avatar Jun 21 '21 17:06 CodeforEvolution

I don't know much about virtual_oss (other than it was recommended to me), and nothing about sndio and sndiod. So anything that does the job would be good, and the more "stock FreeBSD" and the less additional dependencies and complexity, the better.

probonopd avatar Jun 21 '21 18:06 probonopd