On 2020/11/17 17:13, Peter J. Philipp wrote:
> Hi,
>
> I have a mic on snd/1 and speakers on snd/0. I had tried a lot of different
> settings with audacity port but couldn't get this to work, so I chose the
> method of last resort. Below is a patch to allow an AUDIORECDEVICE
> environment
> variable specifying the wanted microphone.
This seems a worthwhile addition.
> Index: sio.c
> ===================================================================
> RCS file: /cvs/src/lib/libsndio/sio.c,v
> retrieving revision 1.24
> diff -u -p -u -r1.24 sio.c
> --- sio.c 29 Jun 2019 06:05:26 -0000 1.24
> +++ sio.c 17 Nov 2020 16:13:04 -0000
> @@ -43,6 +43,7 @@ sio_open(const char *str, unsigned int m
> {
> static char devany[] = SIO_DEVANY;
> struct sio_hdl *hdl;
> + char *rec = NULL;
>
> #ifdef DEBUG
> _sndio_debug_init();
> @@ -55,6 +56,12 @@ sio_open(const char *str, unsigned int m
> str = getenv("AUDIODEVICE");
> if (str == NULL)
> str = devany;
> + rec = getenv("AUDIORECDEVICE");
> + if (rec == NULL)
> + rec = devany;
> +
> + if (rec && mode == SIO_REC)
> + str = rec;
If AUDIORECDEVICE is unset, it would be better to fallback to
AUDIODEVICE rather than directly to devany.