2362N/A * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// The default buffer time 0N/A /*strncpy(description->description, desc.description, DAUDIO_STRING_LENGTH-1);*/ 0N/A /* hardcoded bits and channels */ 0N/A /* for querying sample rates */ 0N/A /* get sample rates */ 0N/A ERROR1(
" DAUDIO_GetFormats: AUDIO_MIXER_GET_SAMPLE_RATES failed for mixer %d!\n",
0N/A ERROR2(
" -> num_sample_rates=%d sample_rates[0] = %d\n",
0N/A /* Some Solaris 8 drivers fail for get sample rates! 0N/A * Do as if we support all sample rates 0N/A TRACE1(
" DAUDIO_GetFormats: floating sample rate allowed by mixer %d\n",
0N/A TRACE2(
" DAUDIO_GetFormats: more than %d formats. Use -1 for sample rates mixer %d\n",
0N/A * Fake it to have only one sample rate: -1 0N/A 0,
/* frameSize: let it be calculated */ 0N/A /* how many bytes were written or read */ 0N/A /* if transferedBytes exceed 32-bit boundary, 0N/A * it will be reset and positionOffset will receive 0N/A /* blackdown does not use NONBLOCK */ 0N/A /* set to multiple open */ 0N/A /* need AUDIO_GETINFO ioctl to get this to work on solaris x86 */ 0N/A /* not valid to call AUDIO_SETINFO ioctl with all the fields from AUDIO_GETINFO. */ 0N/A ERROR0(
"DAUDIO_Open: could not set info!\n");
0N/A TRACE2(
"DAUDIO: buffersize in bytes: requested=%d, got %d\n",
0N/A TRACE0(
"< DAUDIO_Open: Opened device successfully.\n");
0N/A /* if an underrun occured, reset */ 0N/A /* we will reset transferedBytes and 0N/A * the samples field in prinfo 0N/A /* reset error flag */ 0N/A /* upon exit of AUDIO_SETINFO, the samples parameter 0N/A * was set to the previous value. This is our 0N/A ERROR0(
"DAUDIO: resetErrorFlagAndAdjustPosition ioctl failed!\n");
0N/A// returns -1 on error 0N/A /* sets ret to -1 if buffer full, no error! */ 0N/A// returns -1 on error 0N/A /* sets ret to -1 if buffer full, no error! */ 0N/A /* check error flag */ 0N/A /*TRACE2("---> device paused: %d eof=%d\n", 0N/A prinfo->pause, prinfo->eof); 0N/A ERROR0(
"DAUDIO: getDevicePosition: ioctl failed!\n");
0N/A /* resets the transferedBytes parameter to 0N/A * the current samples count of the device 0N/A /* unfortunately, the STREAMS architecture 0N/A * seems to not have a method for querying 0N/A /* we usually have written more bytes 0N/A * to the queue than the device position should be 0N/A /* for record, the device stream should 0N/A * be usually ahead of our read actions 0N/A ERROR2(
"DAUDIO_GetAvailable: available=%d, too big at bufferSize=%d!\n",
0N/A ERROR2(
" devicePos=%d, transferedBytes=%d\n",
0N/A ERROR1(
"DAUDIO_GetAvailable: available=%d, in theory not possible!\n",
0N/A ERROR2(
" devicePos=%d, transferedBytes=%d\n",
0N/A //printf("getbyteposition: javaBytePos=%d , return=%d\n", (int) javaBytePos, (int) result); 0N/A // never need servicing on Solaris 0N/A // never need servicing on Solaris