66
66
fprintf(stderr, "no stream or set_parameters for output stream\n", err);
68
/* Not sure about this one */
69
idevice |= AUDIO_DEVICE_IN_VOICE_CALL;
69
71
if (!device->open_input_stream)
70
72
fprintf(stderr, "no open_input_stream\n");
96
98
fprintf(stderr, "Press Enter when you have finished your call.\n");
99
if (ostream && device && device->close_output_stream)
101
if (ostream && device && device->close_output_stream) {
102
fprintf(stderr, "Closing output stream\n");
100
103
device->close_output_stream(device, ostream);
104
fprintf(stderr, "Closed output stream\n");
102
if (istream && device && device->close_input_stream)
107
if (istream && device && device->close_input_stream) {
108
fprintf(stderr, "Closing input stream\n");
103
109
device->close_input_stream(device, istream);
105
if (device->set_mode)
110
fprintf(stderr, "Closed input stream\n");
113
if (device->set_parameters) {
114
fprintf(stderr, "Setting mode to normal through set_parameters (N4 workaround)\n");
115
err = device->set_parameters(device, "CALL_KEY=0;");
116
fprintf(stderr, "set_parameters returned %d\n", err);
119
if (device->set_mode) {
120
fprintf(stderr, "Setting mode to normal\n");
106
121
device->set_mode(device, AUDIO_MODE_NORMAL);
126
fprintf(stderr, "Closing audio HAL device\n");
109
127
audio_hw_device_close(device);
128
fprintf(stderr, "Audio HAL device closed.\n");