오늘 가입한 리눅스 초보자인데요. 프로젝트 수행관련해서 질문드립니다.
SMDK2440A에 리눅스 2.6 커널을 올렸습니다.
제가 하고 싶은 건 mp3 파일을 디코드해서 실제 사운드를 내보내는 것입니다.
mp3 decoding은 libmad를 porting해서 pcm data를 만들건데,
decoding된 데이터를 내보내는 sound driver를 구현하자니 막막합니다.
예제로 볼수 있거나 실행가능한 smdk2440용 sound device driver code와 playing application 샘플에 대한 정보를 찾을만한 곳이 있을까요?
PDS에 비슷한 파일이 올려있는 것 같기는 한데 컴파일 방법이나 실행 방법에 대해 전혀 아이디어가 없어서요.... OTL
감사합니다.
oss.c 파일에서
audio_fd = open("/dev/dsp", O_RDONLY, 0);
if (audio_fd < 0)
{
printf("Cannot open /dev/dsp ==> open /dev/sound/dsp n");
audio_fd = open("/dev/sound/dsp", O_RDONLY, 0); // devfs때문
if (audio_fd < 0)
{
printf("Cannot open /dev/sound/dspn");
return -1;
}
}
이 부분 중 O_RDONLY를 O_WRONLY로 바꾸시고, oss_write함수를 쓰면 그냥 play가 가능합니다.
file에서 읽어서 넣어주면 됩니다.
ps> 물론 sound driver가 잡혀있어야 합니다.