aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/sound
Commit message (Collapse)AuthorAgeFilesLines
* sound tests: Actually fix format stringsDag-Erling Smørgrav2025-11-111-2/+3
| | | | Fixes: eb95b990f8eb ("sound tests: Fix format specified for kevent.data")
* sound tests: Fix format specified for kevent.dataChristos Margiolis2025-11-111-2/+2
| | | | | | | Reported by: CI Fixes: dd81b19ef236 ("sound tests: Test polling") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound tests: Fix select(2) argumentsChristos Margiolis2025-11-111-1/+1
| | | | | | Fixes: dd81b19ef236 ("sound tests: Test polling") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound tests: Test pollingChristos Margiolis2025-11-112-0/+205
| | | | | | | | Co-authored by: meka@tilda.center Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53188
* tests/sndstat: use require.kmods property instead of ad-hoc checksSiva Mahadevan2025-09-051-11/+2
| | | | | | | Signed-off-by: Siva Mahadevan <me@svmhdvn.name> Sponsored by: The FreeBSD Foundation Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1780
* sound tests: Fetch HWBUF_RATE and SWBUF_RATE in sndstat_nvChristos Margiolis2025-04-261-0/+2
| | | | | | | | Introduced in 19ec522d6dc1 ("sound: Export hardware and software buffer sample rate in sndstat nvlist"). Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound tests: Fix PVCHAN and RVCHAN fetching in sndstat_nvChristos Margiolis2025-04-261-2/+2
| | | | | | | Fixes: 0c0bb4c1401c ("sound: Make sndstat PVCHAN and RVCHAN nvlist parameters bool") Reported by: CI Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Implement AFMT_FLOAT supportChristos Margiolis2025-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though the OSS manual [1] advises against using AFMT_FLOAT, there are applications that expect the sound driver to support it, and might not work properly without it. This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE <-> AFMT_S32_LE|BE conversion functions. As a result, applications can write/read floats to/from sound(4), but internally, because sound(4) works with integers, we convert floating point samples to integer ones, before doing any processing. The reason for encoding/decoding IEEE754s manually, instead of using fpu_kern(9), is that fpu_kern(9) is not supported by all architectures, and also introduces significant overhead. The IEEE754 encoding/decoding implementation has been written by Ariff Abdullah [2]. [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html [2] https://people.freebsd.org/~ariff/utils/ieee754.c PR: 157050, 184380, 264973, 280612, 281390 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47638
* sound: Refactor the format conversion frameworkChristos Margiolis2025-03-101-272/+6
| | | | | | | | | | | | | | | | | Merge the PCM_READ|WRITE_* macros defined in pcm/pcm.h, as well as the intpcm_read|write_* macros defined in pcm/feeder_format.c, into six inline functions: pcm_sample_read|write[_norm|calc](). The absence of macro magic makes the code significantly easier to read, use and modify. Since these functions take the input/output format as a parameter, get rid of the read() and write() function pointers defined in struct feed_format_info, as well as the feeder_format_read|write_op() functions, and use the new read/write functions directly. Sponsored by: The FreeBSD Fondation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47932
* sound tests: Fix downshift calculation in pcm_read_write testFlorian Walpen2025-02-181-4/+11
| | | | | | | | | | | | | | | In some situations the feeders in the sound module lower the pcm sample resolution through a downshift of the sample value. The pcm_read_write test implements this operation with an arithmetic division to avoid implementation defined or architecture specific behavior. Due to different rounding, the test produced marginally different sample values, which made the test fail on 32 bit architectures. Correct this. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos, markj Differential revision: https://reviews.freebsd.org/D48926
* sound tests: Fix 32bit calculation detection in pcm_read_writeFlorian Walpen2025-01-231-3/+9
| | | | | | | | | | | | | Fix a mistake in the pcm_read_write test that would result in not properly detecting 32bit calculation on 32bit architectures like i386. As a consequence, the wrong values would be checked, thus failing the test. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D48617
* sound tests: Fix gcc buildChristos Margiolis2025-01-221-2/+2
| | | | | | | | | | | | /workspace/src/tests/sys/sound/pcm_read_write.c:36:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] 36 | } static const afmt_tests[] = { | ^ Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Unit test the pcm sample read and write macrosFlorian Walpen2025-01-212-0/+513
| | | | | | | | | | | | | | | | Main goal is to have a unit test, with sample test data that is verified against the current macro implementation of pcm sample read and write functions. With a test in place, we can proceed on a planned refactoring of the sample read and write code, and confidently check the new code for regressions. Implementation of the unit test itself has to avoid any cast or conversion affected by endianness, to make the tests compatible with all machine architectures. MFC after: 1 week Reviewed by: christos, markj Differential Revision: https://reviews.freebsd.org/D48330
* sound tests: Add SNDSTIOC_ADD_USER_DEVS testChristos Margiolis2024-08-241-4/+183
| | | | | | | | | | Test whether the SNDSTIOC_ADD_USER_DEVS IOCTL (registers a userland device to /dev/sndstat) works properly. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46228
* sound tests: Add sndstat nvlist ATF testChristos Margiolis2024-07-272-0/+223
Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45901