static int usecnt;
static int silencesuppression = 0;
static int silencethreshold = 1000;
+static int playbackonly = 0;
AST_MUTEX_DEFINE_STATIC(usecnt_lock);
return 0;
/* Stop any currently playing sound */
cursound = -1;
- if (!full_duplex) {
+ if (!full_duplex && !playbackonly) {
/* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
+ to honor immediate needs if necessary. But if we are in play
+ back only mode, then we don't switch because the console
+ is only being used one way -- just to playback something. */
res = soundcard_setinput(1);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set device to input mode\n");
strncpy(language, v->value, sizeof(language)-1);
else if (!strcasecmp(v->name, "extension"))
strncpy(exten, v->value, sizeof(exten)-1);
+ else if (!strcasecmp(v->name, "playbackonly"))
+ playbackonly = ast_true(v->value);
v=v->next;
}
ast_destroy(cfg);
; but your mileage may vary. Use the echo test to evaluate the best setting.
;silencesuppression = yes
;silencethreshold = 1000
+;
+; On half-duplex cards, the driver attempts to switch back and forth between
+; read and write modes. Unfortunately, this fails sometimes on older hardware.
+; To prevent the driver from switching (ie. only play files on your speakers),
+; then set the playbackonly option to yes. Default is no. Note this option has
+; no effect on full-duplex cards.
+;playbackonly=no