MP3 Player

From Jollen's Wiki

Jump to: navigation, search

1. 完成 JK2410-GPIO Driver

2. 測試開發板上的 madplay

3. 實作 player.c 呼叫外部 madplay 程式

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

int madplay_exec(void)
{
   char *arg_list[] = {		/* 外部程式參數列 (配合字尾 v) */
      "madplay",                     /* argv[0] 即程式名稱 */
      "test.mp3",
      NULL };			/* 以 NULL 為結尾 */

   execvp("madplay", arg_list);      /* 在 PATH 路徑尋找外部程式 */
}

4. 按下 S6 按鍵撥音樂實作

4.1 實作 blocking read

4.2 player.c 等候按鍵架構

read(fd, &c, 1);
madplay_exec();

5. 討論 system architecture (flow)

1. read(fd, &c, 1)

S1: read() wrapper routine -> syscall -> VFS -> fops->read -> process sleep
S2: S6 pressed -> interrupt handler -> wake up process

2. madplay_exec()

S3: madplay_exec() -> process replace with madplay -> libmad.so -> syscall -> VFS -> Audio driver
Views
個人工具
導航
工具