Record with a device, playback with another with sndiod

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Record with a device, playback with another with sndiod

David Demelier-2
Hello,

I'm trying to setup sndiod to record input using my laptop's builtin
microphone but using an USB sound card for output.

The microphone does work correctly because I was able to record some
test using aucat

    $ aucat -o test.wav
    $ aucat -i test.wav (worked)

To my understanding the option -m can be used to control either both
playback and recording so I've tried to setup my rsnd/0 (laptop) to only
use recording and my external dock rsnd/1 to only use playback.

    $ sndiod -f rsnd/1 -s default -m play -F rsnd/1 -f rsnd/0 -m rec

The playback works correctly on the USB dock but plain `aucat -o` won't
record from the laptop's microphone. However, `aucat -f rsnd/0 -o
test.wav` works but since Firefox won't let me choose a specific input
device I'm stuck...

Do I miss something or it's simply not possible to create this "virtual"
unique device that consist of input from a card and output to another
one?

Regards,

--
David

Reply | Threaded
Open this post in threaded view
|

Re: Record with a device, playback with another with sndiod

Alexandre Ratchov-2
On Sat, Mar 14, 2020 at 09:10:19AM +0100, David Demelier wrote:

> Hello,
>
> I'm trying to setup sndiod to record input using my laptop's builtin
> microphone but using an USB sound card for output.
>
> The microphone does work correctly because I was able to record some
> test using aucat
>
>     $ aucat -o test.wav
>     $ aucat -i test.wav (worked)
>
> To my understanding the option -m can be used to control either both
> playback and recording so I've tried to setup my rsnd/0 (laptop) to only
> use recording and my external dock rsnd/1 to only use playback.
>
>     $ sndiod -f rsnd/1 -s default -m play -F rsnd/1 -f rsnd/0 -m rec
>
> The playback works correctly on the USB dock but plain `aucat -o` won't
> record from the laptop's microphone. However, `aucat -f rsnd/0 -o
> test.wav` works but since Firefox won't let me choose a specific input
> device I'm stuck...
>
> Do I miss something or it's simply not possible to create this "virtual"
> unique device that consist of input from a card and output to another
> one?

Hi,

Sorry, it's not possible to combine two devices into a single one with
sndiod.

FWIW, this is because both devices don't use the same clock source, if
there were combined, audio could be unstable. Properly synchronizing
them is difficult and given the price and availability of full-duplex
hardware it is not worth the risk of making audio unreliable.

I guess you're asking because the USB dock has no microphone, right?

Reply | Threaded
Open this post in threaded view
|

Re: Record with a device, playback with another with sndiod

David Demelier-2
On Mon, Mar 16, 2020 at 02:41:20PM +0100, Alexandre Ratchov wrote:

Hello,

> Sorry, it's not possible to combine two devices into a single one with
> sndiod.
>
> FWIW, this is because both devices don't use the same clock source, if
> there were combined, audio could be unstable. Properly synchronizing
> them is difficult and given the price and availability of full-duplex
> hardware it is not worth the risk of making audio unreliable.

Thanks for the explanation, since I've not found many information about
that issue I was expecting that it was not possible.

> I guess you're asking because the USB dock has no microphone, right?

It has only one jack yes, but the logo on top of the jack is a headset
with a microphone but I don't even know if combined output/microphone
jacks are supported? I never experienced them at all, I don't have a
headset that has microphone with a single jack to test anyway.

Regards,

--
David

Reply | Threaded
Open this post in threaded view
|

Re: Record with a device, playback with another with sndiod

David Demelier-2
On Mon, Mar 16, 2020 at 10:09:50PM +0100, David Demelier wrote:
> It has only one jack yes, but the logo on top of the jack is a headset
> with a microphone but I don't even know if combined output/microphone
> jacks are supported? I never experienced them at all, I don't have a
> headset that has microphone with a single jack to test anyway.

I finally realized that I actually have a combined headset (one
shipped with my phone) and yes the dock can record/playback at the same
time in this unique jack, awesome!

Case closed :).

Regards,

--
David