Devices and Streams aren't Send/Sync.
To pass them around, we can create a thread to bind them all to, and expose channel-based control interface over it to allow passing commands to streams and devices.
This does not have to be baked into the device implementation, but can be a separate utility for users to manually use if they need to.
The reason to include it into cpal is it's that non Send/Sync is a very serious limitation, and it should be solved at the library level, since the underlying design limitation also comes from the library level (i.e. it affects everyone).
Devices andStreams aren'tSend/Sync.To pass them around, we can create a thread to bind them all to, and expose channel-based control interface over it to allow passing commands to streams and devices.
This does not have to be baked into the device implementation, but can be a separate utility for users to manually use if they need to.
The reason to include it into
cpalis it's that nonSend/Syncis a very serious limitation, and it should be solved at the library level, since the underlying design limitation also comes from the library level (i.e. it affects everyone).