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

안녕하세요...

 

제가 지금 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
6368 Apple TV 온보드 메모리 변경 가능할까요? [1] 당그니 2011-01-20 94699
6367 android pwm backlight 밝기 제어 [4] 김태영 2011-07-28 54670
6366 com.google.android.maps.jar는 어디서 얻는 것인가요??? [2] 천동이 2014-09-02 52269
6365 USB bluetooth dongle on jellybean [4] 신현호 2014-02-21 50289
6364 우분투 리눅스 ip 변경 도중에 "No such process" [5] 이세종 2009-04-01 45629
6363 OpenOCD 0.2.0 [1] 김광준 2009-10-24 44382
6362 [질문]memset, mmap, memcpy에 대해서 질문 있습니다. [5] 이태간 2007-05-22 44344
6361 libpcap 설치 [1] Apostasy 2011-04-12 43522
6360 램디스크 파일 시스템 만들기 [4] sinwho 2015-08-19 43130
6359 USB 포팅관련 질문드립니다. [1] 김승한 2010-01-07 33284
6358 android에 libusb porting 해보신 분?? [2] 꿈의사람 2014-02-13 29612
6357 오드로이드 배터리 패치 문의 [1] 이종문 2010-07-01 29031
6356 ODROID-T 2.2 셧다운 후 부팅이 안됩니다. [2] shkim 2010-10-02 26865
6355 오드로이드 디버깅이 안되네요... [2] 현쓰 2010-02-01 26568
6354 [질문]wince 이미지 다운로드시 에러 [3] 이태간 2008-04-06 26265
6353 slide event에 따른 landscape & portrait mode 전환 [1] 나영찬 2010-03-25 24576
» Andorid ALSA에 관해서...2 [1] 꺼북이 2011-05-18 23893
6351 wm1811 드라이버를 찾아요 [9] 김민욱 2016-11-01 18718
6350 이더넷 핀에서 값을 읽어 오고 싶은데요... [2] rubio 2013-07-09 13050
6349 usb host api 가 리눅스단에서도 사용가능한가요? [1] biokk 2014-02-07 11392

사용자 로그인