EBC Exercise 21 Running Audio and Video

From eLinux.org
Revision as of 13:28, 9 September 2011 by Yoder (Talk | contribs) (Initial page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Welcome to Audio and Video labs Parts a and b. In Part a, you will combine the audio loop-thru application with the video loop-thru application by running them from the Linux Bash terminal.

In Part b, you’ll programmatically combine these two applications, along with the video OSD application into a single (multi-threaded) application that handles all three data streams – audio, video, and OSD.

Part a – Run Audio and Video in Separate Processes

Build Audio Executable

  • Change to the lab06c_audio_loopthru directory from before.
  • Build the application using “make debug”.

This will build the debug version. Note, if you have problems building at this step, try cleaning, then building:

$ make clean
$ make debug
  • Use the Linux “mv” command to change the name of the app_DEBUG.Beagle application to app_AUDIO.

Build Video Executable

  • Change to the lab07d_video_loopthru directory then build the application.
$ make install

Run Audio and Video in Separate Processes

  • Execute the app_AUDIO application using the following command:
$ ./app_AUDIO &

Note, the trailing ampersand (&) in this command indicates that the application is to be run as a separate process. (In this case, our audio app will run in the terminal background, meaning that the terminal will remain open to new commands even while the application is executing.)

  • Execute the videoThru_DEBUG.Beagle application (the video loop-thru application) using the following command:
$ ./app_DEBUG.xv5T

You should now have both audio loop-thru and video loop-thru running concurrently on the board. They are running as concurrent, but separate, processes. In Part b we will use pthreads to run the audio and video loop-thru in parallel threads within the same process or application.

  • Halt the video loop-thru (running in the terminal foreground) by pressing Ctrl-C.
  • Use the following command to determine the process jobs number of the audio loop-thru, which is running in the terminal background:
$ jobs
  • Halt the audio loop-thru using the kill command and job number from the last step.
$ kill %1

Part a Question

  • Which scheduling policy is being used by each of the audio and video program processes(i.e. how is the thread within each process being scheduled)?

Part b - Audio and Video - same process