Commit graph

75 commits

Author SHA1 Message Date
Stephen Gutekanst
b426504080 sysaudio: update to latest Zig API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-29 19:02:04 -07:00
Stephen Gutekanst
4bc32adeb8 all: update to latest Zig APIs (zig fmt)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-29 09:54:32 -07:00
Stephen Gutekanst
589a181a92 all: update dependency versions
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-25 01:25:30 -07:00
Stephen Gutekanst
29964c99bb update to latest Zig (zig fmt)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-06-25 00:01:55 -07:00
Haze Booth
bfc2fad8e7 fixup! Simplify channel logic for coreaudio 2023-06-02 18:38:27 -07:00
Haze Booth
28c119888b Simplify channel logic for coreaudio 2023-06-02 18:38:27 -07:00
Wrench[bot]
539ab03439 all: update dependencies
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-05-31 22:05:18 -07:00
Stephen Gutekanst
2327059f45 sysaudio: fix bit cast in pipewire backend
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-28 20:02:07 -07:00
Stephen Gutekanst
dfcfc20db8 sysaudio: use mach-sysjs via package manager
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-05-19 08:36:44 -07:00
sophia
ef7b079149
mach: update to @min/@max (std.math.min/max is going away) (#774)
this commit is the beginning scope for resolving #771
2023-05-16 01:36:13 -07:00
Stephen Gutekanst
f2a904e17a sysaudio: fix broken sysjs dependency include
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-30 16:57:19 -07:00
Ali Chraghi
ed05166348
sysaudio: improve backend selection; remove i8 sample support (#767)
* sysaudio: fix compilation errors
* re-order backend selection
* remove i8 samples support from backends and disable signedToSigned convertion for now
* update sine-wave example
2023-04-30 16:36:39 -07:00
Stephen Gutekanst
8c0c288fff sysaudio: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-25 15:06:11 -07:00
Vivek Roy
ff0258f27d all: use std.Build.installArtifact 2023-04-25 15:06:11 -07:00
pablo
a14cb00ddd sysaudio: add missing switch cases for wasapi 2023-04-11 09:00:51 -07:00
Ali Chraghi
3a0948098f sysaudio: fix build errors on linux 2023-04-11 08:55:47 -07:00
Ali Chraghi
fbd2ba78f9
sysaudio: initial macOS support (CoreAudio) (#741) 2023-04-08 11:27:49 -07:00
Stephen Gutekanst
8d7388e723 sysaudio: better explanation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-05 03:30:34 -07:00
Stephen Gutekanst
ac4c5cb059 sysaudio: add README
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-05 03:09:10 -07:00
Ali Chraghi
edd2117174 all: build: update to zig version 0.11.0-dev.6883+da0509750 2023-03-24 23:22:59 -07:00
Stephen Gutekanst
6bd4d91932 all: cache module() returns to avoid duplicate modules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-15 21:20:28 -07:00
Aksel Hjerpbakk
2b6f3fb1d9
all: fix issue with glfw vulkan createWindowSurface; update to new for loop syntax (#713) 2023-03-01 18:33:17 -07:00
Stephen Gutekanst
46a805bc90 sysaudio: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-02-12 10:05:03 -07:00
Ali Chraghi
82a853045f sysaudio: rename dummy to default in webaudio 2023-01-23 00:20:54 -07:00
Ali Chraghi
05968f0496 sysaudio: load libpipewire-0.3.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
655e061d50 sysaudio: load libasound.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
ea8ff67ae4 sysaudio: load libjack.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
13ad66b7ad sysaudio: load libpulse.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
ee84f6ab70 sysaudio: move DeviceChaneFn to Context and rename ConnectError to InitError 2023-01-20 14:53:22 -07:00
Ali Chraghi
36a40dc51a sysaudio: add workaround for wine
wine crashes when using AudioClient3. it's weird since it returns success when quering
2023-01-20 14:53:22 -07:00
Ali Chraghi
7315d1ab62 sysaudio: access sample rate from field (except for jack) and add media role option 2023-01-20 14:53:22 -07:00
Ali Chraghi
bb6a654c90 sysaudio: pipewire backend
missing features:\n - volume adjustment\n - device watcher\n - device listing (default device)
2023-01-20 14:53:22 -07:00
Stephen Gutekanst
a750e31d11 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit a1fe671db8.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
Lue
a1fe671db8
all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)
* all: build: fix sdkPath for relative @src.file

Prior to this commit, the build system heavily assumed that the result
`@src.file` would always be absolute, but this is no longer
guaranteed, likely due to there being no such thing as an "absolute
path" in WASI.

It appears that for normal invocations of `zig build`, it is safe to
assume that `@src.file` is absolute. However, when ZLS uses a custom
`build_runner.zig` to collect build configuration, `@src.file` is
actually relative to the current working directory, at least on my
system. For a while, this led to ZLS completions breaking entirely,
but presently it actually causes ZLS to crash!

The solution is not as simple as using relative `sdkPath` results
as-is, because the build system may attempt to resolve these paths
relative to build root, when the paths are actually relative to the
current working directory.

This leads to a sticky situation: the current working directory is a
runtime concept, but `@src.file` is resolved at compile time. However,
it appears that the build runner does not change current working
directory in between compilation and execution, so it is probably safe
to calculate `sdkPath` using runtime current working directory.

Still, this requires major changes with how `sdkPath` works, since
runtime computation and allocations are required. So pretty much
anything that relied on `sdkPath` being comptime-known has been
refactored in this commit.

The most severe result of this is that, for example, `gpu.pkg` can no
longer be a comptime-known constant: it has to be a runtime function
that takes a `*Builder` and returns a `Pkg`.

This commit deals with usages of `*.pkg` and `sdkPath` within Mach
itself, but projects that depend on Mach such as `mach-examples` will
almost certainly require changes as well.

* all: update README to reflect change in pkg usage

For details on updating your code to use this version, see: 88b1106953

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 01:23:46 -07:00
Ali Chraghi
7df12a0cae sysjs: automatically cast numbers to f64 & remove dead code 2022-12-25 13:36:03 -07:00
Ali Chraghi
f9b3ac2106 sysaudio: add webaudio backend 2022-12-25 13:36:03 -07:00
Benjaaaa
052d3a7da8
mach: fix compiler error regarding zig changes (#645) 2022-12-25 13:19:48 -07:00
Ali Chraghi
dc3f4b4c00 sysaudio:wasapi: wait for audio client to be ready 2022-12-18 18:02:31 -07:00
Ali Chraghi
0f3e28bc2a sysaudio: rewrite in zig
removes libsoundio dependency
2022-12-18 18:02:31 -07:00
Eric Joldasov
3397497cc9 sysaudio: use undefined in enums
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2022-12-14 02:18:21 -07:00
Slava Mostovoy
9b9852b56e
sysaudio: add ability to provide system_sdk options (#619) 2022-11-20 11:45:07 -07:00
Ali Chraghi
82e10f4f28
all: build: thisDir improvements (#570)
* build:all: thisDir improvements

more performant output, usage code reducement and compileError for wrong usage

* glfw: update deprecated code
2022-09-29 08:41:46 -07:00
Stephen Gutekanst
87fd2f82f6 sysaudio: add TODO regarding CI tests 2022-09-20 02:30:45 -07:00
Ali Chraghi
fe9ec5ba15 sysaudio: skip most tests
until we find a better way to test sysaudio via CI

a usable device may not be in the first index
2022-09-20 02:30:45 -07:00
Ali Chraghi
cb9fa97b31 sysaudio: move DataCallback into main.zig 2022-09-18 17:09:54 -07:00
locriacyber
b8c48d6321
all: remove ineffective _ = variable assignments (#530)
Lastest Zig complains about this, so they must removed to build.
2022-09-14 09:42:29 -07:00
Stephen Gutekanst
8113ca370d all: remove support for stage1
With almost all tests/examples working on all platforms now with the new compiler,
https://github.com/hexops/mach/issues/180, it's time to remove stage1 support.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 00:09:30 -07:00
Louis Pearson
70f4514c66 sysaudio: fix compile for web 2022-09-09 22:39:35 -07:00
Stephen Gutekanst
b72c2c978f sysaudio: target a desired buffer size / latency instead of assuming maximum
On most platforms the maximum amount of frames we can write is reasonable and
provides rarely noticable latency, but on some platforms (e.g. Windows prior
to Mason's patch) this is not true. It's a good idea therefor to target a
desired buffer size / number of frames to write per update, which is also exactly
what we must decide on the WebAudio backend. For now this is hard-coded in sysaudio
but we will expose this as a config option soon.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 22:34:43 -07:00
Stephen Gutekanst
c009ff3f90 sysaudio: fix buffer size on Windows
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 22:32:17 -07:00