Page MenuHomeFreeBSD

sound: Remove unused dsp_cdevs[] fields and devices
ClosedPublic

Authored by christos on Apr 29 2024, 4:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 18 2024, 3:07 AM
Unknown Object (File)
Sep 17 2024, 1:50 PM
Unknown Object (File)
Sep 16 2024, 10:54 PM
Unknown Object (File)
Sep 13 2024, 11:28 PM
Unknown Object (File)
Sep 8 2024, 4:43 AM
Unknown Object (File)
Sep 7 2024, 2:45 PM
Unknown Object (File)
Sep 7 2024, 11:10 AM
Unknown Object (File)
Sep 4 2024, 11:59 PM
Subscribers

Details

Summary

These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)").

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57587
Build 54475: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Apr 30 2024, 12:06 AM

how does e.g. /dev/dspW map to 16-bit now?

how does e.g. /dev/dspW map to 16-bit now?

It doesn't since e8c0d15a64fa, and in fact, I just realized that accessing them doesn't work, as is expected. What we can do is:

  1. Make them /dev/dsp aliases, like the OSS-compat devices.
  2. Remove them.

I am more inclined to do the former, just in case there's a program that uses /dev/dspW, /dev/audio or /dev/dspcd. @dev_submerge.ch what do you think?

how does e.g. /dev/dspW map to 16-bit now?

It doesn't since e8c0d15a64fa, and in fact, I just realized that accessing them doesn't work, as is expected. What we can do is:

  1. Make them /dev/dsp aliases, like the OSS-compat devices.
  2. Remove them.

I am more inclined to do the former, just in case there's a program that uses /dev/dspW, /dev/audio or /dev/dspcd. @dev_submerge.ch what do you think?

I've never seen them used by any application, but I concur to keep the aliases for now. We change a lot of things currently, which will produce already enough bug reports when it hits the RELEASEs.

I don't think there's a lot of value in keeping the aliases, if we don't also keep the behaviour -- i.e., if some application does expect to open /dev/dspW and send 16-bit samples without doing any other configuration it's not going to work as expected.

I don't think there's a lot of value in keeping the aliases, if we don't also keep the behaviour -- i.e., if some application does expect to open /dev/dspW and send 16-bit samples without doing any other configuration it's not going to work as expected.

True, but if we delete them the program will just exit, which I don't know if it's any better. I am not very keen on keeping those aliases either however, so I am open to suggestions.

IMO we should either remove them or restore default formats.

I don't think there's a lot of value in keeping the aliases, if we don't also keep the behaviour -- i.e., if some application does expect to open /dev/dspW and send 16-bit samples without doing any other configuration it's not going to work as expected.

True, but if we delete them the program will just exit, which I don't know if it's any better. I am not very keen on keeping those aliases either however, so I am open to suggestions.

You're right, unless we can preset format and speed defaults for these clones they are not very useful. We have alternatives for people who want to just cat some wave files, e.g. the vchan sysctls or virtual_oss. I think we can remove them, it's not worth the effort.

I don't think there's a lot of value in keeping the aliases, if we don't also keep the behaviour -- i.e., if some application does expect to open /dev/dspW and send 16-bit samples without doing any other configuration it's not going to work as expected.

True, but if we delete them the program will just exit, which I don't know if it's any better. I am not very keen on keeping those aliases either however, so I am open to suggestions.

You're right, unless we can preset format and speed defaults for these clones they are not very useful. We have alternatives for people who want to just cat some wave files, e.g. the vchan sysctls or virtual_oss. I think we can remove them, it's not worth the effort.

No objection. Do you think we should also remove the OSSv4 aliases?

No objection. Do you think we should also remove the OSSv4 aliases?

I would keep them, unless there's a reason not to - these are documented as part of OSSv4. The example scripts there make use of these aliases, maybe it's even possible to run them unchanged (didn't try). And it's still the best (only?) reference for people that want to use our OSS API, even if there's quite some differences.

christos retitled this revision from sound: Remove unused dsp_cdevs[] fields to sound: Remove unused dsp_cdevs[] fields and devices.May 1 2024, 9:59 PM
christos edited the summary of this revision. (Show Details)

Remove /dev/dspW, /dev/audio and /dev/dspcd.

This revision now requires review to proceed.May 1 2024, 10:03 PM

Some of the types (SND_DEV_AUDIO, SND_DEV_DSP16, SND_DEV_DSPHW_CD) in sound.h are unused now, I think. Should we get rid of them or mark them deprecated?

Remove unused SND_DEV_* defines from pcm/sound.h. Convert the list to an enum.

Ok for me except for the style, see inline comment. Having separate pcm devices for AC3, SPDIF etc may not be appropriate, but we should probably find a way to integrate these settings into the mixer or a future user space audioctl tool.

sys/dev/sound/pcm/sound.h
240

I think style(9) would like to see tabs here to align the comments?

This revision is now accepted and ready to land.May 6 2024, 4:37 PM
sys/dev/sound/pcm/sound.h
240

These probably are tabs and it's just Phabricator mis-rendering.

sys/dev/sound/pcm/sound.h
240

Yes, it's just the rendering in Phabricator - another example of tabs in theory vs tabs in practice...