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.

94 lines
2.0KB

  1. /*
  2. OSS driver for Jack
  3. Copyright (C) 2003-2004 Jussi Laako <jussi@sonarnerd.net>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 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 General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  15. MA 02111-1307 USA
  16. */
  17. #ifndef __JACK_OSS_DRIVER_H__
  18. #define __JACK_OSS_DRIVER_H__
  19. #include <pthread.h>
  20. #include <semaphore.h>
  21. #include <jack/types.h>
  22. #include <jack/jslist.h>
  23. #include <jack/driver.h>
  24. #include <jack/jack.h>
  25. #define OSS_DRIVER_DEF_DEV "/dev/dsp"
  26. #define OSS_DRIVER_DEF_FS 48000
  27. #define OSS_DRIVER_DEF_BLKSIZE 1024
  28. #define OSS_DRIVER_DEF_BITS 16
  29. #define OSS_DRIVER_DEF_INS 2
  30. #define OSS_DRIVER_DEF_OUTS 2
  31. typedef jack_default_audio_sample_t jack_sample_t;
  32. typedef struct _oss_driver
  33. {
  34. JACK_DRIVER_DECL
  35. jack_nframes_t sample_rate;
  36. jack_nframes_t period_size;
  37. int bits;
  38. unsigned int capture_channels;
  39. unsigned int playback_channels;
  40. char *indev;
  41. char *outdev;
  42. int infd;
  43. int outfd;
  44. int format;
  45. int ignorehwbuf;
  46. size_t indevbufsize;
  47. size_t outdevbufsize;
  48. size_t portbufsize;
  49. void *indevbuf;
  50. void *outdevbuf;
  51. float iodelay;
  52. jack_time_t last_periodtime;
  53. jack_time_t next_periodtime;
  54. JSList *capture_ports;
  55. JSList *playback_ports;
  56. jack_engine_t *engine;
  57. jack_client_t *client;
  58. volatile int run;
  59. volatile int threads;
  60. pthread_t thread_in;
  61. pthread_t thread_out;
  62. pthread_mutex_t mutex_in;
  63. pthread_mutex_t mutex_out;
  64. # ifdef USE_BARRIER
  65. pthread_barrier_t barrier;
  66. # endif
  67. sem_t sem_start;
  68. } oss_driver_t;
  69. #endif