On Tue, Oct 25, 2022 at 10:25:30PM +0000, Klemens Nanni wrote:
> The property bits of audio(9) are obsolete and ought to be removed
> completely.
> 
> sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
> read *and* write was requested on a driver non-duplex driver.
> 
> Drivers that currently support playing but not recording need a little
> adjustment for this.
> 
> Drivers that advertise themselves as full duplex, i.e. those that
> always return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props()
> currently always succeed this check.
> 
> As this is the only property, we can losen audio_open()'s DIAGNOSTIC
> check to make get_props() optional and then only do the duplex check if
> the driver provides this function.
> 
> This allows us to simply remove get_props() from full-duplex drivers
> without adding any other code and without changing functionality.
> 
> This includes all audio drivers under sys/dev/pci/ (the unfinished
> maestro(4) being the only exception here).
> 
> Remaining drivers needing adjustment can then be dealt with later;
> after this, the actual removal from the API can be done.
> 
> This builds on amd64, arm64, i386, macppc and sparc64.
> amd64 with azalia(4) still plays, records as well as plays and records
> at the same time on my X230 as tested with
> 
>       $ aucat -i play.wav [-o rec.wav]
> 
> I can't build-test luna88k, alpha or hppa, but the mechanical removal
> should be identical to what works on the above mentioned architectures.
> 
> Feedback? Objection? OK?

looks fine, ok ratchov

Reply via email to