기존 이솝 임베디드 포럼의 지식인 서비스가 게시판 형태로 변경되었습니다.

안녕하세요...

 

제가 지금 AudioFlinger에서 Har 단 연결 부분을 보고 있는데요....

이 부분에  

 int err = hw_get_module(ALSA_HARDWARE_MODULE_ID,
            (hw_module_t const**)&module);

 

라는 구문이 있더라구요....구글링을 해보니...

 

hw_get_module()함수를 사용하여 "alsa"라는 이름을 가진  module을 가져온다.

err = module->methods->open(module, ALSA_HARDWARE_NAME, &device);
==> module의 open함수를 실행하면 driver의 구조체를 획득할 수 있다.

 

뭐 이렇게 말하는데...도무지 제 실력으로는 감이 안 옵니다..

 

여기서 말하는 hw_module_t 구조체의 맵버들의 의미를 알게 되면 어느 정도 궁금증이 해소 될 듯한데요...

특히, audio Flinger와 har 연결 부분에 왜 이 구문이 등장하는지.... 원....

 

다음,,,hw_module_t 구조체 입니다... 각 맵버들의 의미를  아시는 분 설명 좀 부탁 드려요..

typedef struct hw_module_t {
    /** tag must be initialized to HARDWARE_MODULE_TAG */
    uint32_t tag;

    /** major version number for the module */
    uint16_t version_major;

    /** minor version number of the module */
    uint16_t version_minor;

    /** Identifier of module */
    const char *id;

    /** Name of this module */
    const char *name;

    /** Author/owner/implementor of the module */
    const char *author;

    /** Modules methods */
    struct hw_module_methods_t* methods;

    /** module's dso */
    void* dso;

    /** padding to 128 bytes, reserved for future use */
    uint32_t reserved[32-7];

} hw_module_t;

typedef struct hw_module_methods_t {
    /** Open a specific device */
    int (*open)(const struct hw_module_t* module, const char* id,
            struct hw_device_t** device);

} hw_module_methods_t;


고도리

2011.05.19 09:40:06
*.200.239.234

워낙 다양하게 적용되도록 구성이 된 structure입니다.


소스를 그냥 분석하시는게 가장 빠를 듯 하고요.

간단하게 말씀드리면.....


case by case입니다.


관련 소스는


hardware/libhardware/hardware.c와

hardware/libhardware/modules/overlay/overlay.cpp


를 참고하시면 될겁니다.

List of Articles
번호 제목 글쓴이 날짜sort 조회 수
1808 커널 이미지(zImage) 올린 후 부팅 실패 (Uncompressing Linux....) file [1] heave_n 2011-05-12 1702
1807 카메라 포팅에서 꽉 막혀있습니다. [1] 한승우 2011-05-13 527
1806 gpe x-windows filesystem을 nand에 기록해서 부팅시 에러가 납니다 [2] 오형호 2011-05-13 800
1805 u-boot-1.3.4 관련 [1] 고봉석 2011-05-13 534
1804 [질문]안드로이드 커널 컴파일 시에 드라이버 모듈(Host)이 포함 방... kieslv 2011-05-14 653
1803 u-boot-1.3.4-aesop.100428 관련 [1] 고봉석 2011-05-15 527
1802 u - boot 에서 usb 메모리 스틱을 읽으려고 하고 있습니다 [2] 우르멜 2011-05-15 741
1801 framework hardware 라이브러리 load시 HMI 를 찾네요?? [1] 휘오른 2011-05-16 797
1800 s5pc110 회로도 구할 수 없을까요? [1] 최원철 2011-05-16 479
1799 TI Davinci 칩셋 사용해보신분 계신가요? [1] 파일럿 2011-05-16 502
1798 보드에 nfs클라이언트 설치 [1] jjmusic 2011-05-16 494
1797 SDD 하드를 연결할 수 있는 ARM CPU [4] norway 2011-05-17 1007
1796 낸드 플레쉬의 연속된 배드 블럭처리는?? [1] 김영일 2011-05-17 595
1795 quick boot에 대해서 문의 드립니다. [2] 해돌이 2011-05-17 706
1794 h264 프레임 손실을 처리하려 합니다 [2] 니쿠큐 2011-05-18 574
1793 newfs_msdos format 에러 발생 데카 2011-05-18 636
1792 gccmakedep: Command not found [1] 황순일 2011-05-18 554
» Andorid ALSA에 관해서...2 [1] 꺼북이 2011-05-18 24086
1790 음성통화 관련 [1] norway 2011-05-18 486
1789 uboot에서 fastboot로 userdata 다운로드 할 때 movinand로 가능? [1] 텡구 2011-05-19 1179

사용자 로그인