jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

827 lines
19KB

  1. /*
  2. Copyright (C) 2001-2003 Paul Davis
  3. Copyright (C) 2005 Jussi Laako
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #include <string.h>
  17. #include <stdio.h>
  18. #include <math.h>
  19. #include <config.h>
  20. #include <jack/jack.h>
  21. #include <jack/types.h>
  22. #include <jack/internal.h>
  23. #include <jack/engine.h>
  24. #include <jack/pool.h>
  25. #include <jack/port.h>
  26. #include <jack/midiport.h>
  27. #include <jack/jslist.h>
  28. #include <jack/intsimd.h>
  29. #include "local.h"
  30. static void jack_generic_buffer_init(void *port_buffer,
  31. size_t buffer_size,
  32. jack_nframes_t nframes);
  33. static void jack_audio_port_mixdown (jack_port_t *port,
  34. jack_nframes_t nframes);
  35. /* These function pointers are local to each address space. For
  36. * internal clients they reside within jackd; for external clients in
  37. * the application process. */
  38. jack_port_functions_t jack_builtin_audio_functions = {
  39. .buffer_init = jack_generic_buffer_init,
  40. .mixdown = jack_audio_port_mixdown,
  41. };
  42. extern jack_port_functions_t jack_builtin_midi_functions;
  43. jack_port_functions_t jack_builtin_NULL_functions = {
  44. .buffer_init = jack_generic_buffer_init,
  45. .mixdown = NULL,
  46. };
  47. /* Only the Audio and MIDI port types are currently built in. */
  48. jack_port_type_info_t jack_builtin_port_types[] = {
  49. { .type_name = JACK_DEFAULT_AUDIO_TYPE,
  50. .buffer_scale_factor = 1,
  51. },
  52. { .type_name = JACK_DEFAULT_MIDI_TYPE,
  53. .buffer_scale_factor = 1,
  54. },
  55. { .type_name = "", }
  56. };
  57. /* these functions have been taken from libDSP X86.c -jl */
  58. #ifdef USE_DYNSIMD
  59. static void (*opt_copy) (float *, const float *, int);
  60. static void (*opt_mix) (float *, const float *, int);
  61. static void
  62. gen_copyf (float *dest, const float *src, int length)
  63. {
  64. memcpy(dest, src, length * sizeof(float));
  65. }
  66. static void
  67. gen_mixf (float *dest, const float *src, int length)
  68. {
  69. int n;
  70. n = length;
  71. while (n--)
  72. *dest++ += *src++;
  73. /*for (iSample = 0; iSample < iDataLength; iSample++)
  74. fpDest[iSample] += fpSrc[iSample];*/
  75. }
  76. #ifdef ARCH_X86
  77. void jack_port_set_funcs ()
  78. {
  79. if (ARCH_X86_HAVE_SSE2(cpu_type)) {
  80. opt_copy = x86_sse_copyf;
  81. opt_mix = x86_sse_add2f;
  82. }
  83. else if (ARCH_X86_HAVE_3DNOW(cpu_type)) {
  84. opt_copy = x86_3dnow_copyf;
  85. opt_mix = x86_3dnow_add2f;
  86. }
  87. else {
  88. opt_copy = gen_copyf;
  89. opt_mix = gen_mixf;
  90. }
  91. }
  92. #else /* ARCH_X86 */
  93. void jack_port_set_funcs ()
  94. {
  95. opt_copy = gen_copyf;
  96. opt_mix = gen_mixf;
  97. }
  98. #endif /* ARCH_X86 */
  99. #endif /* USE_DYNSIMD */
  100. int
  101. jack_port_name_equals (jack_port_shared_t* port, const char* target)
  102. {
  103. return (strcmp (port->name, target) == 0 ||
  104. strcmp (port->alias1, target) == 0 ||
  105. strcmp (port->alias2, target) == 0);
  106. }
  107. jack_port_functions_t *
  108. jack_get_port_functions(jack_port_type_id_t ptid)
  109. {
  110. switch (ptid) {
  111. case JACK_AUDIO_PORT_TYPE:
  112. return &jack_builtin_audio_functions;
  113. case JACK_MIDI_PORT_TYPE:
  114. return &jack_builtin_midi_functions;
  115. /* no other builtin functions */
  116. default:
  117. return NULL;
  118. }
  119. }
  120. /*
  121. * Fills buffer with zeroes. For audio ports, engine->silent_buffer relies on it.
  122. */
  123. static void
  124. jack_generic_buffer_init(void *buffer, size_t size, jack_nframes_t nframes)
  125. {
  126. memset(buffer, 0, size);
  127. }
  128. jack_port_t *
  129. jack_port_new (const jack_client_t *client, jack_port_id_t port_id,
  130. jack_control_t *control)
  131. {
  132. jack_port_shared_t *shared = &control->ports[port_id];
  133. jack_port_type_id_t ptid = shared->ptype_id;
  134. jack_port_t *port = (jack_port_t *) malloc (sizeof (jack_port_t));
  135. port->mix_buffer = NULL;
  136. port->client_segment_base = NULL;
  137. port->shared = shared;
  138. port->type_info = &client->engine->port_types[ptid];
  139. pthread_mutex_init (&port->connection_lock, NULL);
  140. port->connections = 0;
  141. port->tied = NULL;
  142. if (client->control->id == port->shared->client_id) {
  143. /* It's our port, so initialize the pointers to port
  144. * functions within this address space. These builtin
  145. * definitions can be overridden by the client.
  146. */
  147. jack_port_functions_t *port_functions = jack_get_port_functions(ptid);
  148. if (port_functions == NULL)
  149. port_functions = &jack_builtin_NULL_functions;
  150. port->fptr = *port_functions;
  151. port->shared->has_mixdown = (port->fptr.mixdown ? TRUE : FALSE);
  152. }
  153. /* set up a base address so that port->offset can be used to
  154. compute the correct location. we don't store the location
  155. directly, because port->client_segment_base and/or
  156. port->offset can change if the buffer size or port counts
  157. are changed.
  158. */
  159. port->client_segment_base =
  160. (void **) &client->port_segment[ptid].attached_at;
  161. return port;
  162. }
  163. jack_port_t *
  164. jack_port_register (jack_client_t *client,
  165. const char *port_name,
  166. const char *port_type,
  167. unsigned long flags,
  168. unsigned long buffer_size)
  169. {
  170. jack_request_t req;
  171. jack_port_t *port = 0;
  172. int length ;
  173. req.type = RegisterPort;
  174. length = strlen ((const char *) client->control->name)
  175. + 1 + strlen (port_name);
  176. if ( length >= sizeof (req.x.port_info.name) ) {
  177. jack_error ("\"%s:%s\" is too long to be used as a JACK port name.\n"
  178. "Please use %lu characters or less.",
  179. client->control->name ,
  180. port_name,
  181. sizeof (req.x.port_info.name) - 1);
  182. return NULL ;
  183. }
  184. strcpy ((char *) req.x.port_info.name,
  185. (const char *) client->control->name);
  186. strcat ((char *) req.x.port_info.name, ":");
  187. strcat ((char *) req.x.port_info.name, port_name);
  188. snprintf (req.x.port_info.type, sizeof (req.x.port_info.type),
  189. "%s", port_type);
  190. req.x.port_info.flags = flags;
  191. req.x.port_info.buffer_size = buffer_size;
  192. req.x.port_info.client_id = client->control->id;
  193. if (jack_client_deliver_request (client, &req)) {
  194. jack_error ("cannot deliver port registration request");
  195. return NULL;
  196. }
  197. if ((port = jack_port_new (client, req.x.port_info.port_id,
  198. client->engine)) == NULL) {
  199. jack_error ("cannot allocate client side port structure");
  200. return NULL;
  201. }
  202. client->ports = jack_slist_prepend (client->ports, port);
  203. return port;
  204. }
  205. int
  206. jack_port_unregister (jack_client_t *client, jack_port_t *port)
  207. {
  208. jack_request_t req;
  209. req.type = UnRegisterPort;
  210. req.x.port_info.port_id = port->shared->id;
  211. req.x.port_info.client_id = client->control->id;
  212. return jack_client_deliver_request (client, &req);
  213. }
  214. /* LOCAL (in-client) connection querying only */
  215. int
  216. jack_port_connected (const jack_port_t *port)
  217. {
  218. return jack_slist_length (port->connections);
  219. }
  220. int
  221. jack_port_connected_to (const jack_port_t *port, const char *portname)
  222. {
  223. JSList *node;
  224. int ret = FALSE;
  225. /* XXX this really requires a cross-process lock
  226. so that ports/connections cannot go away
  227. while we are checking for them. that's hard,
  228. and has a non-trivial performance impact
  229. for jackd.
  230. */
  231. pthread_mutex_lock (&((jack_port_t *) port)->connection_lock);
  232. for (node = port->connections; node; node = jack_slist_next (node)) {
  233. jack_port_t *other_port = (jack_port_t *) node->data;
  234. if (jack_port_name_equals (other_port->shared, portname)) {
  235. ret = TRUE;
  236. break;
  237. }
  238. }
  239. pthread_mutex_unlock (&((jack_port_t *) port)->connection_lock);
  240. return ret;
  241. }
  242. const char **
  243. jack_port_get_connections (const jack_port_t *port)
  244. {
  245. const char **ret = NULL;
  246. JSList *node;
  247. unsigned int n;
  248. /* XXX this really requires a cross-process lock
  249. so that ports/connections cannot go away
  250. while we are checking for them. that's hard,
  251. and has a non-trivial performance impact
  252. for jackd.
  253. */
  254. pthread_mutex_lock (&((jack_port_t *) port)->connection_lock);
  255. if (port->connections != NULL) {
  256. ret = (const char **)
  257. malloc (sizeof (char *)
  258. * (jack_slist_length (port->connections) + 1));
  259. for (n = 0, node = port->connections; node;
  260. node = jack_slist_next (node), ++n) {
  261. jack_port_t* other =(jack_port_t *) node->data;
  262. ret[n] = other->shared->name;
  263. }
  264. ret[n] = NULL;
  265. }
  266. pthread_mutex_unlock (&((jack_port_t *) port)->connection_lock);
  267. return ret;
  268. }
  269. /* SERVER-SIDE (all) connection querying */
  270. const char **
  271. jack_port_get_all_connections (const jack_client_t *client,
  272. const jack_port_t *port)
  273. {
  274. const char **ret;
  275. jack_request_t req;
  276. jack_port_t *tmp;
  277. unsigned int i;
  278. int need_free = FALSE;
  279. if (port == NULL) {
  280. return NULL;
  281. }
  282. req.type = GetPortConnections;
  283. req.x.port_info.name[0] = '\0';
  284. req.x.port_info.type[0] = '\0';
  285. req.x.port_info.flags = 0;
  286. req.x.port_info.buffer_size = 0;
  287. req.x.port_info.client_id = 0;
  288. req.x.port_info.port_id = port->shared->id;
  289. jack_client_deliver_request (client, &req);
  290. if (req.status != 0 || req.x.port_connections.nports == 0) {
  291. return NULL;
  292. }
  293. if (client->request_fd < 0) {
  294. /* internal client */
  295. return req.x.port_connections.ports;
  296. }
  297. ret = (const char **)
  298. malloc (sizeof (char *) * (req.x.port_connections.nports + 1));
  299. for (i = 0; i < req.x.port_connections.nports; ++i ) {
  300. jack_port_id_t port_id;
  301. if (read (client->request_fd, &port_id, sizeof (port_id))
  302. != sizeof (port_id)) {
  303. jack_error ("cannot read port id from server");
  304. return 0;
  305. }
  306. tmp = jack_port_by_id_int (client, port_id, &need_free);
  307. ret[i] = tmp->shared->name;
  308. if (need_free) {
  309. free (tmp);
  310. need_free = FALSE;
  311. }
  312. }
  313. ret[i] = NULL;
  314. return ret;
  315. }
  316. jack_port_t *
  317. jack_port_by_id_int (const jack_client_t *client, jack_port_id_t id, int* free)
  318. {
  319. JSList *node;
  320. for (node = client->ports; node; node = jack_slist_next (node)) {
  321. if (((jack_port_t *) node->data)->shared->id == id) {
  322. *free = FALSE;
  323. return (jack_port_t *) node->data;
  324. }
  325. }
  326. if (id >= client->engine->port_max)
  327. return NULL;
  328. if (client->engine->ports[id].in_use) {
  329. *free = TRUE;
  330. return jack_port_new (client, id, client->engine);
  331. }
  332. return NULL;
  333. }
  334. jack_port_t *
  335. jack_port_by_id (jack_client_t *client, jack_port_id_t id)
  336. {
  337. JSList *node;
  338. jack_port_t* port;
  339. int need_free = FALSE;
  340. for (node = client->ports_ext; node; node = jack_slist_next (node)) {
  341. port = node->data;
  342. if (port->shared->id == id) { // Found port, return the cached structure
  343. return port;
  344. }
  345. }
  346. // Otherwise possibly allocate a new port structure, keep it in the ports_ext list for later use
  347. port = jack_port_by_id_int (client,id,&need_free);
  348. if (port != NULL && need_free)
  349. client->ports_ext =
  350. jack_slist_prepend (client->ports_ext, port);
  351. return port;
  352. }
  353. jack_port_t *
  354. jack_port_by_name_int (jack_client_t *client, const char *port_name)
  355. {
  356. unsigned long i, limit;
  357. jack_port_shared_t *port;
  358. limit = client->engine->port_max;
  359. port = &client->engine->ports[0];
  360. for (i = 0; i < limit; i++) {
  361. if (port[i].in_use && jack_port_name_equals (&port[i], port_name)) {
  362. return jack_port_new (client, port[i].id,
  363. client->engine);
  364. }
  365. }
  366. return NULL;
  367. }
  368. jack_port_t *
  369. jack_port_by_name (jack_client_t *client, const char *port_name)
  370. {
  371. JSList *node;
  372. jack_port_t* port;
  373. for (node = client->ports_ext; node; node = jack_slist_next (node)) {
  374. port = node->data;
  375. if (jack_port_name_equals (port->shared, port_name)) {
  376. /* Found port, return the cached structure. */
  377. return port;
  378. }
  379. }
  380. /* Otherwise allocate a new port structure, keep it in the
  381. * ports_ext list for later use. */
  382. port = jack_port_by_name_int (client, port_name);
  383. if (port != NULL)
  384. client->ports_ext =
  385. jack_slist_prepend (client->ports_ext, port);
  386. return port;
  387. }
  388. jack_nframes_t
  389. jack_port_get_latency (jack_port_t *port)
  390. {
  391. return port->shared->latency;
  392. }
  393. jack_nframes_t
  394. jack_port_get_total_latency (jack_client_t *client, jack_port_t *port)
  395. {
  396. return port->shared->total_latency;
  397. }
  398. void
  399. jack_port_set_latency (jack_port_t *port, jack_nframes_t nframes)
  400. {
  401. port->shared->latency = nframes;
  402. }
  403. void *
  404. jack_port_get_buffer (jack_port_t *port, jack_nframes_t nframes)
  405. {
  406. JSList *node, *next;
  407. /* Output port. The buffer was assigned by the engine
  408. when the port was registered.
  409. */
  410. if (port->shared->flags & JackPortIsOutput) {
  411. if (port->tied) {
  412. return jack_port_get_buffer (port->tied, nframes);
  413. }
  414. return jack_output_port_buffer (port);
  415. }
  416. /* Input port. Since this can only be called from the
  417. process() callback, and since no connections can be
  418. made/broken during this phase (enforced by the jack
  419. server), there is no need to take the connection lock here
  420. */
  421. if ((node = port->connections) == NULL) {
  422. /* no connections; return a zero-filled buffer */
  423. return (void *) (*(port->client_segment_base) + port->type_info->zero_buffer_offset);
  424. }
  425. if ((next = jack_slist_next (node)) == NULL) {
  426. /* one connection: use zero-copy mode - just pass
  427. the buffer of the connected (output) port.
  428. */
  429. return jack_port_get_buffer (((jack_port_t *) node->data),
  430. nframes);
  431. }
  432. /* Multiple connections. Use a local buffer and mix the
  433. incoming data into that buffer. We have already
  434. established the existence of a mixdown function during the
  435. connection process.
  436. */
  437. if (port->mix_buffer == NULL) {
  438. size_t buffer_size =
  439. port->type_info->buffer_scale_factor
  440. * sizeof (jack_default_audio_sample_t)
  441. * nframes;
  442. port->mix_buffer = jack_pool_alloc (buffer_size);
  443. port->fptr.buffer_init (port->mix_buffer, buffer_size, nframes);
  444. }
  445. port->fptr.mixdown (port, nframes);
  446. return (void *) port->mix_buffer;
  447. }
  448. int
  449. jack_port_tie (jack_port_t *src, jack_port_t *dst)
  450. {
  451. if (dst->shared->client_id != src->shared->client_id) {
  452. jack_error ("cannot tie ports not owned by the same client");
  453. return -1;
  454. }
  455. if (dst->shared->flags & JackPortIsOutput) {
  456. jack_error ("cannot tie an input port");
  457. return -1;
  458. }
  459. dst->tied = src;
  460. return 0;
  461. }
  462. int
  463. jack_port_untie (jack_port_t *port)
  464. {
  465. if (port->tied == NULL) {
  466. jack_error ("port \"%s\" is not tied", port->shared->name);
  467. return -1;
  468. }
  469. port->tied = NULL;
  470. return 0;
  471. }
  472. int
  473. jack_port_request_monitor (jack_port_t *port, int onoff)
  474. {
  475. if (onoff) {
  476. port->shared->monitor_requests++;
  477. } else if (port->shared->monitor_requests) {
  478. port->shared->monitor_requests--;
  479. }
  480. if ((port->shared->flags & JackPortIsOutput) == 0) {
  481. JSList *node;
  482. /* this port is for input, so recurse over each of the
  483. connected ports.
  484. */
  485. pthread_mutex_lock (&port->connection_lock);
  486. for (node = port->connections; node;
  487. node = jack_slist_next (node)) {
  488. /* drop the lock because if there is a feedback loop,
  489. we will deadlock. XXX much worse things will
  490. happen if there is a feedback loop !!!
  491. */
  492. pthread_mutex_unlock (&port->connection_lock);
  493. jack_port_request_monitor ((jack_port_t *) node->data,
  494. onoff);
  495. pthread_mutex_lock (&port->connection_lock);
  496. }
  497. pthread_mutex_unlock (&port->connection_lock);
  498. }
  499. return 0;
  500. }
  501. int
  502. jack_port_request_monitor_by_name (jack_client_t *client,
  503. const char *port_name, int onoff)
  504. {
  505. jack_port_t *port;
  506. unsigned long i, limit;
  507. jack_port_shared_t *ports;
  508. limit = client->engine->port_max;
  509. ports = &client->engine->ports[0];
  510. for (i = 0; i < limit; i++) {
  511. if (ports[i].in_use &&
  512. strcmp (ports[i].name, port_name) == 0) {
  513. port = jack_port_new (client, ports[i].id,
  514. client->engine);
  515. return jack_port_request_monitor (port, onoff);
  516. free (port);
  517. return 0;
  518. }
  519. }
  520. return -1;
  521. }
  522. int
  523. jack_port_ensure_monitor (jack_port_t *port, int yn)
  524. {
  525. if (yn) {
  526. if (port->shared->monitor_requests == 0) {
  527. port->shared->monitor_requests++;
  528. }
  529. } else {
  530. if (port->shared->monitor_requests > 0) {
  531. port->shared->monitor_requests = 0;
  532. }
  533. }
  534. return 0;
  535. }
  536. int
  537. jack_port_monitoring_input (jack_port_t *port)
  538. {
  539. return port->shared->monitor_requests > 0;
  540. }
  541. const char *
  542. jack_port_name (const jack_port_t *port)
  543. {
  544. return port->shared->name;
  545. }
  546. int
  547. jack_port_get_aliases (const jack_port_t *port, char* const aliases[2])
  548. {
  549. int cnt = 0;
  550. if (port->shared->alias1[0] != '\0') {
  551. snprintf (aliases[0], JACK_CLIENT_NAME_SIZE+JACK_PORT_NAME_SIZE, "%s", port->shared->alias1);
  552. cnt++;
  553. }
  554. if (port->shared->alias2[0] != '\0') {
  555. snprintf (aliases[1], JACK_CLIENT_NAME_SIZE+JACK_PORT_NAME_SIZE, "%s", port->shared->alias2);
  556. cnt++;
  557. }
  558. return cnt;
  559. }
  560. const char *
  561. jack_port_short_name (const jack_port_t *port)
  562. {
  563. /* we know there is always a colon, because we put
  564. it there ...
  565. */
  566. return strchr (port->shared->name, ':') + 1;
  567. }
  568. int
  569. jack_port_is_mine (const jack_client_t *client, const jack_port_t *port)
  570. {
  571. return port->shared->client_id == client->control->id;
  572. }
  573. int
  574. jack_port_flags (const jack_port_t *port)
  575. {
  576. return port->shared->flags;
  577. }
  578. const char *
  579. jack_port_type (const jack_port_t *port)
  580. {
  581. return port->type_info->type_name;
  582. }
  583. int
  584. jack_port_set_name (jack_port_t *port, const char *new_name)
  585. {
  586. char *colon;
  587. int len;
  588. colon = strchr (port->shared->name, ':');
  589. len = sizeof (port->shared->name) -
  590. ((int) (colon - port->shared->name)) - 2;
  591. snprintf (colon+1, len, "%s", new_name);
  592. return 0;
  593. }
  594. int
  595. jack_port_set_alias (jack_port_t *port, const char *alias)
  596. {
  597. if (port->shared->alias1[0] == '\0') {
  598. snprintf (port->shared->alias1, sizeof (port->shared->alias1), "%s", alias);
  599. } else if (port->shared->alias2[0] == '\0') {
  600. snprintf (port->shared->alias2, sizeof (port->shared->alias2), "%s", alias);
  601. } else {
  602. return -1;
  603. }
  604. return 0;
  605. }
  606. int
  607. jack_port_unset_alias (jack_port_t *port, const char *alias)
  608. {
  609. if (strcmp (port->shared->alias1, alias) == 0) {
  610. port->shared->alias1[0] = '\0';
  611. } else if (strcmp (port->shared->alias2, alias) == 0) {
  612. port->shared->alias2[0] = '\0';
  613. } else {
  614. return -1;
  615. }
  616. return 0;
  617. }
  618. /* AUDIO PORT SUPPORT */
  619. static inline float f_max(float x, float a)
  620. {
  621. x -= a;
  622. x += fabs (x);
  623. x *= 0.5;
  624. x += a;
  625. return (x);
  626. }
  627. static void
  628. jack_audio_port_mixdown (jack_port_t *port, jack_nframes_t nframes)
  629. {
  630. JSList *node;
  631. jack_port_t *input;
  632. #ifndef ARCH_X86
  633. jack_nframes_t n;
  634. jack_default_audio_sample_t *dst, *src;
  635. #endif
  636. jack_default_audio_sample_t *buffer;
  637. /* by the time we've called this, we've already established
  638. the existence of more than one connection to this input
  639. port and allocated a mix_buffer.
  640. */
  641. /* no need to take connection lock, since this is called
  642. from the process() callback, and the jack server
  643. ensures that no changes to connections happen
  644. during this time.
  645. */
  646. node = port->connections;
  647. input = (jack_port_t *) node->data;
  648. buffer = port->mix_buffer;
  649. #ifndef USE_DYNSIMD
  650. memcpy (buffer, jack_output_port_buffer (input),
  651. sizeof (jack_default_audio_sample_t) * nframes);
  652. #else /* USE_DYNSIMD */
  653. opt_copy (buffer, jack_output_port_buffer (input), nframes);
  654. #endif /* USE_DYNSIMD */
  655. for (node = jack_slist_next (node); node;
  656. node = jack_slist_next (node)) {
  657. input = (jack_port_t *) node->data;
  658. #ifndef USE_DYNSIMD
  659. n = nframes;
  660. dst = buffer;
  661. src = jack_output_port_buffer (input);
  662. while (n--) {
  663. *dst++ += *src++;
  664. }
  665. #else /* USE_DYNSIMD */
  666. opt_mix (buffer, jack_output_port_buffer (input), nframes);
  667. #endif /* USE_DYNSIMD */
  668. }
  669. }