From the manual of Sun Audio

http://docs.sun.com/app/docs/doc/816-5177/audio-7i?a=view

"
The audio_info_t structure may be initialized through the use of the AUDIO_INITINFO macro. This macro sets all fields in the structure to values that are ignored by the AUDIO_SETINFO command. For instance, the following code switches the output port from the built-in speaker to the headphone jack without modifying any other audio parameters:

audio_info_t    info;
AUDIO_INITINFO(&info);
info.play.port = AUDIO_HEADPHONE;
err = ioctl(audio_fd, AUDIO_SETINFO, &info);

This technique eliminates problems associated with using a sequence of AUDIO_GETINFO followed by AUDIO_SETINFO
"


So here is the patch .
please see the attachment.






Index: device/platform/unix/audSolaris.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/unix/audSolaris.cpp,v
retrieving revision 1.5.6.1
diff -u -r1.5.6.1 audSolaris.cpp
--- device/platform/unix/audSolaris.cpp	26 Oct 2006 19:35:59 -0000	1.5.6.1
+++ device/platform/unix/audSolaris.cpp	31 Oct 2008 09:48:28 -0000
@@ -427,15 +427,7 @@
 {
     HX_RESULT  retCode = RA_AOE_NOERR;
     audio_info stAudioInfo;
-
-    //Fill in the structure with current settings.
-    if (::ioctl(m_nMixerID, AUDIO_GETINFO, &stAudioInfo) < 0) 
-    {
-#ifdef _DEBUG        
-	fprintf( stderr, "CAudioOutSolaris: Can't get the audio configuration\n");
-#endif        
-	retCode = RA_AOE_NOTSUPPORTED;
-    }
+    AUDIO_INITINFO(&stAudioInfo);
 
     //Just change the gain setting. Must map incoming [0,100]-->[0,255]
     stAudioInfo.play.gain = (UINT16)((float)unVolume/100.0 *(float)(AUDIO_MAX_GAIN-AUDIO_MIN_GAIN) + AUDIO_MIN_GAIN + 0.5);
_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to