Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
28d7086c
Commit
28d7086c
authored
Jul 29, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try fixing a few issues with sndio.
parent
15c6e48b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
mini_al.h
mini_al.h
+7
-5
No files found.
mini_al.h
View file @
28d7086c
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
// - ALSA
// - ALSA
// - PulseAudio
// - PulseAudio
// - JACK
// - JACK
// - sndio (BSD)
// - sndio (
Open
BSD)
// - audioio (NetBSD)
// - audioio (NetBSD)
// - OSS (FreeBSD)
// - OSS (FreeBSD)
// - OpenSL|ES (Android only)
// - OpenSL|ES (Android only)
...
@@ -67,7 +67,8 @@
...
@@ -67,7 +67,8 @@
//
//
// Building for BSD
// Building for BSD
// ----------------
// ----------------
// The BSD build only requires linking to -ldl, -lpthread and -lm.
// The BSD build only requires linking to -ldl, -lpthread and -lm. NetBSD uses audio(4), OpenBSD uses sndio and
// FreeBSD uses OSS.
//
//
// Building for Android
// Building for Android
// --------------------
// --------------------
...
@@ -119,6 +120,7 @@
...
@@ -119,6 +120,7 @@
// is that it depends on members of mal_device being correctly aligned for atomic assignments.
// is that it depends on members of mal_device being correctly aligned for atomic assignments.
// - Sample data is always little-endian and interleaved. For example, mal_format_s16 means signed 16-bit
// - Sample data is always little-endian and interleaved. For example, mal_format_s16 means signed 16-bit
// integer samples, interleaved. Let me know if you need non-interleaved and I'll look into it.
// integer samples, interleaved. Let me know if you need non-interleaved and I'll look into it.
// - The sndio backend is currently only enabled on OpenBSD builds.
//
//
//
//
//
//
...
@@ -15634,14 +15636,14 @@ mal_result mal_device_init__sndio(mal_context* pContext, mal_device_type deviceT
...
@@ -15634,14 +15636,14 @@ mal_result mal_device_init__sndio(mal_context* pContext, mal_device_type deviceT
par.rate = desiredSampleRate;
par.rate = desiredSampleRate;
if (((mal_sio_setpar_proc)pContext->sndio.sio_setpar)((struct mal_sio_hdl*)pDevice->sndio.handle, &par) == 0) {
/*
if (((mal_sio_setpar_proc)pContext->sndio.sio_setpar)((struct mal_sio_hdl*)pDevice->sndio.handle, &par) == 0) {
((mal_sio_close_proc)pContext->sndio.sio_close)((struct mal_sio_hdl*)pDevice->sndio.handle);
((mal_sio_close_proc)pContext->sndio.sio_close)((struct mal_sio_hdl*)pDevice->sndio.handle);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[sndio] Failed to set device parameters.", MAL_FORMAT_NOT_SUPPORTED);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[sndio] Failed to set device parameters.", MAL_FORMAT_NOT_SUPPORTED);
}
}
if (((mal_sio_getpar_proc)pDevice->pContext->sndio.sio_getpar)((struct mal_sio_hdl*)pDevice->sndio.handle, &par) == 0) {
if (((mal_sio_getpar_proc)pDevice->pContext->sndio.sio_getpar)((struct mal_sio_hdl*)pDevice->sndio.handle, &par) == 0) {
((mal_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct mal_sio_hdl*)pDevice->sndio.handle);
((mal_sio_close_proc)pDevice->pContext->sndio.sio_close)((struct mal_sio_hdl*)pDevice->sndio.handle);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[sndio] Failed to retrieve device parameters.", MAL_FORMAT_NOT_SUPPORTED);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[sndio] Failed to retrieve device parameters.", MAL_FORMAT_NOT_SUPPORTED);
}
}
*/
// Try calculating an appropriate default buffer size after we have the sample rate.
// Try calculating an appropriate default buffer size after we have the sample rate.
...
@@ -15659,7 +15661,7 @@ mal_result mal_device_init__sndio(mal_context* pContext, mal_device_type deviceT
...
@@ -15659,7 +15661,7 @@ mal_result mal_device_init__sndio(mal_context* pContext, mal_device_type deviceT
desiredBufferSizeInFrames = mal_calculate_default_buffer_size_in_frames(pConfig->performanceProfile, par.rate, fCPUSpeed*fDeviceType*fBackend);
desiredBufferSizeInFrames = mal_calculate_default_buffer_size_in_frames(pConfig->performanceProfile, par.rate, fCPUSpeed*fDeviceType*fBackend);
}
}
((mal_sio_initpar_proc)pContext->sndio.sio_initpar)(&par);
//
((mal_sio_initpar_proc)pContext->sndio.sio_initpar)(&par);
par.round = desiredBufferSizeInFrames / pDevice->periods;
par.round = desiredBufferSizeInFrames / pDevice->periods;
par.appbufsz = par.round * pDevice->periods;
par.appbufsz = par.round * pDevice->periods;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment