diff options
author | Simon Wilson | 2011-10-13 15:57:25 -0500 |
---|---|---|
committer | Simon Wilson | 2011-10-14 11:39:00 -0500 |
commit | e9942c8b1fab1cea4836b5af2dd59a1bf0ad411d (patch) | |
tree | 038f26884056835eff415093b37a7bf773bc2b27 /include/tinyalsa/asoundlib.h | |
parent | 621047309242d04a6186230e7a337de8642ec754 (diff) | |
download | platform-external-tinyalsa-e9942c8b1fab1cea4836b5af2dd59a1bf0ad411d.tar.gz platform-external-tinyalsa-e9942c8b1fab1cea4836b5af2dd59a1bf0ad411d.tar.xz platform-external-tinyalsa-e9942c8b1fab1cea4836b5af2dd59a1bf0ad411d.zip |
Update to latest tinyalsa
6be28f1 pcm: add mmap playback and no periodic IRQ support.
fa0697e tinyplay: fix segfault caused by missing device argument
Change-Id: I22cf8f01eba21e42b4fa43cc5fd9edd2826f44fa
Diffstat (limited to 'include/tinyalsa/asoundlib.h')
-rw-r--r-- | include/tinyalsa/asoundlib.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/tinyalsa/asoundlib.h b/include/tinyalsa/asoundlib.h index 2e8c3e0..3c86c84 100644 --- a/include/tinyalsa/asoundlib.h +++ b/include/tinyalsa/asoundlib.h | |||
@@ -43,6 +43,19 @@ struct pcm; | |||
43 | 43 | ||
44 | #define PCM_OUT 0x00000000 | 44 | #define PCM_OUT 0x00000000 |
45 | #define PCM_IN 0x10000000 | 45 | #define PCM_IN 0x10000000 |
46 | #define PCM_MMAP 0x00000001 | ||
47 | #define PCM_NOIRQ 0x00000002 | ||
48 | |||
49 | /* PCM runtime states */ | ||
50 | #define PCM_STATE_OPEN 0 | ||
51 | #define PCM_STATE_SETUP 1 | ||
52 | #define PCM_STATE_PREPARED 2 | ||
53 | #define PCM_STATE_RUNNING 3 | ||
54 | #define PCM_STATE_XRUN 4 | ||
55 | #define PCM_STATE_DRAINING 5 | ||
56 | #define PCM_STATE_PAUSED 6 | ||
57 | #define PCM_STATE_SUSPENDED 7 | ||
58 | #define PCM_STATE_DISCONNECTED 8 | ||
46 | 59 | ||
47 | /* Bit formats */ | 60 | /* Bit formats */ |
48 | enum pcm_format { | 61 | enum pcm_format { |
@@ -99,10 +112,12 @@ int pcm_set_config(struct pcm *pcm, struct pcm_config *config); | |||
99 | /* Returns a human readable reason for the last error */ | 112 | /* Returns a human readable reason for the last error */ |
100 | const char *pcm_get_error(struct pcm *pcm); | 113 | const char *pcm_get_error(struct pcm *pcm); |
101 | 114 | ||
102 | /* Returns the buffer size (int bytes) that should be used for pcm_write. | 115 | /* Returns the buffer size (int frames) that should be used for pcm_write. |
103 | * This will be 1/2 of the actual fifo size. | 116 | * This will be 1/2 of the actual fifo size. |
104 | */ | 117 | */ |
105 | unsigned int pcm_get_buffer_size(struct pcm *pcm); | 118 | unsigned int pcm_get_buffer_size(struct pcm *pcm); |
119 | unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); | ||
120 | unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int frames); | ||
106 | 121 | ||
107 | /* Returns the pcm latency in ms */ | 122 | /* Returns the pcm latency in ms */ |
108 | unsigned int pcm_get_latency(struct pcm *pcm); | 123 | unsigned int pcm_get_latency(struct pcm *pcm); |
@@ -123,6 +138,14 @@ int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, | |||
123 | int pcm_write(struct pcm *pcm, void *data, unsigned int count); | 138 | int pcm_write(struct pcm *pcm, void *data, unsigned int count); |
124 | int pcm_read(struct pcm *pcm, void *data, unsigned int count); | 139 | int pcm_read(struct pcm *pcm, void *data, unsigned int count); |
125 | 140 | ||
141 | /* | ||
142 | * mmap() support. | ||
143 | */ | ||
144 | int pcm_mmap_write(struct pcm *pcm, void *data, unsigned int count); | ||
145 | int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, | ||
146 | unsigned int *frames); | ||
147 | int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames); | ||
148 | |||
126 | /* Start and stop a PCM channel that doesn't transfer data */ | 149 | /* Start and stop a PCM channel that doesn't transfer data */ |
127 | int pcm_start(struct pcm *pcm); | 150 | int pcm_start(struct pcm *pcm); |
128 | int pcm_stop(struct pcm *pcm); | 151 | int pcm_stop(struct pcm *pcm); |