Commit graph

23 commits

Author SHA1 Message Date
bunnie
33d8275321 refactor I2C to use deferred message responses instead of busy waits
This is a start on issue #111, where instead of starting a throw-away
server and doing a "yield" loop to emulate blocking behavior, messages
are instead stored so they don't drop, thus keeping a blocking
message blocking.
2022-04-06 03:35:43 +08:00
bunnie
4044a1d2c1 unbreak hosted mode audio 2022-03-18 03:10:28 +08:00
bunnie
04f2e0fd2a restore headphone/speaker volume on resume 2022-03-17 17:56:27 +08:00
Jared Baldridge
f37df5b880 add drain and can_play stubs to hostaudio backend 2022-03-10 13:38:59 -08:00
bunnie
4440e61d02 fix short sample problems, add pause/abort API
pause API waits till the buffer drains to stop playback
abort causes playback to stop immediately, causing pending
frames to go empty.
2022-03-08 19:02:02 +08:00
bunnie
95b857feea refactor i2c interface to eliminate static mut unsafes
also remove async write callbacks: in practice, these aren't used

Downside of this refactor is that threads for handling the
callbacks are not spawned on demand, they are spawned at boot,
leading to about an extra 68k of RAM used (most of it being
consumed in the codec block, actually). Some of this is also
probably extra object code because we're using more of the stdlib
primitives, which carry some weight.
2022-02-19 00:31:25 +08:00
bunnie
994e3d7cfb refactor llio crate (phase 1): organize files into sub-systems 2022-01-11 12:02:27 +08:00
bunnie
5c33e84858 fix hosted mode missing audio dummy functions 2021-09-10 22:58:03 +08:00
bunnie
beed5c395a add volume control functions to the codec 2021-09-10 22:53:41 +08:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
aa967a5a17 quiet up hosted mode build warnings 2021-06-18 22:37:08 +08:00
bunnie
08a86749fe fix hosted mode bugs 2021-05-09 01:13:16 +08:00
bunnie
15fc4a6c36 audio working, trying out longer samples 2021-05-08 03:14:14 +08:00
bunnie
fe6b417643 checkpoint 2021-05-08 01:13:30 +08:00
bunnie
b3a60faec2 audio checkpoint 2021-05-07 15:09:51 +08:00
bunnie
7dd66a4c18 playback is mostly working and stable 2021-05-07 05:42:39 +08:00
bunnie
adc7f8e98d cleanup the i2c API
condense async/sync methods into a single one and decide which
is which based upon the presence of an Option<callback>
2021-05-06 14:03:06 +08:00
bunnie
bc82dbd157 transition i2c api on codec, finally found the damn race condition 2021-05-06 05:05:17 +08:00
bunnie
b596c40dd6 refactor I2C to have work queue, cleaner (but untested) APIs 2021-05-06 03:40:04 +08:00
bunnie
bb5bc1d212 refactor i2c to break out the i2c machine to a separate server
the concurrency issues on I2C are getting hairy, and it was probably a
dubious decision from the start to merge I2C into the LLIO block; but
originally this was motivated by the idea of keeping all the
"miscellaneous slow stuff" in one process to keep the memory footprint
small and make code a bit more readable.

Keeping I2C in the same process space as the LLIO but splitting it
into its own thread and server splits the difference, by giving us
more options to deal with the concurrency, without inflating the size
of the kernel binary and allocating a lot of extra static data.
2021-05-06 00:45:14 +08:00
bunnie
d17ae106f1 kernel panic on memory lend 2021-05-05 00:58:48 +08:00
bunnie
f8979d6341 intermediate progress on audio. doesn't compile. 2021-05-04 02:22:35 +08:00
bunnie
50174f99e5 re-org the codec crate so that it can accommodate gnarly backends
This is in anticipation of:

1) supply chain issues causing CODEC chips to change out
2) host integration being a PITA
2021-05-03 00:31:05 +08:00