Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nerrons
purr-data
Commits
5ddd91c7
Commit
5ddd91c7
authored
15 years ago
by
Miller Puckette
Browse files
Options
Downloads
Patches
Plain Diff
remove 32-channel limit for portaudio I/O
parent
2736926f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/s_audio_pa.c
+11
-13
11 additions, 13 deletions
src/s_audio_pa.c
with
11 additions
and
13 deletions
src/s_audio_pa.c
+
11
−
13
View file @
5ddd91c7
...
@@ -13,9 +13,12 @@
...
@@ -13,9 +13,12 @@
#include
<stdlib.h>
#include
<stdlib.h>
#include
<portaudio.h>
#include
<portaudio.h>
#include
"s_audio_pablio.h"
#include
"s_audio_pablio.h"
#ifdef MSW
#include
<malloc.h>
#else
#include
<alloca.h>
#endif
#define MAX_PA_CHANS 32
#define MAX_SAMPLES_PER_FRAME (MAX_PA_CHANS * DEFDACBLKSIZE)
/* LATER try to figure out how to handle default devices in portaudio;
/* LATER try to figure out how to handle default devices in portaudio;
the way s_audio.c handles them isn't going to work here. */
the way s_audio.c handles them isn't going to work here. */
...
@@ -196,16 +199,6 @@ int pa_open_audio(int inchans, int outchans, int rate, t_sample *soundin,
...
@@ -196,16 +199,6 @@ int pa_open_audio(int inchans, int outchans, int rate, t_sample *soundin,
/* fprintf(stderr, "open callback %d\n", (callbackfn != 0)); */
/* fprintf(stderr, "open callback %d\n", (callbackfn != 0)); */
pa_init
();
pa_init
();
/* post("in %d out %d rate %d device %d", inchans, outchans, rate, deviceno); */
/* post("in %d out %d rate %d device %d", inchans, outchans, rate, deviceno); */
if
(
inchans
>
MAX_PA_CHANS
)
{
post
(
"input channels reduced to maximum %d"
,
MAX_PA_CHANS
);
inchans
=
MAX_PA_CHANS
;
}
if
(
outchans
>
MAX_PA_CHANS
)
{
post
(
"output channels reduced to maximum %d"
,
MAX_PA_CHANS
);
outchans
=
MAX_PA_CHANS
;
}
if
(
inchans
>
0
)
if
(
inchans
>
0
)
{
{
...
@@ -288,10 +281,15 @@ void pa_close_audio( void)
...
@@ -288,10 +281,15 @@ void pa_close_audio( void)
int
pa_send_dacs
(
void
)
int
pa_send_dacs
(
void
)
{
{
float
samples
[
MAX_SAMPLES_PER_FRAME
],
*
fp1
,
*
fp2
;
unsigned
int
framesize
=
(
sizeof
(
float
)
*
DEFDACBLKSIZE
)
*
(
pa_inchans
>
pa_outchans
?
pa_inchans
:
pa_outchans
);
float
*
samples
,
*
fp1
,
*
fp2
;
int
i
,
j
;
int
i
,
j
;
double
timebefore
;
double
timebefore
;
samples
=
alloca
(
framesize
);
timebefore
=
sys_getrealtime
();
timebefore
=
sys_getrealtime
();
if
((
pa_inchans
&&
GetAudioStreamReadable
(
pa_stream
)
<
DEFDACBLKSIZE
)
||
if
((
pa_inchans
&&
GetAudioStreamReadable
(
pa_stream
)
<
DEFDACBLKSIZE
)
||
(
pa_outchans
&&
GetAudioStreamWriteable
(
pa_stream
)
<
DEFDACBLKSIZE
))
(
pa_outchans
&&
GetAudioStreamWriteable
(
pa_stream
)
<
DEFDACBLKSIZE
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment