source: roaraudio/roard/roard.c @ 1011:382d3e6269d1

Last change on this file since 1011:382d3e6269d1 was 1011:382d3e6269d1, checked in by phi, 15 years ago

ignore proxy settings at startup time while opening local socket

File size: 18.2 KB
Line 
1//roard.c:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008
5 *
6 *  This file is part of roard a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  RoarAudio is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#include "roard.h"
26
27char * server = ROAR_DEFAULT_SOCK_GLOBAL; // global server address
28
29void usage (void) {
30 printf("Usage: roard [OPTIONS]...\n\n");
31
32 printf("Misc Options:\n\n");
33 printf(
34        " --daemon              - Bring the server into background after init\n"
35        " --terminate           - Terminate after last client quited\n"
36        " --restart             - Trys to stop an old instance and start a new with new settings\n"
37        " --realtime            - Trys to get realtime priority,\n"
38        "                         give multible times for being more realtime\n"
39        " --chroot DIR          - chroots to the given dir\n"
40        " --setgid              - GroupID to the audio group as specified via -G\n"
41        " --setuid              - UserID to the audio user as specified via -U\n"
42        " --sysclocksync        - calculate exact sample rate using the system clock\n"
43       );
44
45 printf("\nAudio Options:\n\n");
46 printf(
47        " -R  --rate   RATE     - Set server rate\n"
48        " -B  --bits   BITS     - Set server bits\n"
49        " -C  --chans  CHANNELS - Set server channels\n"
50       );
51
52 printf("\nDriver Options:\n\n");
53 printf(" -d  --driver DRV      - Set the driver (default: %s)\n", ROAR_DRIVER_DEFAULT);
54 printf(" -D  --device DEV      - Set the device\n");
55 printf(" -dO OPTS              - Set output options\n");
56 printf(" --list-driver         - List all drivers\n");
57
58 printf("\nOutput Options:\n\n");
59 printf(" -o  --odriver DRV     - Set the driver, use '--list-driver' to get a list\n");
60 printf(" -O  --odevice DEV     - Set the device\n");
61 printf(" -oO OPTS              - Set output options\n");
62 printf(" -oN                   - Adds another output\n");
63 printf(" -oP                   - Mark output as primary\n");
64
65 printf("\nSource Options:\n\n");
66 printf(" -s  --source DRV      - Use DRV as input driver\n"
67        " -S           DEV      - Use DEV as input device\n"
68        " -sO          OPTS     - Use OPTS as input options\n"
69        " -sP                   - Make souce as primary\n"
70       );
71
72 printf("\nCodec Filter Options:\n\n");
73 printf(" --list-cf             - List all codec filter\n"
74       );
75
76 printf("\nServer Options:\n\n");
77 printf(" -t  --tcp             - Use TCP listen socket\n"
78        " -u  --unix            - Use UNIX Domain listen socket (default)\n"
79#ifdef ROAR_HAVE_LIBDNET
80        " -n  --decnet          - use DECnet listen socket\n"
81#endif
82        " -4                    - Use IPv4 connections (implies -t)\n"
83#ifdef PF_INET6
84        " -6                    - Use IPv6 connections (implies -t)\n"
85#endif
86#ifdef IPV6_ADDRFORM
87        " -64                   - Try to downgrade sockets from IPv6 into IPv4,\n"
88        "                         this is normaly not usefull.\n"
89#endif
90        " -p  --port            - TCP Port to bind to\n"
91        " -b  --bind            - IP/Hostname to bind to\n"
92        " -s  --sock            - Filename for UNIX Domain Socket\n"
93        " -G  GROUP             - Sets the group for the UNIX Domain Socket, (default: %s)\n"
94        "                         You need the permittions to change the GID\n"
95        " -U  USER              - Sets the user for the UNIX Domain Socket, (default: do not set)\n"
96        "                         You need the permittions to change the UID (normaly only root has)\n"
97        " --no-listen           - Do not listen for new clients\n"
98        "                         (only usefull for relaing, impleys --terminate)\n"
99        " --client-fh           - Comunicate with a client over this handle\n"
100        "                         (only usefull for relaing)\n"
101        " --close-fh            - Closes the given fh\n"
102        " --standby             - Start in standby state\n"
103        " --auto-standby        - Automatical goes into standby if there are no streams\n",
104        ROAR_DEFAULT_SOCKGRP
105       );
106// printf("\n Options:\n\n");
107 printf("\n");
108}
109
110int restart_server (char * server) {
111 struct roar_connection con;
112 if ( roar_connect(&con, server) == -1 ) {
113  return -1;
114 }
115
116 if ( roar_terminate(&con, 1) == -1 ) {
117  return -1;
118 }
119
120 return roar_disconnect(&con);
121}
122
123#define R_SETUID 1
124#define R_SETGID 2
125
126int add_output (char * drv, char * dev, char * opts, int prim) {
127 int stream;
128 struct roar_stream * s;
129 struct roar_stream_server * ss;
130 char * k, * v;
131 int codec;
132
133 ROAR_DBG("add_output(drv='%s', dev='%s', opts='%s') = ?", drv, dev, opts);
134
135 if ( (stream = streams_new()) == -1 ) {
136  ROAR_DBG("add_output(drv='%s', dev='%s', opts='%s') = -1", drv, dev, opts);
137  if ( prim ) alive = 0;
138  return -1;
139 }
140
141 streams_get(stream, &ss);
142 s = ROAR_STREAM(ss);
143
144 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info));
145
146 s->dir        = ROAR_DIR_OUTPUT;
147 s->pos_rel_id = -1;
148// s->info.codec = codec;
149
150 codec = s->info.codec;
151
152 k = strtok(opts, ",");
153 while (k != NULL) {
154//  ROAR_WARN("add_output(*): opts: %s", k);
155
156  if ( (v = strstr(k, "=")) != NULL ) {
157   *v++ = 0;
158  }
159
160  ROAR_DBG("add_output(*): opts: k='%s', v='%s'", k, v);
161  if ( strcmp(k, "rate") == 0 ) {
162   s->info.rate = atoi(v);
163  } else if ( strcmp(k, "channels") == 0 ) {
164   s->info.channels = atoi(v);
165  } else if ( strcmp(k, "bits") == 0 ) {
166   s->info.bits = atoi(v);
167  } else if ( strcmp(k, "codec") == 0 ) {
168   if ( (codec = roar_str2codec(v)) == -1 ) {
169    ROAR_ERR("add_output(*): unknown codec '%s'", v);
170    streams_delete(stream);
171    if ( prim ) alive = 0;
172    return -1;
173   }
174  } else {
175   ROAR_ERR("add_output(*): unknown option '%s'", k);
176   streams_delete(stream);
177   if ( prim ) alive = 0;
178   return -1;
179  }
180
181  k = strtok(NULL, ",");
182 }
183
184 if ( codec == ROAR_CODEC_ALAW || codec == ROAR_CODEC_MULAW )
185  s->info.bits = 8; // needed to open OSS driver, will be overriden by codecfilter
186
187 s->info.codec = codec;
188 ROAR_STREAM_SERVER(s)->codec_orgi = codec;
189
190 if ( driver_openvio(&(ss->vio), &(ss->driver_id), drv, dev, &(s->info), -1) ) {
191  streams_delete(stream);
192  ROAR_DBG("add_output(drv='%s', dev='%s', opts='%s') = -1", drv, dev, opts);
193  if ( prim ) alive = 0;
194  return -1;
195 }
196
197 streams_set_fh(stream, -1); // update some internal structures
198
199 client_stream_add(g_source_client, stream);
200
201 if ( prim )
202  streams_mark_primary(stream);
203
204 return 0;
205}
206
207int main (int argc, char * argv[]) {
208 int i;
209 char * k;
210 char user_sock[80]  = {0};
211 struct roar_audio_info sa;
212 int    daemon       = 0;
213 int    realtime     = 0;
214 int    sysclocksync = 0;
215 char * driver = getenv("ROAR_DRIVER");
216 char * device = getenv("ROAR_DEVICE");
217 char * opts   = NULL;
218// char * server = ROAR_DEFAULT_SOCK_GLOBAL;
219 int      port = ROAR_DEFAULT_PORT;
220 int               drvid;
221 char * s_drv     = "cf";
222 char * s_con     = NULL;
223 char * s_opt     = NULL;
224 int    s_prim    = 0;
225 char * o_drv     = NULL;
226 char * o_dev     = NULL;
227 char * o_opts    = NULL;
228 int    o_prim    = 0;
229 char * sock_grp  = ROAR_DEFAULT_SOCKGRP;
230 char * sock_user = NULL;
231 int    sock_type = ROAR_SOCKET_TYPE_UNKNOWN;
232 char * chrootdir = NULL;
233 int    setids    = 0;
234 char * env_roar_proxy_backup;
235 struct group   * grp  = NULL;
236 struct passwd  * pwd  = NULL;
237 struct servent * serv = NULL;
238 DRIVER_USERDATA_T drvinst;
239 struct roar_client * self = NULL;
240#ifdef ROAR_HAVE_LIBDNET
241 char decnethost[80];
242#endif
243
244 g_listen_socket = -1;
245 g_standby       =  0;
246 g_autostandby   =  0;
247 alive           =  1;
248
249 sa.bits     = ROAR_BITS_DEFAULT;
250 sa.channels = ROAR_CHANNELS_DEFAULT;
251 sa.rate     = ROAR_RATE_DEFAULT;
252 sa.codec    = ROAR_CODEC_DEFAULT;
253
254 g_sa = &sa;
255
256
257 if ( getuid() != 0 && getenv("HOME") ) {
258  snprintf(user_sock, 79, "%s/%s", getenv("HOME"), ROAR_DEFAULT_SOCK_USER);
259  server = user_sock;
260 }
261
262 if ( getenv("ROAR_SERVER") != NULL )
263  server = getenv("ROAR_SERVER");
264
265 if ( clients_init() == -1 ) {
266  ROAR_ERR("Can not init clients!");
267  return 1;
268 }
269
270 if ( streams_init() == -1 ) {
271  ROAR_ERR("Can not init streams!");
272  return 1;
273 }
274
275 if ( (g_self_client = clients_new()) == -1 ) {
276  ROAR_ERR("Can not create self client!");
277  return 1;
278 }
279
280 if ( sources_init() == -1 ) {
281  ROAR_ERR("Can not init sources!");
282  return 1;
283 }
284
285 if ( (sources_set_client(g_self_client)) == -1 ) {
286  ROAR_ERR("Can not init set source client!");
287  return 1;
288 }
289
290 for (i = 1; i < argc; i++) {
291  k = argv[i];
292
293  if ( strcmp(k, "-h") == 0 || strcmp(k, "--help") == 0 ) {
294   usage();
295   return 0;
296
297  } else if ( strcmp(k, "--restart") == 0 ) {
298   if ( restart_server(server) == -1 ) {
299    ROAR_WARN("Can not terminate old server (not running at %s?), tring to continue anyway", server);
300   }
301
302  } else if ( strcmp(k, "--demon") == 0 || strcmp(k, "--daemon") == 0 ) {
303   daemon = 1;
304  } else if ( strcmp(k, "--terminate") == 0 ) {
305   g_terminate = 1;
306  } else if ( strcmp(k, "--sysclocksync") == 0 ) {
307   sysclocksync = 1000;
308  } else if ( strcmp(k, "--realtime") == 0 ) {
309   realtime++;
310  } else if ( strcmp(k, "--chroot") == 0 ) {
311   chrootdir = argv[++i];
312  } else if ( strcmp(k, "--setgid") == 0 ) {
313   setids |= R_SETGID;
314  } else if ( strcmp(k, "--setuid") == 0 ) {
315   setids |= R_SETUID;
316
317  } else if ( strcmp(k, "--list-cf") == 0 ) {
318   print_codecfilterlist();
319   return 0;
320
321  } else if ( strcmp(k, "-R") == 0 || strcmp(k, "--rate") == 0 ) {
322   sa.rate = atoi(argv[++i]);
323  } else if ( strcmp(k, "-B") == 0 || strcmp(k, "--bits") == 0 ) {
324   sa.bits = atoi(argv[++i]);
325  } else if ( strcmp(k, "-C") == 0 || strcmp(k, "--chans") == 0 ) {
326   sa.channels = atoi(argv[++i]);
327
328  } else if ( strcmp(k, "-d") == 0 || strcmp(k, "--driver") == 0 ) {
329   driver = argv[++i];
330   if ( strcmp(driver, "list") == 0 ) {
331    ROAR_WARN("The option is obsolete, use --list-driver!");
332    print_driverlist();
333    return 0;
334   }
335  } else if ( strcmp(k, "-D") == 0 || strcmp(k, "--device") == 0 ) {
336   device = argv[++i];
337  } else if ( strcmp(k, "-dO") == 0 ) {
338   opts = argv[++i];
339  } else if ( strcmp(k, "--list-driver") == 0 ) {
340   print_driverlist();
341   return 0;
342
343  } else if ( strcmp(k, "-o") == 0 || strcmp(k, "--odriver") == 0 ) {
344   o_drv  = argv[++i];
345  } else if ( strcmp(k, "-O") == 0 || strcmp(k, "--odevice") == 0 ) {
346   o_dev  = argv[++i];
347  } else if ( strcmp(k, "-oO") == 0 ) {
348   o_opts = argv[++i];
349  } else if ( strcmp(k, "-oP") == 0 ) {
350   o_prim = 1;
351  } else if ( strcmp(k, "-oN") == 0 ) {
352   add_output(o_drv, o_dev, o_opts, o_prim);
353   o_drv  = o_dev = o_opts = NULL;
354   o_prim = 0;
355
356  } else if ( strcmp(k, "-s") == 0 || strcmp(k, "--source") == 0 ) {
357   s_drv = argv[++i];
358  } else if ( strcmp(k, "-S") == 0 ) {
359   k = argv[++i];
360   if ( sources_add(s_drv, k, s_con, s_opt, s_prim) == -1 ) {
361    ROAR_ERR("main(*): adding source '%s' via '%s' failed!", k, s_drv);
362   }
363   s_opt = s_con = NULL;
364   s_prim = 0;
365  } else if ( strcmp(k, "-sO") == 0 ) {
366   s_opt = argv[++i];
367  } else if ( strcmp(k, "-sC") == 0 ) {
368   s_con = argv[++i];
369  } else if ( strcmp(k, "-sP") == 0 ) {
370   s_prim = 1;
371
372  } else if ( strcmp(k, "-p") == 0 || strcmp(k, "--port") == 0 ) {
373   // This is only usefull in INET not UNIX mode.
374   if ( *server == '/' )
375    server = ROAR_DEFAULT_HOST;
376
377   errno = 0;
378   if ( (port = atoi(argv[++i])) < 1 ) {
379    if ( (serv = getservbyname(argv[i], "tcp")) == NULL ) {
380     ROAR_ERR("Unknown service: %s: %s", argv[i], strerror(errno));
381     return 1;
382    }
383    // NOTE: we need to use ROAR_NET2HOST16() here even if s_port is of type int!
384    ROAR_DBG("main(*): serv = {s_name='%s', s_aliases={...}, s_port=%i, s_proto='%s'}",
385            serv->s_name, ROAR_NET2HOST16(serv->s_port), serv->s_proto);
386    port = ROAR_NET2HOST16(serv->s_port);
387   }
388  } else if ( strcmp(k, "-b") == 0 || strcmp(k, "--bind") == 0 || strcmp(k, "-s") == 0 || strcmp(k, "--sock") == 0 ) {
389   server = argv[++i];
390
391  } else if ( strcmp(k, "-t") == 0 || strcmp(k, "--tcp") == 0 ) {
392   if ( sock_type != ROAR_SOCKET_TYPE_TCP && sock_type != ROAR_SOCKET_TYPE_TCP6 )
393    sock_type = ROAR_SOCKET_TYPE_TCP;
394
395   if ( *server == '/' )
396    server = ROAR_DEFAULT_HOST;
397
398  } else if ( strcmp(k, "-4") == 0 ) {
399   sock_type = ROAR_SOCKET_TYPE_TCP;
400   if ( *server == '/' )
401    server = ROAR_DEFAULT_HOST;
402  } else if ( strcmp(k, "-6") == 0 ) {
403#ifdef PF_INET6
404   sock_type = ROAR_SOCKET_TYPE_TCP6;
405   if ( *server == '/' )
406    server = ROAR_DEFAULT_HOST;
407#else
408    ROAR_ERR("No IPv6 support compiled in!");
409    return 1;
410#endif
411
412  } else if ( strcmp(k, "-u") == 0 || strcmp(k, "--unix") == 0 ) {
413   // ignore this case as it is the default behavor.
414   sock_type = ROAR_SOCKET_TYPE_UNIX;
415
416  } else if ( strcmp(k, "-n") == 0 || strcmp(k, "--decnet") == 0 ) {
417#ifdef ROAR_HAVE_LIBDNET
418    port   = ROAR_DEFAULT_NUM;
419    strcpy(decnethost, ROAR_DEFAULT_LISTEN_OBJECT);
420    server = decnethost;
421    sock_type = ROAR_SOCKET_TYPE_DECNET;
422#else
423    ROAR_ERR("No DECnet support compiled in!");
424    return 1;
425#endif
426
427  } else if ( strcmp(k, "-G") == 0 ) {
428   sock_grp  = argv[++i];
429  } else if ( strcmp(k, "-U") == 0 ) {
430   sock_user = argv[++i];
431
432  } else if ( strcmp(k, "--no-listen") == 0 ) {
433   *server     = 0;
434   g_terminate = 1;
435  } else if ( strcmp(k, "--client-fh") == 0 ) {
436   if ( clients_set_fh(clients_new(), atoi(argv[++i])) == -1 ) {
437    ROAR_ERR("main(*): Can not set client's fh");
438    return 1;
439   }
440  } else if ( strcmp(k, "--close-fh") == 0 ) {
441   close(atoi(argv[++i]));
442
443  } else if ( strcmp(k, "--standby") == 0 ) {
444   g_standby = 1;
445  } else if ( strcmp(k, "--auto-standby") == 0 ) {
446   g_autostandby = 1;
447  } else {
448   usage();
449   return 1;
450  }
451
452 }
453
454 if ( o_drv != NULL )
455  add_output(o_drv, o_dev, o_opts, o_prim);
456
457 ROAR_DBG("Server config: rate=%i, bits=%i, chans=%i", sa.rate, sa.bits, sa.channels);
458
459 if ( midi_init() == -1 )
460  ROAR_ERR("Can not initialize MIDI subsystem");
461
462 if ( *server != 0 ) {
463  if ( (g_listen_socket = roar_socket_listen(sock_type, server, port)) == -1 ) {
464   if ( *server == '/' ) {
465    if ( (env_roar_proxy_backup = getenv("ROAR_PROXY")) != NULL ) {
466     env_roar_proxy_backup = strdup(env_roar_proxy_backup);
467     unsetenv("ROAR_PROXY");
468    }
469    if ( (i = roar_socket_connect(server, port)) != -1 ) {
470     close(i);
471     ROAR_ERR("Can not open listen socket!");
472     return 1;
473    } else {
474     unlink(server);
475     if ( (g_listen_socket = roar_socket_listen(sock_type, server, port)) == -1 ) {
476      ROAR_ERR("Can not open listen socket!");
477      return 1;
478     }
479    }
480    if ( env_roar_proxy_backup != NULL ) {
481     setenv("ROAR_PROXY", env_roar_proxy_backup, 0);
482     free(env_roar_proxy_backup);
483    }
484   } else {
485    ROAR_ERR("Can not open listen socket!");
486    return 1;
487   }
488  }
489
490  if ( (grp = getgrnam(sock_grp)) == NULL ) {
491   ROAR_ERR("Can not get GID for group %s: %s", sock_grp, strerror(errno));
492  }
493  if ( sock_user || (setids & R_SETUID) ) {
494   if ( (pwd = getpwnam(sock_user)) == NULL ) {
495    ROAR_ERR("Can not get UID for user %s: %s", sock_user, strerror(errno));
496   }
497  }
498
499  if ( *server == '/' ) {
500   if ( grp ) {
501    if ( pwd ) {
502     chown(server, pwd->pw_uid, grp->gr_gid);
503    } else {
504     chown(server, -1, grp->gr_gid);
505    }
506    if ( getuid() == 0 )
507     chmod(server, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
508   }
509  }
510 }
511
512 if ( output_buffer_init(&sa) == -1 ) {
513  ROAR_ERR("Can not init output buffer!");
514  return 1;
515 }
516
517 if ( driver_open(&drvinst, &drvid, driver, device, &sa) == -1 ) {
518  ROAR_ERR("Can not open output driver!");
519  return 1;
520 }
521
522 if ( samples_init() == -1 ) {
523  ROAR_ERR("Can not init samples!");
524  return 1;
525 }
526
527
528 signal(SIGINT,  on_sig_int);
529 signal(SIGCHLD, on_sig_chld);
530 signal(SIGPIPE, SIG_IGN);  // ignore broken pipes
531
532 if ( realtime ) {
533#ifdef DEBUG
534  ROAR_WARN("compiled with -DDEBUG but realtime is enabled: for real realtime support compiel without -DDEBUG");
535#endif
536
537  errno = 0;
538  nice(-5*realtime); // -5 for each --realtime
539  if ( errno )
540   ROAR_WARN("Can not decrease nice value by 5: %s", strerror(errno));
541/*
542#ifdef __linux__
543  if ( ioprio_set(IOPRIO_WHO_PROCESS, getpid(), IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)) == -1 )
544   ROAR_WARN("Can not set io priority: %s", strerror(errno));
545#endif
546*/
547 }
548
549 if ( setids & R_SETGID ) {
550  if ( setgroups(0, (const gid_t *) NULL) == -1 ) {
551   ROAR_ERR("Can not clear supplementary group IDs: %s", strerror(errno));
552  }
553  if ( !grp || setgid(grp->gr_gid) == -1 ) {
554   ROAR_ERR("Can not set GroupID: %s", strerror(errno));
555  }
556 }
557
558
559 clients_set_pid(g_self_client, getpid());
560 clients_set_uid(g_self_client, getuid());
561 clients_set_gid(g_self_client, getgid());
562 clients_get(g_self_client, &self);
563
564 if ( self == NULL ) {
565  ROAR_ERR("Can not get self client!");
566  return 1;
567 }
568
569 strcpy(self->name, "RoarAudio daemon internal");
570
571 if ( daemon ) {
572  close(ROAR_STDIN );
573  close(ROAR_STDOUT);
574  close(ROAR_STDERR);
575  setsid();
576  if ( fork() )
577   _exit(0);
578 }
579
580 if (chrootdir) {
581  if ( chroot(chrootdir) == -1 ) {
582   ROAR_ERR("Can not chroot to %s: %s", chrootdir, strerror(errno));
583   return 2;
584  }
585  if ( chdir("/") == -1 ) {
586   ROAR_ERR("Can not chdir to /: %s", strerror(errno));
587   return 2;
588  }
589 }
590
591 if ( setids & R_SETUID ) {
592  if ( !pwd || setuid(pwd->pw_uid) == -1 ) {
593   ROAR_ERR("Can not set UserID: %s", strerror(errno));
594   return 3;
595  }
596  clients_set_uid(g_self_client, getuid());
597 }
598
599 // start main loop...
600 main_loop(drvid, drvinst, &sa, sysclocksync);
601
602 // clean up.
603 clean_quit_prep();
604 driver_close(drvinst, drvid);
605 output_buffer_free();
606
607 return 0;
608}
609
610void cleanup_listen_socket (int terminate) {
611
612 if ( g_listen_socket != -1 ) {
613  close(g_listen_socket);
614
615  g_listen_socket = -1;
616
617  if ( *server == '/' )
618   unlink(server);
619 }
620
621 if ( terminate )
622  g_terminate = 1;
623}
624
625void clean_quit_prep (void) {
626 cleanup_listen_socket(0);
627
628 sources_free();
629 streams_free();
630 clients_free();
631 midi_cb_stop(); // stop console beep
632 midi_free();
633}
634
635void clean_quit (void) {
636 clean_quit_prep();
637// driver_close(drvinst, drvid);
638// output_buffer_free();
639 exit(0);
640}
641
642//ll
Note: See TracBrowser for help on using the repository browser.