Hi Edd,

* Edd Barrett wrote:
> Hi,
> 
> Currently sndiod does not allow you to use alternative devices (-F
> devices) which support only a subset of the modes of the main (-f)
> device.
> 
> For example, if you do `sndiod -f rsnd/0 -F rsnd/1` and:
>  - rsnd/0 is full-duplex (rec + play).
>  - rsnd/1 is play-only.
> 
> Then you will be unable to use rsnd/1 as sndiod deems is incompatible
> and refuses to use it (similarly if rsnd/1 is record-only).

I am having exactly such a setup here. rsnd/0 is the internal speaker of
my Thinkpad T450s and rsnd/1 is a speaker connected via a Bluetooth
dongle.

> This is annoying. It means if you want to use a record-only or play-only
> device, you will either have to kill sndiod and restart it specifying
> only that device (`sndiod -f rsnd/1` for the above example), or failing
> that, downgrade the functionality of the main device (`-m play`).
> 
> This diff (a joint effort between ratchov@ and myself) makes mixing
> devices with different modes possible. It does this by making both
> recording and playing available for all devices, even if the underlying
> hardware doesn't support both modes.
> 
> For example, if I try to record from a play-only device, then recording
> will succeed, but the captured PCM data will be pure silence. Similarly,
> if I try to play to a record-only device, then the audio stream will
> disappear into the ether.
> 
> This is mostly a no-op for sndiod in the default configuration (except
> that play-only devices now accept recording clients). If you use
> alternative devices (-F), then it's possible for a record-only device to
> be found first, which may be confusing if you just want to hear sound.
> We can only assume that if you deviate from defaults, then you know what
> you are doing.
> 
> Please test and let us know if it works for you.

Works fine here and way better than before.  Switching from internal to
the external speakers was kind of a hassle and often ended up in me
restarting sndiod.  With the patch, switching worked as one would expect
it.

Cheers

        Matthias

Reply via email to