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.

100 lines
2.1KB

  1. /*
  2. OSS driver for Jack
  3. Copyright (C) 2003-2007 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 <sys/types.h>
  20. #include <pthread.h>
  21. #include <semaphore.h>
  22. #include <jack/types.h>
  23. #include <jack/jslist.h>
  24. #include <jack/driver.h>
  25. #include <jack/jack.h>
  26. #define OSS_DRIVER_DEF_DEV "/dev/dsp"
  27. #define OSS_DRIVER_DEF_FS 48000
  28. #define OSS_DRIVER_DEF_BLKSIZE 1024
  29. #define OSS_DRIVER_DEF_NPERIODS 2
  30. #define OSS_DRIVER_DEF_BITS 16
  31. #define OSS_DRIVER_DEF_INS 2
  32. #define OSS_DRIVER_DEF_OUTS 2
  33. typedef jack_default_audio_sample_t jack_sample_t;
  34. typedef struct _oss_driver
  35. {
  36. JACK_DRIVER_DECL
  37. jack_nframes_t sample_rate;
  38. jack_nframes_t period_size;
  39. unsigned int nperiods;
  40. int bits;
  41. unsigned int capture_channels;
  42. unsigned int playback_channels;
  43. char *indev;
  44. char *outdev;
  45. int infd;
  46. int outfd;
  47. int format;
  48. int ignorehwbuf;
  49. int trigger;
  50. size_t indevbufsize;
  51. size_t outdevbufsize;
  52. size_t portbufsize;
  53. void *indevbuf;
  54. void *outdevbuf;
  55. float iodelay;
  56. jack_time_t last_periodtime;
  57. jack_time_t next_periodtime;
  58. jack_nframes_t sys_in_latency;
  59. jack_nframes_t sys_out_latency;
  60. JSList *capture_ports;
  61. JSList *playback_ports;
  62. jack_engine_t *engine;
  63. jack_client_t *client;
  64. volatile int run;
  65. volatile int threads;
  66. pthread_t thread_in;
  67. pthread_t thread_out;
  68. pthread_mutex_t mutex_in;
  69. pthread_mutex_t mutex_out;
  70. # ifdef USE_BARRIER
  71. pthread_barrier_t barrier;
  72. # endif
  73. sem_t sem_start;
  74. } oss_driver_t;
  75. #endif