The Linux emulator had no working audio output: the speaker endpoint had a
NULL driver (streams returned -ENODEV). This adds an SDL2 audio playback
driver for the output path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
W25Qx_writePage released the SPI bus mutex without ever acquiring it,
leaving page programs unguarded on shared buses and unlocking a mutex
possibly held by another thread. The lock was lost in the extended
addressing refactor (404e8403).
Fixes#476
Signed-off-by: Vlastimil Slinták <slintak@uart.cz>
fileSource_data() assigned dest from ctx->buffer but never wrote the
pointer back to the caller's *buf, leaving the consumer with the
original (uninitialized or stale) pointer it passed in. On the Linux
platform this meant baseband audio streamed from file sources was
silently dropped, breaking loopback and file-based baseband tests.
Set *buf = dest immediately after dest is initialized so the caller
always receives the valid buffer pointer.
Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
Add oversampling for each target:
- MD-3x0, MD-UV3x0, MD-9600, DM-1701, CS7000: 8 (64 kHz)
- CS7000-PLUS: 6 (48 kHz, LPTIM3 cannot trigger ADC at 64 kHz)
- All other targets default to 1 via #ifndef guard (no oversampling)
Co-authored-by: Ryan Turner <ryan@turnrye.com>
Co-authored-by: Claude <noreply@anthropic.com>
Replace the platform-specific #ifdef chain for micGain in audio_codec.c
with a CONFIG_MIC_GAIN macro defined in each target's hwconfig.h. This
removes code forking in the codec and makes mic gain a per-device
hardware configuration parameter.
Co-authored-by: opencode <noreply@opencode.ai>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
It looks like this might be have been a typo. OPEN_DRAIN
and OPEN_DRAIN_PU are identical case statements, but
the pullup should be set.
Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
platform_getMicLevel() now samples data from the ADC
configured for the hardware VOX circuit instead of the
microphone input ADC, which has a fixed 1.65V bias and
is unsuitable for checking mic level.
Normalization is performed specific to the characteristics
of the hardware VOX circuit. Values are output between 0-255
to ensure API compatibility.
Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
The CS7000P schematic indicates the hardware VOX circuit
is connected to PC4 on the STM32H7. The pinmap.h file has
been updated to reflect this. The existing assignment of
AIN_VBAT to GPIOC,4 looks like a holdover from another
devices pinmap.
Create a new ADC channel, ADC_VOX_CH
assigned to the ADC matching the GPIO pin that
the VOX circuit is connected to.
Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
The sine table used by the HR Cx000 DACs ranged from +32767 to
-32767, causing clipping on devices like the CS 7000P. The values
have been scaled down by a value of 2 so that clipping is prevented.
Signed-off-by: Joshua Murphy <hello@joshmurphy.ca>
With the introduction of the nonvolatile memory area descriptor table,
the nvm_getDesc function is not anymore required as part of the low-level
platform interface API. The function is now moved to the application
API, to provide safe access to NVM area information.
TG-795
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
Add a data structure carrying information about the nonvolatile memory
devices present on a given target. The table contains a list of NVM area
descriptors and their number.
From now on, each target must define the "nvmTab" symbol of type "const
struct nvmTable", which represents the entry point for all the
user-space APIs to access the nonvolatile memory.
TG-795
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
Renamed the "partNum" field of nvmDescriptor data structure to "nbPart"
to reduce abiguity. The older notation could have been interpreted as
"partition number" instead of "number of partitions".
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
There is no need for this flag, at least in the planned developments: to
avoid confusion and to keep the code clean, it is being removed.
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
Added a field to nvmDescriptor data structure holding the absoute base
address of the memory area. The value is dependent on the specific
instance of the descriptor.
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
Previous to this, the file source that is used on linux was not
working for me. This change addresses those issues found.
Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ryan Turner <ryan@turnrye.com>
This change removes the old copyright header from project sources and
replaces it with a new simplified SPDX-compliant header. Note that files
that were missing the header but reasonably understood to be licensed
according to the root license were not corrected.
Signed-off-by: Ryan Turner <ryan@turnrye.com>
Update meson and cmake config to only include openrtx and platform paths.
Update files to use <..> for system and external libraries, ".." for
project files and new relative paths as necessary.
Did not attempt to fix areas where includes that should be <..> were
previously ".."
Inspired by #96, closes#359.
Acked-by: Silvano Seva <silseva@fastwebnet.it>