Commit Graph

67 Commits

Author SHA1 Message Date
para 046d9aac76 call kmem_free with the right address in hdafg_detach for sc_widgets
the former code let to memory corruption
2012-03-11 19:39:36 +00:00
nonaka 4ed5e194ff Added Conexant 20671. 2012-03-03 05:41:45 +00:00
jakllsch 232e69ea3e Set HDAUDIO_PCI_TCSEL to TC0 like Linux does.
Fixes stalled audio on Lenovo X60 with coreboot firmware.

Additionally, move snooping adjustment to be executed on resume too,
as Linux does.
2012-02-01 16:56:34 +00:00
jmcneill 373daf800d relax the test for analog devices analog pcbeep widgets 2011-12-21 02:16:57 +00:00
jmcneill 4c310252d5 for analog devices codecs, mark the analog beeper pin as a beep generator
to help the parser. makes pcppi beep work again.
2011-12-19 12:19:26 +00:00
christos 32ecf67b0b remove duplicated code. 2011-12-12 01:25:29 +00:00
jmcneill f89865d840 PR# kern/45701: hdaudio stops working after suspend/resume and then detach/reattach
restore BIOS pin widget config on detach, and selected pin widget config on
resume
2011-12-11 15:13:58 +00:00
mrg 8de08fa998 put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
2011-11-24 03:35:56 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
jakllsch 1e28b53325 Don't attempt to reference a non-existent device. 2011-11-04 15:32:34 +00:00
jmcneill 2b6f473f20 hdafg_halt_output: disable digital output 2011-10-25 00:00:13 +00:00
jmcneill 2d68855b8e add VMware codec ID 2011-10-24 22:20:59 +00:00
jmcneill d5de6cc0a1 ossaudio's SNDCTL_DSP_GETOSPACE will call AUDIO_SETINFO if the block size
isn't a power of two, and since the block size is changing this tells
audio(4) to halt output, reconfigure the device, then trigger output again.

mplayer's oss driver uses SNDCTL_DSP_GETOSPACE a lot.

Instead of simply rounding to 128 bytes as required by the hardware, change
hdafg_round_blocksize to return one of 128, 256, 512, 1024, 2048, 4096,
or 8192.
2011-10-24 02:08:22 +00:00
jmcneill cb94089f32 Add HDMI/DP codec ID found on NVIDIA GTX 550 Ti 2011-10-06 22:25:00 +00:00
jmcneill 37071899b9 Enable non-PCM passthru for digital converters, and treat the "AC3 supported"
flag to mean that the codec supports AC3 decoding for analog converters.
2011-09-07 20:34:58 +00:00
jmcneill f086ef60d1 build fix for previous 2011-09-07 13:07:21 +00:00
jmcneill 56f57fcd97 Read/modify/write the digital converter control 1 register when setting up
digital playback instead of clobbering existing state.
2011-09-07 12:33:06 +00:00
jmcneill 89245df9b8 hdafg_stream_connect: if connecting a non-PCM stream, make sure only
converters that support non-PCM formats are configured to decode it
2011-09-07 00:16:40 +00:00
jmcneill 9d23e265dd Set the /AUDIO digital converter control bit for non-PCM streams 2011-09-06 11:14:17 +00:00
jmcneill f615e3051d For AC3, set the Non-PCM bit in the stream format structure used in the
stream descriptors & codec config.
2011-09-06 10:48:28 +00:00
jmcneill 096e3664e1 Add AC3 passthru support, currently untested. 2011-09-06 01:51:44 +00:00
jmcneill 3076984ffe have pci register itself as a module, and make PCI driver modules depend on it 2011-08-29 14:47:07 +00:00
jakllsch 0b2bca138d detach childern too 2011-08-13 16:08:23 +00:00
riastradh 0343546951 Release mutex before unmapping DMA memory.
Fixes a LOCKDEBUG panic triggered by `hdaudioctl set'.

ok jmcneill
2011-07-09 16:01:31 +00:00
jmcneill 6943f257c7 switch back to polling rirb, this will have to be revisited 2011-02-13 17:49:12 +00:00
jmcneill 9f85a3e3ee sync with bsd-hdaudio r15:
- fix an off-by-one in block size calculation
 - add register definitions from HDA034-A2, HDA035-A, HDA036-A
 - rename hdaudio_afg_* symbols to hdafg_*
 - add experimental HDMI and DisplayPort support code (needs help from DRM)
 - don't poll the RIRB unless cold
 - add support for unsolicited messages
 - 'hdaudioctl graph' works again
 - print each assoc's widget tree when boot -x
2011-02-12 15:15:34 +00:00
jmcneill 28ad83d2d7 rename hdaudio_afg.c to hdafg.c 2011-02-12 15:01:00 +00:00
jmcneill f0d64b3259 hda_error->hda_debug when tracing an adc assoc fails 2011-01-14 03:16:37 +00:00
jmcneill 0e137f7821 fix compilation when _MODULE is not defined 2011-01-07 18:24:53 +00:00
jmcneill 4608557aab modularize hdaudio and hdafg drivers 2011-01-07 15:30:29 +00:00
jmcneill b86abf544c Add Conexant codec IDs 2010-09-13 22:37:02 +00:00
jmcneill 4ac1609716 add a list of codec id->name mappings. they are printed at attach time
and exported via the AUDIO_GETDEV ioctl
2010-09-02 01:55:31 +00:00
jmcneill d7a3ccfac9 more assoc dump fixes 2010-08-19 18:06:37 +00:00
jmcneill 359c089365 kern/43542: 32kHz playback sounds like hissing analog TV snow
Instead of specifying a range of supported sample rates based on the lowest
and highest available frequencies, only advertise rates that the codec reports
as working. Let aurateconv take care of the rest.
2010-08-15 22:32:02 +00:00
jmcneill de738a3dd4 be less spammy when dumping assocs. extra details can be had with boot -x 2010-08-15 19:39:56 +00:00
jmcneill 3b73c6d5a8 properly round block and buffer sizes -- nvidia HDA controllers work now 2010-08-15 16:21:46 +00:00
joerg 9a980fa506 Increase safety of the speaker -> beep generator workaround by check
that no such widget is defined first.  On a Dell Latitude 430, widget
0x14 is the beep generator and the original version would replace the
normal speaker output, breaking head phone redirection in the process.

Discussed with jmcneill@
2010-08-10 13:47:38 +00:00
joerg 1619987e1b Reduce noise by explicitly skipping unassociated pins. 2010-08-10 11:14:30 +00:00
jmcneill 086ee7443c add support for nvidia hdaudio controllers 2010-08-07 16:59:48 +00:00
jmcneill c0b9576b27 Reject invalid vendor IDs (say if there was a RIRB timeout while reading the
VID registers)
2010-08-07 16:24:19 +00:00
jakllsch 0da82292a5 Use fewer magic constants related to the GCAP register. 2010-08-03 04:02:21 +00:00
dyoung c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
tonnerre 9956b4e182 Signedness bug/crash in azalia and hdaudio. Fixes PR 42604.
By Pierre Pronchery.
2010-01-20 09:05:12 +00:00
dyoung cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
njoly 743418620c Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
2009-12-04 11:13:04 +00:00
sborrill 6c11da0940 Add ioctls required by hdaudioctl. This involves some refactoring of the
hdaudio_afg ioctl code.
2009-10-11 08:50:11 +00:00
sborrill 21e3c4b6e7 Add support for playback- or capture-only devices by adding
AUDIO_PROP_PLAYBACK and AUDIO_PROP_CAPTURE properties.

From jmcneill@.

Fixes PR#42050
2009-09-29 15:58:54 +00:00
jmcneill cdd2b39863 ensure that hp sensing is stopped on suspend, and restarted on resume if required. 2009-09-27 02:36:38 +00:00
jmcneill d62c10993d PR# kern/42110: No mute control on hdaudio(4)
PR# kern/42028: hdaudio: mplayer can't change volume

Since the driver is not limited to OSS mixer APIs, allow for duplicate
mixer nodes with the same role. Resolves a regression where certain
controls may no longer be available that were previously possible with
azalia(4). Part of a fix for 42028. While here, add .mute controls to
address 42110.
2009-09-26 17:05:01 +00:00
jmcneill f41110c95f Implement and enable headphone sensing. Slightly different from the FreeBSD
implementation in that this code does not care if the headphones are seq=15.
Instead, for each association, find any HP pins with jack sense capabilities
and if at least one has the Presense Detect bit set, enable output on all
PWCs of type HP_OUT and disable output on all PWCs of type LINE_OUT, SPEAKER,
or AUX. Do the reverse if no HP pins have the Presense Detect bit set.
2009-09-26 11:51:29 +00:00