Commit graph

1674 commits

Author SHA1 Message Date
Florian Walpen
f0a3d2341d sound(4): Fix memory map of /dev/dsp devices when buffer size is not a multiple of PAGE_SIZE.
By using sndbuf_getallocsize() instead of sndbuf_getsize() in dsp_mmap_single().

PR:		267555
Sponsored by:	NVIDIA Networking

(cherry picked from commit ad370f7658)
2022-11-12 13:00:01 +01:00
Alexander Motin
7e53019b06 Add random VMware device IDs.
Just to make dmesg look nicer there.

MFC after:	1 week

(cherry picked from commit 2a31a06bf1)
2022-10-26 22:48:56 -04:00
Warner Losh
79ef6bcd78 hdspe_dmapsetmap: eliminate write only variable sc
Sponsored by:		Netflix

(cherry picked from commit ad1b7fd714)
2022-10-01 22:25:55 -06:00
Warner Losh
5d6c09f869 hdaa_eld_dump: eliminate write only variable len
Sponsored by:		Netflix

(cherry picked from commit 557627dda9)
2022-10-01 22:25:55 -06:00
Warner Losh
b6e4f5ef2b emu10kx: eliminate write only variables val, r and move i to loop
Sponsored by:		Netflix

(cherry picked from commit 8717135d37)
2022-10-01 22:25:55 -06:00
Warner Losh
30711541ba emu10kx-pci: eliminate write only variable r
Sponsored by:		Netflix

(cherry picked from commit 451f54707a)
2022-10-01 22:25:55 -06:00
Warner Losh
62ec1f05fa emu_midi_probe: eliminate write only variable r
Sponsored by:		Netflix

(cherry picked from commit 7387abd342)
2022-10-01 22:25:54 -06:00
Warner Losh
eaa861ec10 pcmcsa_attach: eliminate write only variable unit
Sponsored by:		Netflix

(cherry picked from commit 33985865b2)
2022-10-01 22:25:54 -06:00
Warner Losh
36ae1e15b0 midicsa_attach: eliminate write only variable func
Sponsored by:		Netflix

(cherry picked from commit 3e423419cf)
2022-10-01 22:25:54 -06:00
Warner Losh
60911eda78 cs4281: eliminate write only variable codecno
Sponsored by:		Netflix

(cherry picked from commit 0c64fe0068)
2022-10-01 22:25:54 -06:00
Warner Losh
753b13c643 sb_probe: eliminate write only variable r
Sponsored by:		Netflix

(cherry picked from commit 635a4068d2)
2022-10-01 22:25:54 -06:00
Warner Losh
6b31f08b47 sb16_probe: eliminate write only variable r
Sponsored by:		Netflix

(cherry picked from commit 668986eae9)
2022-10-01 22:25:54 -06:00
Warner Losh
c74f4936fb ess_probe: eliminate write only variable r
Sponsored by:		Netflix

(cherry picked from commit 3a7365acc8)
2022-10-01 22:25:54 -06:00
Pavel Timofeev
04c146afea hda: add patch for Framework laptop v2 headphone jack
Fix headphone (12th gen Intel laptops) and mic jack (both 11th and
12th gen) switching.

PR:		262579
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36354

(cherry picked from commit d88dc1b0b9)
2022-09-19 20:45:40 -04:00
Neel Chauhan
58d0f00f15 snd_hda: Remove duplicate erroneous HDA_INTEL_ALLKPS line
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D36483

(cherry picked from commit c4e591c9ab)
2022-09-09 18:07:32 -07:00
Neel Chauhan
08c0674622 snd_hda: Add the full Intel AlderLake HD Audio PCI IDs
This is based off the Linux file sound/hda/intel-dsp-config.c.

Reviewed by:		imp (src)
Tested on:		HP Spectre x360 16-f0023dx
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D36476

(cherry picked from commit 22ecfc580b)
2022-09-09 18:07:20 -07:00
Gordon Bergling
c09b9ae468 sound(4): Fix a typo in asource code comment
- s/overriden/overridden/

(cherry picked from commit ac34f366cc)
2022-09-06 07:38:41 +02:00
Gordon Bergling
a9d1abf00e sound(4): Fix a typo in a source code comment
- s/alltogether/altogether/

(cherry picked from commit 70311ccffc)
2022-06-10 14:28:55 +02:00
John Baldwin
aee33ff467 pcm: Remove dead code from sound_modevent.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34997

(cherry picked from commit 8109ec9d89)
2022-05-19 14:32:56 -07:00
Ed Maste
d7620b6ec9 Add deprecation notices to ISA sound cards
ISA sound cards (and ISA itself) are long obsolete.  NYCBUG dmesgd has
no entries for any of these devices after 2005.

Mail to -current and -stable revealed some nostalgic interest, but
no offers to test or requests to pospone the deprecation.

Add deprecation notices to device attach routines and man pages for:

snd_ad1816  Analog Devices AD1816 SoundPort
snd_ess     Ensoniq ESS
snd_gusc    Gravis UltraSound (MAX and newer AFAIK)
snd_mss     Microsoft Sound System
snd_sbc     Creative Sound Blaster

Reviewed by:	cy, mav
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34604

(cherry picked from commit e39ec8933b)
2022-05-16 09:51:23 -04:00
Gordon Bergling
46516b828b sound(4): Fix a typo in a source code comment
- s/Miscellanious/Miscellaneous/

(cherry picked from commit 35fbe62477)
2022-04-14 08:05:30 +02:00
Gordon Bergling
9ea1c20612 snd_csa(4): Fix a few common typos in source code comments
- s/hander/handler/

(cherry picked from commit dc8d33b368)
2022-04-09 08:10:52 +02:00
Gordon Bergling
4ff689d001 sound(4): Fix a typo in a source code comment
- s/immediatly/immediately/

(cherry picked from commit 24498b53ef)
2022-04-09 08:06:52 +02:00
Gordon Bergling
495754d823 sound(4): Fix a typo in a source code comment
- s/exisitng/existing/

(cherry picked from commit 0ce9617620)
2022-04-09 08:05:12 +02:00
Ed Maste
74f11a40f8 sound: test PCM_REGISTERED before PCM_DETACHING
PCM_REGISTERED(d) tests that d is not NULL, so perform that check first
as we may have cases where devclass_get_softc has a null entry.

PR:		262671
Reviewed by:	hselasky
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34648

(cherry picked from commit da03ac41c9)
2022-03-30 16:43:57 -04:00
Ed Maste
797b8b9c40 Remove snd_aureal driver source
This driver was not finished when it was committed in 1999 and was never
connected to the build.

A version of the driver used to be available in ports as
audio/aureal-kmod, but it has been removed.  It did not build on FreeBSD
10.x or later and the binary objects it required were not available
after Google Code disappeared.

PR:		124343
Reported by:	joel
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ef5dec7cc7)
2022-03-29 21:18:05 -04:00
Mark Johnston
18a3bada30 hdac: Handle interrupts racing with device suspend
- Avoid looping forever if a concurrent reset causes a read of the
  interrupt status register to return all ones.
- Lock the softc before reading the interrupt status, so as to avoid a
  similar infinite loop in hdac_one_intr().

This fixes suspend-to-S3 on some laptops.

PR:		261207
Reviewed by:	mav, imp
Tested by:	uqs
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 077564cfdb)
2022-03-24 10:28:14 -04:00
Ed Maste
ff73087a89 hda: add patch for Framework laptop headphone jack
For Framework laptops built after Oct 2021 (like mine) that have a Tempo
Semiconductor 92HD95B codec rather than Realtek ALC295 (see
https://frame.work/ca/en/blog/solving-for-silicon-shortages).

As we do for many other laptops, put the headphone jack and speakers in
the same association by default so that the generic sound device
automatically switches between them.  Also specify the jack colour and
location.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34596

(cherry picked from commit 06731139ca)
2022-03-24 09:52:38 -04:00
Philippe Michaud-Boudreault
43354d9570 sound: add patch for Lenovo Legion 5 AMD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30333

(cherry picked from commit 45f0e57105)
2022-03-24 09:52:37 -04:00
Ed Maste
5694c481e1 snd_hda: restore pin patch for headphones on Lenovo X1 7th Gen
Fixes:		ef790cc740 ("hdaa: update pin patch configurations")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33900

(cherry picked from commit 301b2b02df)
2022-03-24 09:52:37 -04:00
Xin LI
08dfec6cf2 snd_hda(4): Fix sound on headset jack for ThinkPad T51.
sys/dev/sound/pci/hda/hdaa_patches.c:
 match_pin_patches: Use HDA_DEV_MATCH instead of regular ==

sys/dev/sound/pci/hda/pin_patch_realtek.h:
 Add quirk for Lenovo laptops when ALC298 is used.

(cherry picked from commit c43bf3f591)
2022-03-24 09:52:37 -04:00
K Staring
6228b19e0e hdaa: update pin patch configurations
A number of structural changes:
  - Use decimal nid numbers instead of hex
  - updated the branch to incoorporate the suggestions made in the
    ALC280 pull request github thread
  - Convert magic pin values into strings.
  - Also update hdaa_patches to use clearer enums..
  - made pin patch type enum clearer, add macro for 'string' type
    patches
  - Added pin_patch structures to separate data from logic.
  - Integrated Realtek patches into new structure.

These incorporate fixes for ALC255, ALC256, ALC260, ALC262, ALC268,
ALC269, ALC280, ALC282, ALC283, ALC286, ALC290, ALC293, ALC296, ALC2880

And have definitions for a number of Dell and HP laptops.

Much of this data has been mined fromt he tables in the Linux driver.

imp squashed these into one commit because the changes from the github
pull requests no longer cleanly apply individually and made light style
changes after feedback from jhb.

Pull Request:		https://github.com/freebsd/freebsd-src/pull/139
Pull Request:		https://github.com/freebsd/freebsd-src/pull/140
Pull Request:		https://github.com/freebsd/freebsd-src/pull/141
Pull Request:		https://github.com/freebsd/freebsd-src/pull/142
Pull Request:		https://github.com/freebsd/freebsd-src/pull/143
Pull Request:		https://github.com/freebsd/freebsd-src/pull/144
Pull Request:		https://github.com/freebsd/freebsd-src/pull/145
Pull Request:		https://github.com/freebsd/freebsd-src/pull/146
Pull Request:		https://github.com/freebsd/freebsd-src/pull/147
Pull Request:		https://github.com/freebsd/freebsd-src/pull/148
Pull Request:		https://github.com/freebsd/freebsd-src/pull/149
Pull Request:		https://github.com/freebsd/freebsd-src/pull/150
Differential Revision:	https://reviews.freebsd.org/D30619

(cherry picked from commit ef790cc740)
(cherry picked from commit 29b4fa7876)
(cherry picked from commit a10c85e0f9)
(cherry picked from commit 86d69de88d)
2022-03-24 09:52:37 -04:00
Ed Maste
79902c8c2d Add Tempo Semiconductor 92HD95B HDA codec ID
This codec is found in recent versions of the Framework laptop.  Tempo
Semiconductor acquired these products from IDT's Audio Business Unit.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e997f33700)
2022-03-22 21:27:16 -04:00
Alexander Motin
2dfb21cdd4 snd_hda: Add some ATI HDMI codec IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week

(cherry picked from commit 98d59d2e0d)
2022-02-15 19:46:12 -05:00
Alexander Motin
1b1f80ae1c sound: Remove CTLFLAG_NEEDGIANT from some sysctls.
While there, remove some dead code.

MFC after:	2 weeks

(cherry picked from commit 3b4c543322)
2022-01-09 19:29:59 -05:00
Hans Petter Selasky
457750da86 snd_uaudio(4): Loosen up the USB MIDI permissions.
This makes USB MIDI more userfriendly for desktop users.

PR:		260489
Sponsored by:	NVIDIA Networking

(cherry picked from commit 2fcd7d380b)
2022-01-07 14:23:26 +01:00
Gordon Bergling
56cb816fb7 sound(4): Fix a typo in a source code comment
- s/aggresively/aggressively/

(cherry picked from commit d34632a235)
2021-12-25 11:40:16 +01:00
Hans Petter Selasky
7d95b0f328 snd_uaudio(4): Fix string index computations for iFeature.
This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitted by:	Zhichao1.Li@dell.com
Sponsored by:	NVIDIA Networking

(cherry picked from commit 11f09b17fe)
2021-11-16 09:09:09 +01:00
Alexander Motin
1e5dc6aa18 Add some of Intel Alder Lake device IDs.
MFC after:	1 week

(cherry picked from commit dc238358f9)
2021-11-12 23:02:46 -05:00
Gordon Bergling
113c2e8977 usb_audio: Fix a typo in a source code comment
- s/maxium/maximum/

(cherry picked from commit 3d6ed119e3)
2021-11-11 17:26:19 +01:00
Hans Petter Selasky
1f1aa1aa96 sound(4): Implement mixer mute control for feeder channels.
PR:	258711
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking

(cherry picked from commit 4a83ca1078)
2021-10-12 14:10:59 +02:00
Gordon Bergling
5559896136 pcm(4): Fix a common typo in source code comments
- s/prefered/preferred/

(cherry picked from commit 513ee901ee)
2021-09-29 19:18:55 +02:00
Hans Petter Selasky
1483b121d0 sound(4): Implement playback and recording mode sysctl(8).
The dev.pcm.<N>.mode sysctl(8) gives information if a sound device
supports hardware mixing, playback or recording.

Submitted by:	Christos Margiolis <christos@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D31320
MFC after:	1 week
Sponsored by:	NVIDIA Networking

(cherry picked from commit ed2196e5df)
2021-09-22 14:59:31 +02:00
Hans Petter Selasky
66e91a9ee1 Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s.
These two ioctls are not part of the current version of OSS and were
considered obsolete. However, their behaviour is not the same as their
old one, so this implementation is specific to FreeBSD.

Older OSS versions had the MUTE ioctls take and return an integer with
a value of 0 or 1, which meant that the _whole_ mixer is unmuted or
muted respectively. In my implementation, the ioctl takes and returns
a bitmask that tells us which devices are muted.

This allows us to mute and unmute only the devices we want, instead of the
whole mixer. The bitmask works the same way as in DEVMASK, RECMASK and
RECSRC.

Integrated the hardware volume feature with the new mute system.

Submitted by:	Christos Margiolis <christos@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D31130
MFC after:	1 week
Sponsored by:	NVIDIA Networking

(cherry picked from commit 0f8dafb458)
2021-09-22 14:59:31 +02:00
Hans Petter Selasky
5c4a6f277a sound(4): Fix typos.
Submitted by:	Christos Margiolis <christos@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D31320
MFC after:	1 week
Sponsored by:	NVIDIA Networking

(cherry picked from commit 132fca6335)
2021-09-22 14:59:31 +02:00
Gordon Bergling
1c327515a9 sound(4): Fix some common typos in comments
- s/doens't/doesn't/
- s/apropriate/appropriate/
- s/intepretation/interpretation/

(cherry picked from commit 58d868c88d)
2021-08-31 08:12:40 +02:00
Gordon Bergling
f296898fb7 Fix a common typo in source code comments
- s/aligment/alignment/

(cherry picked from commit a1581cd735)
2021-08-19 09:18:35 +02:00
Philippe Michaud-Boudreault
bdbb0f0565 hda: correct comment about Asus laptop digital mics
Reported in review D30333

MFC after:	1 week

(cherry picked from commit 5d698386fb)
2021-05-26 20:47:14 -04:00
Hans Petter Selasky
484bc45f54 MFC 31070b5bc7:
Set default alternate setting when USB audio devices are not in use,
to activate power save features.

Differential Revision:	https://reviews.freebsd.org/D28032
Suggested by:	Shichun_Ma@Dell.com
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 31070b5bc7)
2021-04-01 11:13:10 +02:00
Mark Johnston
381ba4357c Fix several dev_clone callbacks to avoid out-of-bounds reads
Use strncmp() instead of bcmp(), so that we don't have to find the
minimum of the string lengths before comparing.

Reviewed by:	kib
Reported by:	KASAN
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29463

(cherry picked from commit 3428b6c050)
2021-03-31 09:15:58 -04:00