LECTURE 7 /dev/mixer ¤òÁàºî¤¹¤ë

¡û ¤Ï¤¸¤á¤Ë

LECTURE 6 /dev/mixer ¤Îµ¡Ç½¤òÄ´¤Ù¤ë ¤Ç¤Ï¡¢/dev/mixer ¤«¤é¤¤¤í¤¤¤í¤Ê¾ðÊó¤ò»²¾È¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤·¤¿¡£¤³¤³¤Ç¤Ï¡¢/dev/mixer ¤ËÂФ·¤Æ¥Ñ¥é¥á¡¼¥¿¤òÀßÄꤹ¤ëÊýË¡¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£¶ñÂÎŪ¤Ë¤Ï¡¢»ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤Î¥Ü¥ê¥å¡¼¥à ( ¥²¥¤¥ó¥ì¥Ù¥ë ) ÀßÄê¡¢¤ª¤è¤ÓÏ¿²»¸»¤È¤·¤Æ»ØÄꤹ¤ë¥Á¥ã¥ó¥Í¥ë¤ÎÀßÄêÊýË¡¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£

¡û ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à

/dev/mixer ¤òÁàºî¤·¤Æ¡¢»ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤Î¥Ü¥ê¥å¡¼¥à ( ¥²¥¤¥ó¥ì¥Ù¥ë ) ¤òÀßÄꤹ¤ë¡¢¤¢¤ë¤¤¤Ï»ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤òÏ¿²»¸»¤È¤·¤ÆÀßÄꤹ¤ë¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à mixer_set.c ¤Ç¤¹¡£¤Ï¤¸¤á¤Ë ¤Î¥Ú¡¼¥¸¤«¤é¡¢Á´¤Æ¤Î¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò¸Ç¤á¤¿ tar ¥Ü¡¼¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£

gcc -o mixer_set mixer_set.c

¤È¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó¤Ï³Æ¼«¤Î´Ä¶­¤Ê¤É¤Ë±þ¤¸¤Æ½¤Àµ¤·¤Æ²¼¤µ¤¤¡£

°ú¿ô¤ò²¿¤âÍ¿¤¨¤Ê¤¤¤Ç¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤ÎÍͤÊɽ¼¨¤¬½Ð¤Þ¤¹¡£

usage : mixer_set vol <channel name> <left volume> <right volume>
    or  mixer_set vol <channel name> <volume>
    or  mixer_set rec <channel name>

Âè 2 °ú¿ô¤ò vol ¤È¤·¤Æ¤¤¤ë¾å 2 ¤Ä¤Î¹Ô¤Ï¡¢channel ¤Ç»ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤Î¥Ü¥ê¥å¡¼¥à ( ¥²¥¤¥ó¥ì¥Ù¥ë ) ¤òÀßÄꤷ¤Þ¤¹¡£1 ÈÖ¾å¤Î¹Ô¤Ï¥¹¥Æ¥ì¥ª¥Á¥ã¥ó¥Í¥ë¤ËÂФ·¤Æº¸±¦¤Î¥²¥¤¥ó¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¾ì¹ç¡¢2 ÈÖÌܤιԤϥâ¥Î¥é¥ë¥Á¥ã¥ó¥Í¥ë¤ËÂФ·¤Æ¥²¥¤¥ó¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¾ì¹ç¤Ç¤¹¡£1 ÈÖ²¼¤Î¹Ô¤Ï¡¢channel ¤Ç»ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤òÏ¿²»¸»¤È¤·¤ÆÀßÄꤷ¤Þ¤¹¡£

channel ¤Ë¤Ï LECTURE 6 /dev/mixer ¤Îµ¡Ç½¤òÄ´¤Ù¤ë ¤ÇºîÀ®¤·¤¿ mixer_test ¤ò¼Â¹Ô¤·¤¿ºÝ¤Ë¡¢Channel Name ¤ÎÎó¤Ëɽ¼¨¤µ¤ì¤ë̾¾Î¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥²¥¤¥ó¥ì¥Ù¥ë¤Ï 0 ¡Á 100 ¤Î¿ôÃͤò»ØÄꤷ¤Æ²¼¤µ¤¤¡£mixer_set ¤ò¼Â¹Ô¤·¤¿¸å¤Ï¡¢mixer_test ¤ÇÀßÄꤷ¤¿ÆâÍƤ¬È¿±Ç¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«³Îǧ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

--- mixer_set.c ---

    1	#include <fcntl.h>
    2	#include <linux/soundcard.h>
    3	#include <stdio.h>
    4	#include <stdlib.h>
    5	#include <string.h>
    6	#include <sys/ioctl.h>
    7	#include <unistd.h>
    8	
    9	
   10	int 
   11	main( int argc, char** argv )
   12	{
   13		int fd;
   14		int channel, level, mask;
   15		int i;
   16	
   17		/* soundcard.h ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Á¥ã¥ó¥Í¥ë̾¾Î */
   18		const char* sound_device_names[] = SOUND_DEVICE_NAMES;
   19	
   20		if ( argc < 3 || argc > 5 ) {
   21			printf( "usage : mixer_set vol <channel name> <left volume>"
   22				" <right volume>\n" );
   23			printf( "    or  mixer_set vol <channel name> <volume>\n" );
   24			printf( "    or  mixer_set rec <channel name>\n" );
   25			return 1;
   26		}
   27	
   28	
   29		/* ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Á¥ã¥ó¥Í¥ë¤Î¿ô¤À¤±¥ë¡¼¥× */
   30		for ( i = 0; i < SOUND_MIXER_NRDEVICES; i ++ ) {
   31			if ( strcmp( argv[2], sound_device_names[i] ) == 0 ) {
   32				channel = i;
   33				break;
   34			}
   35		}
   36	    
   37		/* »ØÄꤷ¤¿¥Ç¥Ð¥¤¥¹Ì¾¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤ */
   38		if ( i == SOUND_MIXER_NRDEVICES ) {
   39			printf( "specified channel is not defined\n" );
   40			return 1;
   41		}
   42	
   43		/* write() ¤Ç½ñ¤­¹þ¤à¤ï¤±¤¸¤ã¤Ê¤¤¤Î¤Ç¤³¤ì¤ÇÎɤ¤ */
   44		if ( ( fd = open( "/dev/mixer", O_RDONLY ) ) == -1 ) {
   45			perror( "open" );
   46			return 1;
   47		}
   48	
   49		/* ¥Ü¥ê¥å¡¼¥à¤ÎÀßÄê */
   50		if ( strcmp( argv[1], "vol" ) == 0 ) {
   51			/* ¥Ü¥ê¥å¡¼¥à¤Î¥¨¥ó¥³¡¼¥É */
   52			if ( argc == 4 ) {
   53				level =   atoi( argv[3] );
   54			}
   55			else if ( argc == 5 ) {
   56				level = ( atoi( argv[4] ) << 8 ) | atoi( argv[3] );
   57			}
   58	
   59			/* ¥Ç¥Ð¥¤¥¹¤Ë¥Ü¥ê¥å¡¼¥à¤òÀßÄꤹ¤ë */
   60			if ( ioctl( fd, MIXER_WRITE( channel ), &level ) == -1 ) {
   61				perror( "ioctl(MIXER_WRITE())" );
   62				close( fd );
   63				return 1;
   64			}
   65		}
   66		else if ( strcmp( argv[1], "rec" ) == 0 ) {
   67			/* Ï¿²»¸»¤ÎÀßÄê */
   68			mask = ( 1 << channel );
   69	
   70			if ( ioctl( fd, SOUND_MIXER_WRITE_RECSRC, &mask ) == -1 ) {
   71				perror( "ioctl(SOUND_MIXER_WRITE_RECSRC)" );
   72				close( fd );
   73				return 1;
   74			}
   75		}
   76	
   77		close( fd );
   78		return 0;
   79	}
   80	
   81	/* End of mixer_set.c */


¡û ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ÎÀâÌÀ

¤Ç¤Ï¡¢¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤¤¤­¤Þ¤¹¡£

  • 17 ¡Á 18 ¹ÔÌÜ

    Á°²ó¤ÈƱ¤¸Íͤˡ¢¥ß¥­¥µ¡¼¤Ç°·¤¦¤³¤È¤Î¤Ç¤­¤ë¥Á¥ã¥ó¥Í¥ë¤Î̾¾Î¤ÎÇÛÎó¤È¤·¤Æ <linux/soundcard.h> ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë SOUND_DEVICE_NAMES ¤ò char* ¤ÎÇÛÎó¤È¤·¤ÆÍøÍѤǤ­¤ëÍͤˤ·¤Æ¤¤¤Þ¤¹¡£

  • 29 ¡Á 41 ¹ÔÌÜ

    ¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÂè 2 °ú¿ô¤Ç»ØÄꤵ¤ì¤¿¥Á¥ã¥ó¥Í¥ë̾¾Î¤ÈSOUND_DEVICE_NAMES ¤ÎÆâÍƤòÈæ³Ó¤·¤Æ¡¢ °ìÃפ¹¤ë¤â¤Î¤¬¤¢¤ë¤«¤É¤¦¤«Ãµ¤·¤Æ¤¤¤Þ¤¹¡£°ìÃפ¹¤ë̾¾Î¤¬Ìµ¤¤¾ì¹ç¤Ï½ªÎ»¤·¤Þ¤¹¡£ °ìÃפ¹¤ë̾¾Î¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤ÎÍ×ÁÇÈÖ¹æ¤ò¸å¤Ç»ÈÍѤ¹¤ë¤¿¤á¤ËÊݸ¤·¤Æ¤ª¤­¤Þ¤¹¡£

  • 43 ¡Á 47 ¹ÔÌÜ

    »ØÄꤵ¤ì¤¿¥Á¥ã¥ó¥Í¥ë̾¾Î¤¬Â¸ºß¤¹¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤«¤é¥ß¥­¥µ¡¼¥Ç¥Ð¥¤¥¹¤ò open() ¤·¤Æ¤¤¤Þ¤¹¡£ write() ¤Ç½ñ¤­¹þ¤à¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢O_RDONLY ( Æɤ߹þ¤ßÀìÍÑ ) ¤Ç³«¤¤¤Æ¤¤¤Þ¤¹¡£

  • 49 ¡Á 65 ¹ÔÌÜ

    ¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÂè 3 °ú¿ô¤Ë vol ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¥²¥¤¥ó¥ì¥Ù¥ë¤ÎÀßÄê¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£ ¥â¥Î¥é¥ë¥Á¥ã¥ó¥Í¥ëÍѤˤϡ¢»ØÄꤵ¤ì¤¿¥²¥¤¥ó¥ì¥Ù¥ë¤ò¤½¤Î¤Þ¤Þ»ÈÍѤ·¤Þ¤¹¡£ ¥¹¥Æ¥ì¥ª¥Á¥ã¥ó¥Í¥ë¤ËÂФ·¤ÆÀßÄꤹ¤ë¾ì¹ç¤Ï¡¢±¦¥Á¥ã¥ó¥Í¥ëÍѤΥì¥Ù¥ë¤ò¾å°Ì 8 ¥Ó¥Ã¥È¤Ë¡¢ º¸¥Á¥ã¥ó¥Í¥ëÍѤΥì¥Ù¥ë¤ò²¼°Ì 8 ¥Ó¥Ã¥È¤Ë¥¨¥ó¥³¡¼¥É¤·¤Þ¤¹¡£

    ioctl() ¤ÎÂè 2 °ú¿ô¤Ë¥²¥¤¥ó¥ì¥Ù¥ë¤òÀßÄꤷ¤¿¤¤¥Á¥ã¥ó¥Í¥ë¤Ë±þ¤¸¤¿Äê¿ô¤òÀßÄꤷ¤Þ¤¹¡£ mixer_set.c ¤Ç¤Ï¡¢¥Á¥ã¥ó¥Í¥ë̾¾Î¤ò¸¡º÷¤·¤¿ºÝ¤ËÊݸ¤·¤Æ¤ª¤¤¤¿Í×ÁÇÈÖ¹æ¤ò MIXER_WRITE() ¥Þ¥¯¥í¤Ë»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£¤³¤ÎÍ×ÁÇÈÖ¹æ¤Ï¡¢¥Á¥ã¥ó¥Í¥ë̾¾Î¤ËÂбþ¤·¤¿Äê¿ô¤È¤·¤Æ <linux/soundcard.h> ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢MIXER_WRITE( ... ) ¤Î¥Þ¥¯¥í¤½¤Î¤â¤Î¤â Äê¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ °Ê²¼¤Ë¤½¤Î°ìÍ÷¤ò¼¨¤·¤Þ¤¹¡£

    Äê¿ô̾¥Á¥ã¥ó¥Í¥ëMIXER_WRITE ¤ò»È¤Ã¤¿É½¸½
    SOUND_MIXER_WRITE_VOLUME ¥á¥¤¥ó¥Ü¥ê¥å¡¼¥à MIXER_WRITE( SOUND_MIXER_VOLUME )
    SOUND_MIXER_WRITE_BASS Äã²»°è MIXER_WRITE( SOUND_MIXER_BASS )
    SOUND_MIXER_WRITE_TREBLE ¹â²»°è MIXER_WRITE( SOUND_MIXER_TREBLE )
    SOUND_MIXER_WRITE_SYNTH FM ¥·¥ó¥»¥µ¥¤¥¶ MIXER_WRITE( SOUND_MIXER_SYNTH )
    SOUND_MIXER_WRITE_PCM D/A ÊÑ´¹´ï MIXER_WRITE( SOUND_MIXER_PCM )
    SOUND_MIXER_WRITE_SPEAKER PC ¥¹¥Ô¡¼¥«½ÐÎÏ MIXER_WRITE( SOUND_MIXER_SPEAKER )
    SOUND_MIXER_WRITE_LINE ¥é¥¤¥óÆþÎÏ MIXER_WRITE( SOUND_MIXER_LINE )
    SOUND_MIXER_WRITE_MIC ¥Þ¥¤¥¯ÆþÎÏ MIXER_WRITE( SOUND_MIXER_MIC )
    SOUND_MIXER_WRITE_CD CD ÆþÎÏ MIXER_WRITE( SOUND_MIXER_CD )
    SOUND_MIXER_WRITE_IMIX Ï¿²»¸»¤«¤é¤ÎºÆÀ¸¥Ü¥ê¥å¡¼¥à MIXER_WRITE( SOUND_MIXER_IMIX )
    SOUND_MIXER_WRITE_ALTPCM Âè 2 D/A ÊÑ´¹´ï MIXER_WRITE( SOUND_MIXER_ALTPCM )
    SOUND_MIXER_WRITE_RECLEV ¥á¥¤¥óÏ¿²»¥ì¥Ù¥ë MIXER_WRITE( SOUND_MIXER_RECLEV )
    SOUND_MIXER_WRITE_IGAIN ÆþÎÏ¥²¥¤¥ó MIXER_WRITE( SOUND_MIXER_IGAIN )
    SOUND_MIXER_WRITE_OGAIN ½ÐÎÏ¥²¥¤¥ó MIXER_WRITE( SOUND_MIXER_OGAIN )
    SOUND_MIXER_WRITE_LINE1 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 1 MIXER_WRITE( SOUND_MIXER_LINE1 )
    SOUND_MIXER_WRITE_LINE2 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 2 MIXER_WRITE( SOUND_MIXER_LINE2 )
    SOUND_MIXER_WRITE_LINE3 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 3 MIXER_WRITE( SOUND_MIXER_LINE3 )

    ¤³¤Î¾¤Î¥Á¥ã¥ó¥Í¥ë¤Ë´Ø¤·¤Æ¤Ï¡¢ËͤδĶ­²¼¤Ç¤ÏÄê¿ô¤¬¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£

    Âè 3 °ú¿ô¤ËÀßÄꤷ¤¿¤¤¥²¥¤¥ó¥ì¥Ù¥ë¤ò¥¨¥ó¥³¡¼¥É¤·¤¿ÊÑ¿ô¤Î¥Ý¥¤¥ó¥¿¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤È¡¢ »ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤ËÂФ·¤Æ¥²¥¤¥ó¥ì¥Ù¥ë¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢ Êѹ¹¸å¤ÎÃͤ¬Âè 3 °ú¿ô¤ÎÊÑ¿ô¤ËÀßÄꤵ¤ì¤Þ¤¹¡£

    int level;
    ioctl( fd, SOUND_MIXER_WRITE_XXX, &level );
    
    

  • 66 ¡Á 75 ¹ÔÌÜ

    ¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÂè 2 °ú¿ô¤Ë rec ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ËÏ¿²»¸»¤ÎÀßÄê¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£ ¥Á¥ã¥ó¥Í¥ë̾¾Î¤ò¸¡º÷¤·¤¿»þ¤ËÊݸ¤·¤Æ¤ª¤¤¤¿Í×ÁÇÈÖ¹æ¤ËÂбþ¤¹¤ë¥Ó¥Ã¥È¤ò 1 ¤ËÀßÄꤷ¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯¤òºîÀ®¤·¤Þ¤¹¡£¤³¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ë¤â¤ä¤Ï¤êÄê¿ô̾¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ LECTURE 6 /dev/mixer ¤Îµ¡Ç½¤òÄ´¤Ù¤ë ¤Î 55 ¡Á 59 ¹ÔÌܤÎÀâÌÀ¤Ç¤âƱ¤¸¤â¤Î¤òµ­½Ò¤·¤Æ¤¤¤Þ¤¹¤¬¡¢ºÆÅÙ²¼µ­¤ËºÜ¤»¤Þ¤¹¡£

    Äê¿ô̾¥Á¥ã¥ó¥Í¥ëSOUND_MIXER_...¤ò»È¤Ã¤¿ÊÌɽ¸½
    SOUND_MASK_VOLUME ¥á¥¤¥ó¥Ü¥ê¥å¡¼¥à ( 1 << SOUND_MIXER_VOLUME )
    SOUND_MASK_BASS Äã²»°è ( 1 << SOUND_MIXER_BASS )
    SOUND_MASK_TREBLE ¹â²»°è ( 1 << SOUND_MIXER_TREBLE )
    SOUND_MASK_SYNTH FM ¥·¥ó¥»¥µ¥¤¥¶ ( 1 << SOUND_MIXER_SYNTH )
    SOUND_MASK_PCM D/A ÊÑ´¹´ï ( 1 << SOUND_MIXER_PCM )
    SOUND_MASK_SPEAKER PC ¥¹¥Ô¡¼¥«½ÐÎÏ ( 1 << SOUND_MIXER_SPEAKER )
    SOUND_MASK_LINE ¥é¥¤¥óÆþÎÏ ( 1 << SOUND_MIXER_LINE )
    SOUND_MASK_MIC ¥Þ¥¤¥¯ÆþÎÏ ( 1 << SOUND_MIXER_MIC )
    SOUND_MASK_CD CD ÆþÎÏ ( 1 << SOUND_MIXER_CD )
    SOUND_MASK_IMIX Ï¿²»¸»¤«¤é¤ÎºÆÀ¸¥Ü¥ê¥å¡¼¥à ( 1 << SOUND_MIXER_IMIX )
    SOUND_MASK_ALTPCM Âè 2 D/A ÊÑ´¹´ï ( 1 << SOUND_MIXER_ALTPCM )
    SOUND_MASK_RECLEV ¥á¥¤¥óÏ¿²»¥ì¥Ù¥ë ( 1 << SOUND_MIXER_RECLEV )
    SOUND_MASK_IGAIN ÆþÎÏ¥²¥¤¥ó ( 1 << SOUND_MIXER_IGAIN )
    SOUND_MASK_OGAIN ½ÐÎÏ¥²¥¤¥ó ( 1 << SOUND_MIXER_OGAIN )
    SOUND_MASK_LINE1 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 1 ( 1 << SOUND_MIXER_LINE1 )
    SOUND_MASK_LINE2 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 2 ( 1 << SOUND_MIXER_LINE2 )
    SOUND_MASK_LINE3 ¥«¡¼¥ÉÀìÍÑÆþÎϸ» 3 ( 1 << SOUND_MIXER_LINE3 )
    SOUND_MASK_DIGITAL1¥Ç¥¸¥¿¥ëÆþÎÏ 1 ( 1 << SOUND_MIXER_DIGITAL1 )
    SOUND_MASK_DIGITAL2¥Ç¥¸¥¿¥ëÆþÎÏ 2 ( 1 << SOUND_MIXER_DIGITAL2 )
    SOUND_MASK_DIGITAL3¥Ç¥¸¥¿¥ëÆþÎÏ 3 ( 1 << SOUND_MIXER_DIGITAL3 )
    SOUND_MASK_PHONEIN PHONE ÆþÎÏ ( 1 << SOUND_MIXER_PHONEIN )
    SOUND_MASK_PHONEOUTPHONE ½ÐÎÏ ( 1 << SOUND_MIXER_PHONEOUT )
    SOUND_MASK_VIDEO ¥Ó¥Ç¥ª / TV (²»À¼) ÆþÎÏ ( 1 << SOUND_MIXER_RADIO )
    SOUND_MASK_RADIO ¥é¥¸¥ªÆþÎÏ ( 1 << SOUND_MIXER_VIDEO )
    SOUND_MASK_MONITOR ¥â¥Ë¥¿¡¼¤Î¥Ü¥ê¥å¡¼¥à ( 1 << SOUND_MIXER_MONITOR )

    ioctl() ¤ÎÂè 2 °ú¿ô¤Ë SOUND_MIXER_WRITE_RECSRC ¤â¤·¤¯¤Ï MIXER_WRITE( SOUND_MIXER_RECSRC ) ¤òÀßÄꤷ¤Þ¤¹ ( SOUND_MIXER_WRITE_RECSRC ¤Ï MIXER_WRITE( SOUND_MIXER_RECSRC ) ¤Î¥¨¥¤¥ê¥¢¥¹ )¡£

    Âè 3 °ú¿ô¤ËÀèÄøºîÀ®¤·¤¿¥Ó¥Ã¥È¥Þ¥¹¥¯ÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÀßÄꤷ¤Æ ioctl() ¤ò¼Â¹Ô¤¹¤ë¤È¡¢ »ØÄꤷ¤¿¥Á¥ã¥ó¥Í¥ë¤¬Ï¿²»¸»¤È¤·¤ÆÀßÄꤵ¤ì¤Þ¤¹ ( ¼ÂºÝ¤Ë»ÈÍѤǤ­¤Ê¤¯¤Æ¤âÀßÄê¤Ç¤­¤ë¤«¤â¤·¤ì¤Þ¤»¤ó )¡£ ¼Â¹Ô¸å¤Ë¤Ï¼ÂºÝ¤ËÀßÄꤵ¤ì¤¿¥Á¥ã¥ó¥Í¥ë¤òɽ¤¹¥Ó¥Ã¥È¥Þ¥¹¥¯¤¬¡¢Âè 3 °ú¿ô¤ËÀßÄꤵ¤ì¤ë¡£¡£¡£ ¤È»×¤¤¤Þ¤¹ ( m(__)m Á°²óÀâÌÀ¤·¤¿ ioctl( SOUND_MIXER_READ_RECSRC ) ¤ò»È¤¨¤Ðʬ¤«¤ê¤Þ¤¹¤è¤Í¤Ã ! )

    ¤Ê¤ª¡¢Á´¤Æ¤Î¥Ó¥Ã¥È¤ò 0 ¤Ë¤·¤¿¤Þ¤Þ¤Ç ioctl() ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢¥Þ¥¤¥¯ÆþÎϤ¬Í­¸ú¤Ë¤Ê¤ëÍͤǤ¹¡£


mixer_set.c ¤ÎÀâÌÀ¤Ï°Ê¾å¤Ç¤¹¡£OSS API ¼«ÂΤÎÀâÌÀ¤Ïº£²ó¤Þ¤Ç¤Ç½ª¤ê¤Ç¤¹¡£¼¡²ó¤«¤é¤Ï API ¤Î»È¤¤Êý¤Ç¤Ï¤Ê¤¯¡¢²»¤ÇÍ·¤ó¤Ç¤¤¤­¤¿¤¤¤È»×¤¤¤Þ¤¹¡£¤Ç¤­¤ë¸Â¤êÁ᤯¡£¡£¡£m(__)m