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

안녕하세요...

 

제가 지금 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

Apple TV 온보드 메모리 변경 가능할까요? [1]

android pwm backlight 밝기 제어 [4]

com.google.android.maps.jar는 어디서 얻는 것인가요??? [2]

USB bluetooth dongle on jellybean [4]

우분투 리눅스 ip 변경 도중에 "No such process" [5]

OpenOCD 0.2.0 [1]

[질문]memset, mmap, memcpy에 대해서 질문 있습니다. [5]

libpcap 설치 [1]

램디스크 파일 시스템 만들기 [4]

  • sinwho
  • 2015-08-19
  • 조회 수 43316

USB 포팅관련 질문드립니다. [1]

android에 libusb porting 해보신 분?? [2]

오드로이드 배터리 패치 문의 [1]

ODROID-T 2.2 셧다운 후 부팅이 안됩니다. [2]

  • shkim
  • 2010-10-02
  • 조회 수 26870

오드로이드 디버깅이 안되네요... [2]

  • 현쓰
  • 2010-02-01
  • 조회 수 26578

[질문]wince 이미지 다운로드시 에러 [3]

slide event에 따른 landscape & portrait mode 전환 [1]

Andorid ALSA에 관해서...2 [1]

wm1811 드라이버를 찾아요 [9]

이더넷 핀에서 값을 읽어 오고 싶은데요... [2]

  • rubio
  • 2013-07-09
  • 조회 수 13050

usb host api 가 리눅스단에서도 사용가능한가요? [1]

  • biokk
  • 2014-02-07
  • 조회 수 11392

사용자 로그인