dsp_tones.c (7a9787e1eba95a166265e6a260cf30af04ef0a99) | dsp_tones.c (bcf91745091ba3b0813fa79afb5d10b090ea745d) |
---|---|
1/* 2 * Audio support data for ISDN4Linux. 3 * 4 * Copyright Andreas Eversberg (jolly@eversberg.eu) 5 * 6 * This software may be used and distributed according to the terms 7 * of the GNU General Public License, incorporated herein by reference. 8 * --- 224 unchanged lines hidden (view full) --- 233 234struct pattern { 235 int tone; 236 u8 *data[10]; 237 u32 *siz[10]; 238 u32 seq[10]; 239} pattern[] = { 240 {TONE_GERMAN_DIALTONE, | 1/* 2 * Audio support data for ISDN4Linux. 3 * 4 * Copyright Andreas Eversberg (jolly@eversberg.eu) 5 * 6 * This software may be used and distributed according to the terms 7 * of the GNU General Public License, incorporated herein by reference. 8 * --- 224 unchanged lines hidden (view full) --- 233 234struct pattern { 235 int tone; 236 u8 *data[10]; 237 u32 *siz[10]; 238 u32 seq[10]; 239} pattern[] = { 240 {TONE_GERMAN_DIALTONE, |
241 {DATA_GA, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 242 {SIZE_GA, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 241 {DATA_GA, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 242 {SIZE_GA, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
243 {1900, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 244 245 {TONE_GERMAN_OLDDIALTONE, | 243 {1900, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 244 245 {TONE_GERMAN_OLDDIALTONE, |
246 {DATA_GO, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 247 {SIZE_GO, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 246 {DATA_GO, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 247 {SIZE_GO, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
248 {1998, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 249 250 {TONE_AMERICAN_DIALTONE, | 248 {1998, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 249 250 {TONE_AMERICAN_DIALTONE, |
251 {DATA_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 252 {SIZE_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 251 {DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 252 {SIZE_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 254 255 {TONE_GERMAN_DIALPBX, | 253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 254 255 {TONE_GERMAN_DIALPBX, |
256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, 0, 0, 0, 0}, 257 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, 0, 0, 0, 0}, | 256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL}, 257 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL}, |
258 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 259 260 {TONE_GERMAN_OLDDIALPBX, | 258 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 259 260 {TONE_GERMAN_OLDDIALPBX, |
261 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0}, 262 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0}, | 261 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL}, 262 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL}, |
263 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 264 265 {TONE_AMERICAN_DIALPBX, | 263 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 264 265 {TONE_AMERICAN_DIALPBX, |
266 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, 0, 0, 0, 0}, 267 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, 0, 0, 0, 0}, | 266 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, NULL}, 267 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, NULL}, |
268 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 269 270 {TONE_GERMAN_RINGING, | 268 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 269 270 {TONE_GERMAN_RINGING, |
271 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 272 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 271 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 272 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
273 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 274 275 {TONE_GERMAN_OLDRINGING, | 273 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 274 275 {TONE_GERMAN_OLDRINGING, |
276 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 277 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 276 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 277 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
278 {8000, 40000, 0, 0, 0, 0, 0, 0, 0, 0} }, 279 280 {TONE_AMERICAN_RINGING, | 278 {8000, 40000, 0, 0, 0, 0, 0, 0, 0, 0} }, 279 280 {TONE_AMERICAN_RINGING, |
281 {DATA_RI, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 282 {SIZE_RI, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 281 {DATA_RI, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 282 {SIZE_RI, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
283 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 284 285 {TONE_GERMAN_RINGPBX, | 283 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 284 285 {TONE_GERMAN_RINGPBX, |
286 {DATA_GA, DATA_S, DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0}, 287 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0}, | 286 {DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL}, 287 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL}, |
288 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 289 290 {TONE_GERMAN_OLDRINGPBX, | 288 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 289 290 {TONE_GERMAN_OLDRINGPBX, |
291 {DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0}, 292 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0}, | 291 {DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL}, 292 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL}, |
293 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 294 295 {TONE_AMERICAN_RINGPBX, | 293 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 294 295 {TONE_AMERICAN_RINGPBX, |
296 {DATA_RI, DATA_S, DATA_RI, DATA_S, 0, 0, 0, 0, 0, 0}, 297 {SIZE_RI, SIZE_S, SIZE_RI, SIZE_S, 0, 0, 0, 0, 0, 0}, | 296 {DATA_RI, DATA_S, DATA_RI, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL}, 297 {SIZE_RI, SIZE_S, SIZE_RI, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL}, |
298 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 299 300 {TONE_GERMAN_BUSY, | 298 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 299 300 {TONE_GERMAN_BUSY, |
301 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 302 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 301 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 302 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
303 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 304 305 {TONE_GERMAN_OLDBUSY, | 303 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 304 305 {TONE_GERMAN_OLDBUSY, |
306 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 307 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 306 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 307 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
308 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 309 310 {TONE_AMERICAN_BUSY, | 308 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 309 310 {TONE_AMERICAN_BUSY, |
311 {DATA_BU, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 312 {SIZE_BU, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 311 {DATA_BU, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 312 {SIZE_BU, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
313 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 314 315 {TONE_GERMAN_HANGUP, | 313 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 314 315 {TONE_GERMAN_HANGUP, |
316 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 317 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 316 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 317 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
318 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 319 320 {TONE_GERMAN_OLDHANGUP, | 318 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 319 320 {TONE_GERMAN_OLDHANGUP, |
321 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 322 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 321 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 322 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
323 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 324 325 {TONE_AMERICAN_HANGUP, | 323 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 324 325 {TONE_AMERICAN_HANGUP, |
326 {DATA_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 327 {SIZE_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 326 {DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 327 {SIZE_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
328 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 329 330 {TONE_SPECIAL_INFO, | 328 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 329 330 {TONE_SPECIAL_INFO, |
331 {DATA_S1, DATA_S2, DATA_S3, DATA_S, 0, 0, 0, 0, 0, 0}, 332 {SIZE_S1, SIZE_S2, SIZE_S3, SIZE_S, 0, 0, 0, 0, 0, 0}, | 331 {DATA_S1, DATA_S2, DATA_S3, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL}, 332 {SIZE_S1, SIZE_S2, SIZE_S3, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL}, |
333 {2666, 2666, 2666, 8002, 0, 0, 0, 0, 0, 0} }, 334 335 {TONE_GERMAN_GASSENBESETZT, | 333 {2666, 2666, 2666, 8002, 0, 0, 0, 0, 0, 0} }, 334 335 {TONE_GERMAN_GASSENBESETZT, |
336 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 337 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, | 336 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 337 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
338 {2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0} }, 339 340 {TONE_GERMAN_AUFSCHALTTON, | 338 {2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0} }, 339 340 {TONE_GERMAN_AUFSCHALTTON, |
341 {DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0}, 342 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0}, | 341 {DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL}, 342 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL}, |
343 {1000, 5000, 1000, 17000, 0, 0, 0, 0, 0, 0} }, 344 345 {0, | 343 {1000, 5000, 1000, 17000, 0, 0, 0, 0, 0, 0} }, 344 345 {0, |
346 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 347 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 346 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, 347 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, |
348 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 349}; 350 351/****************** 352 * copy tone data * 353 ******************/ 354 355/* an sk_buff is generated from the number of samples needed. --- 106 unchanged lines hidden (view full) --- 462 463 index++; 464 if (!pat->seq[index]) 465 index = 0; 466 tone->index = index; 467 468 /* set next tone */ 469 if (pat->data[index] == DATA_S) | 348 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 349}; 350 351/****************** 352 * copy tone data * 353 ******************/ 354 355/* an sk_buff is generated from the number of samples needed. --- 106 unchanged lines hidden (view full) --- 462 463 index++; 464 if (!pat->seq[index]) 465 index = 0; 466 tone->index = index; 467 468 /* set next tone */ 469 if (pat->data[index] == DATA_S) |
470 dsp_tone_hw_message(dsp, 0, 0); | 470 dsp_tone_hw_message(dsp, NULL, 0); |
471 else 472 dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index])); 473 /* set timer */ 474 init_timer(&tone->tl); 475 tone->tl.expires = jiffies + (pat->seq[index] * HZ) / 8000; 476 add_timer(&tone->tl); 477} 478 --- 73 unchanged lines hidden --- | 471 else 472 dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index])); 473 /* set timer */ 474 init_timer(&tone->tl); 475 tone->tl.expires = jiffies + (pat->seq[index] * HZ) / 8000; 476 add_timer(&tone->tl); 477} 478 --- 73 unchanged lines hidden --- |