aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mixer
Commit message (Collapse)AuthorAgeFilesLines
* Revert "mixer(8): Implement hot-swapping"Christos Margiolis2026-03-032-145/+11
| | | | | | | | | | | We now have devd rules in snd.conf that achieve this in a much cleaner way. This reverts commit 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55532
* mixer/tests: use require.kmods property instead of ad-hoc checksSiva Mahadevan2026-02-122-13/+2
| | | | | | | | Reviewed by: christos Approved by: lwhsu (mentor) Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D55221
* mixer(8): Update FILES sectionChristos Margiolis2025-11-061-26/+18
| | | | | | | | | While here, change "N" to "X" to match sndctl.8's notation. Sponsored by: The FreeBSD Foundation MFC after: 4 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53503
* packages: Add a sound packageLexi Winter2025-10-021-0/+2
| | | | | | | | | | | | | | | Put virtual_oss, /etc/devd/snd.conf and the other audio-related tools into a new "sound" package. Don't create a separate -lib package, since it's unlikely someone will want mixer(3) without mixer(8). Put the sound package in the optional set rather than minimal, since it's not actually required for audio hardware support, and many systems (including nearly all servers) won't want it installed. MFC after: 3 seconds Reviewed by: christos Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52823
* mixer(8): Update virtual_oss pathChristos Margiolis2025-09-281-1/+1
| | | | | | | | | virtual_oss is part of base as of 9cab9fde5eda ("virtual_oss: Port to base"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52322
* mixer: Fix a bogus free() call in the main loopMark Johnston2024-10-231-2/+4
| | | | | | | | | | After a strsep() call, p might not point at the original allocation anymore. Reported by: CHERI Reviewed by: christos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47266
* mixer tests: SerializeMark Johnston2024-09-091-0/+3
| | | | | These tests modify attributes of a global mixer device, and aren't prepared to run in parallel.
* mixer(8) tests: Fix cleanup routineOlivier Cochard-Labbé2024-08-301-1/+2
| | | | | | | | | | The tests correctly skip if no snd_dummy neither mixer is found, but the cleanup is still called with the skip condition, which fails if there is no mixer. MFC after: 2 days Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D46491
* mixer(8): Implement hot-swappingChristos Margiolis2024-08-242-11/+145
| | | | | | | | | | | | Introduce a -V option, which can be used alongside -d (default unit change), in order to hot-swap devices (i.e switch to them on the fly without needing to restart the track), in case virtual_oss(8) exists and is running. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46253
* mixer(8): Add testsChristos Margiolis2024-07-273-0/+291
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45974
* mixer(8): Make mute and recsrc argument parsing more robustChristos Margiolis2024-07-271-7/+14
| | | | | | | | | | | | For the deprecated argument interfaces of the mute (1, 0, ^) and recsrc (+, -, =, ^) controls, we only check the first character of the argument, which means that an argument such as "vol.mute=10" would be valid. Fix this by checking the whole argument string. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45973
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* mixer(8): Use mixer_get_path()Christos Margiolis2024-05-231-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45276
* mixer(8): Ignore mixer_open() failures for the -a optionChristos Margiolis2024-05-231-1/+1
| | | | | | | | | | | | | The most likely reason mixer_open() will fail is because either the device doesn't exist, or because it is disabled, so there is not reason to kill the application. Instead, continue and print the rest of the enabled mixers. PR: 277615 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45151
* mixer(8): Use new mixer if we change the default unitChristos Margiolis2024-02-121-2/+15
| | | | | | | | | | | If we use the -d option to change the default unit, close the current mixer and open the one we set as the default to avoid printing and applying changes (if any) to the old one. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D43809
* mixer(8): Improve mute and recsrc controlsChristos Margiolis2024-02-122-43/+42
| | | | | | | | | | | | | | | | | | | | | | | | The input options of "dev.mute" (+, -, ^) and "dev.recsrc" (+, -, ^, =) are quite cryptic. Allow the input to also be an actual description of what these options do. + -> add (recsrc) - -> remove (recsrc) ^ -> toggle (recsrc, mute) = -> set (recsrc) 0 -> off (mute) 1 -> on (mute) Also, deprecate the use of the symbol options in the EXAMPLES section of the man page, by using the new descriptive options. In the future, we might want to get rid of the symbol options altogether, but preserve backwards compatibility for now. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, imp Differential Revision: https://reviews.freebsd.org/D43796
* mixer.8: Fix wrong sentenceChristos Margiolis2024-02-121-3/+3
| | | | | | | | | | | | | | | | 246e0457d93071ffd901c78e3ee7badc5f51bd4c ("mixer.8: Add terse example for increasing volume") mentions that the example changes the volume of the "first mixer found", while the example shows how the change the volume of the current mixer's "vol" device. Re-phrease sentence to reflect the actual behavior of the command. Also, improve the example by using the % operator, instead of hardcoding 0.05. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D43795
* mixer(8): Allow full PCM device names as input for the -d optionChristos Margiolis2024-02-122-11/+18
| | | | | | | | | | | | | | The -d option is a wrapper around hw.snd.default_unit. Currently mixer(8) expects the option argument to be just the unit's number (e.g pcm0 -> 0). To avoid confusion, allow full device names of the form "pcmN" as well. While here, improve the -d option's description in the man page. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, imp Differential Revision: https://reviews.freebsd.org/D43794
* mixer(8): Improve error messsages and warningsChristos Margiolis2024-02-121-6/+7
| | | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: dev_submerge.ch, imp Differential Revision: https://reviews.freebsd.org/D43793
* mixer.8: Add terse example for increasing volumeAlexander Ziaee2024-01-121-1/+8
| | | | | Reviewed by: jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1044
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* mixer: Fix default_unit switching with mixers that have no devicesMark Johnston2023-01-161-14/+5
| | | | | | | | | | | | | | | | | | | | | Apparently it's possible for a mixer to have no devices: $ mixer -f /dev/mixer2 pcm2:mixer: <USB audio> at ? kld snd_uaudio (rec) $ If this is the default sound device, an attempt to change the default unit using mixer -d fails with a segfault because mod_dunit is called with a NULL device pointer, which is dereferenced to get the parent mixer. ctl_dunit seems to be a dummy, i.e., we don't actually need it and can simply pass the mixer to mod_dunit() directly. This patch removes that structure and associated indirection to fix the crash. Reviewed by: christos, hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38060
* mixer: remove volume backwards compat, add % interpretationKyle Evans2022-06-182-15/+27
| | | | | | | | | | | | | | | | The current situation is fairly confusing, where an integer is interpreted as a percent until you slap a decimal on it and magically it becomes an absolute value. Let's have a flag day in 14.0 and remove this shim entirely. Setting with percent can still be useful, so allow a trailing '%' to indicate as such. As a side effect, we tighten down the format allowed in the volume a little bit by ensuring there's no trailing garbage after the value once it's separated into left and right components. Reviewed by: christos, hselasky, pauamma_gundo.com (manpages) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D35101
* mixer.8: Document shorthand syntax for volume setting.Hans Petter Selasky2022-03-201-1/+5
| | | | | | Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D34614 Sponsored by: NVIDIA Networking
* mixer.4 and mixer.8: Fix mandoc -Tlint errors.Hans Petter Selasky2022-03-201-7/+4
| | | | | | Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D34603 Sponsored by: NVIDIA Networking
* mixer(8): Improve shorthand volume parsing.Hans Petter Selasky2022-03-201-14/+30
| | | | | | | | | | | | The initial patch had a bug where the full volume syntax, floating point values, :, + and -, wasn't accepted. While at it move some defines to enum's. Fixes: da3d4469ef841be44ac4b346a6b51668d608ed49 Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D34617 Sponsored by: NVIDIA Networking
* mixer(8): Add shorthand syntax for setting the volume.Hans Petter Selasky2022-03-201-10/+18
| | | | | | | | | dev.volume=X[.X] can now also be written as dev=X[.X] . Requested by: hselasky@ and bsduck (FreeBSD forums) Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D34612 Sponsored by: NVIDIA Networking
* mixer(8): Remove [.volume] string from default printout.Hans Petter Selasky2022-03-201-6/+2
| | | | | | Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D34591 Sponsored by: NVIDIA Networking
* mixer .8: Clean up the manual pageMateusz Piotrowski2022-03-131-67/+87
| | | | | | | | | | | | | | - Use correct macros (e.g., Pa for paths, Ar for arguments, Cm for command modifiers). - Pet igor and mandoc -Tlint (e.g., start sentences after a newline). - Use Ta instead of a tab character in tables. - Stylize all table headers with Sy consistency. - Add a missing "vol" variant to the synopsis of "dev.volume". - Sort dev.recsrc command modifiers consistency. - Use "Bd -literal" for code blocks in the examples. "Bl -tag" is not the right macro for that. Fixes: 903873ce1560 Implement and use new mixer(3) library for FreeBSD.
* mixer: make .Dt tags uppercaseChristos Margiolis2021-11-201-1/+1
| | | | | | | | The document title should be uppercase in man pages. Reviewed by: imp, gbe MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D33027
* mixer.8: Document -hMateusz Piotrowski2021-10-171-1/+5
|
* mixer(8): Add -h option to show usage.Hans Petter Selasky2021-10-161-2/+4
| | | | | | Differential Revision: https://reviews.freebsd.org/D32508 Submitted by: christos@ Sponsored by: NVIDIA Networking
* mixer(8): Print usage to standard error.Hans Petter Selasky2021-10-151-3/+2
| | | | | | Differential Revision: https://reviews.freebsd.org/D32507 Submitted by: christos@ Sponsored by: NVIDIA Networking
* mixer(8): Fix mixer status line for /dev/dspX.vpY mixer devices.Hans Petter Selasky2021-10-151-3/+11
| | | | | | | | | | In some cases when passing /dev/dspX.vpY as mixer devices, m->ci.longname and m->ci.hw_info will be empty. Don't print any brackets and parentheses in this case. Differential Revision: https://reviews.freebsd.org/D32500 Submitted by: christos@ Sponsored by: NVIDIA Networking
* mixer(3) and mixer(8): Update manual pages.Hans Petter Selasky2021-09-221-3/+3
| | | | | | | | | - Use correct e-mail address. - Set FreeBSD 14.0 as introduction for the updated mixer(8) utility. Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D31636 Sponsored by: NVIDIA Networking
* mixer(8): Compile fix for when the "char" type is unsigned.Hans Petter Selasky2021-09-221-1/+1
| | | | | Differential Revision: https://reviews.freebsd.org/D31636 Sponsored by: NVIDIA Networking
* Implement and use new mixer(3) library for FreeBSD.Hans Petter Selasky2021-09-225-532/+610
| | | | | | | | | Wiki article: https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements This project was part of Google Summer of Code 2021. Submitted by: christos@ Differential Revision: https://reviews.freebsd.org/D31636 Sponsored by: NVIDIA Networking
* mixer: call the cleanup function in a testLuca Pizzamiglio2020-02-061-1/+1
| | | | | | | | | | | | The set_empty_value test has a cleanup function, but is not called. Fix it Reviewed by: 0mp Approved by: kp Differential Revision: https://reviews.freebsd.org/D23498 Notes: svn path=/head/; revision=357619
* mixer(8): Report an error if the passed value is an empty stringMateusz Piotrowski2019-08-254-0/+138
| | | | | | | | | | | | | | | | | This patch fixes a bug that made the mixer command enter an infinite loop when instructed to set the value of a device to an empty string (e.g., `mixer vol ""`). Additionally, some tests for mixer(8) are being added. PR: 240039 Reviewed by: hselasky, mav Approved by: src (hselasky, mav) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21409 Notes: svn path=/head/; revision=351481
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* mixer(8): Prevent possible sscanf() overflow.Pedro F. Giffuni2017-04-291-1/+1
| | | | | | | | | | Fix %s buffer sizes in sscanf(). Obtained from: DragonflyBSD (git dab952e2) MFC after: 5 days Notes: svn path=/head/; revision=317596
* mixer(8): Style: Tag no-return usage() as __dead2Conrad Meyer2016-05-111-2/+2
| | | | | | | | | | | | | | Coverity really should have figured this out from the exit(3) call at the end of the routine, but just make it explicit. No functional change. Reported by: Coverity CID: 1304866 (false positive double-close of 'baz') Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299470
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge head from 7/28Simon J. Gerraty2014-08-191-5/+6
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=270164
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802