Commit Graph

11 Commits

Author SHA1 Message Date
isaki 398f413a6e Rework about the rest note in speaker(4).
- Obsolete the sc_rest callback.  The rest note operation can be done by
  the common spkr layer.  This also fixes PR kern/56060.
  This work-in-progress patch was left in my local tree for years. :(
- Improve calculations of tone and rest length.
2021-04-03 04:10:30 +00:00
isaki 74bd6922f5 Improve SPKRDEBUG code.
- Replace wrong aprint_debug_dev() with device_printf().
  By this, it no longer need to print dev_t.
- Improve some messages.
2021-04-03 03:21:53 +00:00
isaki 25c881f1d0 Attach this only if the parent device has playback capability. 2021-02-17 12:37:33 +00:00
isaki b9ac8c833e Use hztoms() instead of incorrect calculation.
This makes spkr work on HZ=1024 like alpha.
2019-06-21 09:34:30 +00:00
isaki e622eac459 Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly.  Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism.  The encoding/channels/frequency
  conversions are completely handled in the upper layer.  So the hard-
  ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
  - Obsoletes query_encoding and add query_format instead.
  - Obsoletes set_params and add set_format instead.
  - Remove drain, setfd, mappage.
  - The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c         -> dev/audio/audio.c (rewritten)
- dev/audiovar.h      -> dev/audio/audiovar.h
- dev/audio_dai.h     -> dev/audio/audio_dai.h
- dev/audio_if.h      -> dev/audio/audio_if.h
- dev/audiobell.c     -> dev/audio/audiobell.c
- dev/audiobellvar.h  -> dev/audio/audiobellvar.h
- dev/mulaw.[ch]      -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
2019-05-08 13:40:13 +00:00
pgoyette 42ce32175a Implement xxx_rescan() and xxx_childdet() functions; these will be
needed when child device wsbell(4) becomes a separately-loadable
module.
2017-06-11 21:54:22 +00:00
nat cfe59521ba Add ioctls for setting and getting the beep volume. Currently only
supported on spkr devices attached to audio.

Ok pgoyette@.
2017-06-11 03:33:48 +00:00
nat 68257f1f16 Remove unused code - it will reappear in a new device.
Ok pgoyette@.
2017-06-11 03:25:02 +00:00
pgoyette d020b0ddde Implement a common spkr_detach() function and call it from the
attachment-specific detach functions.  Returns EBUSY if the
device instance is busy, based on whether or not a sc->sc_inbuf
is allocated.  The buffer is malloc()d at spkropen time, and is
free()d in spkrclose().

Now we can actually implement the MODULE_CMD_FINI command and
unload the driver at will.

Addresses my PR kern/51785
2017-01-06 09:32:08 +00:00
pgoyette 3d9d9fc2de Create a single combined module for spkr_pcppi and spkr_audio, and
build it for all architectures.

By doing this, we can handle pcppi, audio, or both attachments with
non-built-in modules.

XXX Still to do: the module currently cannot be unloaded, and the
XXX spkr device(s) currently cannot be detached.  (Really, two
XXX sides of the same problem.)
2016-12-15 06:48:14 +00:00
christos 8dfcaa17b1 name attachment after parent per existing convention. 2016-12-15 04:36:07 +00:00