ENSC 351 Assignment 3 Marking Guide Assignment must be done individually or in pairs. Total: [100] Marks [10] Design/Style • Use good style ◦ All modules, files, functions, and variables are named well ◦ All .h files have a comment at the top ◦ All code has excellent indentation (You don’t need to match the course’s style guide, you just need to write beautiful code) • Have a clean modular design: ◦ No externally linked global variables ◦ Functions meant to be used by other modules are externally linked and listed in .h file ◦ Functions not meant to be used by other modules are internally linked ◦ Thread IDs and mutextes are encapsulated inside modules (not available from other modules) ◦ Multiple modules, each with its own .h and .c file. Expected ~5 to ~20 modules (each with a .h/.c file). • Be multi-threaded and threadsafe (no race-cases; use mutexes to protect critical sections) • Use no busy waits (use sleep() or mutexes instead) • Be written in C, or Rust (requires guidance to TAs for compiling and running) • Use a makefile to build your application and copy it to $(HOME)/cmpt433/public/myApps/light_sampler [35] Beat generation and Audio playback [20] Smooth audio playback (required to get other marks for beat/buttons!) - Playback without audio-timeouts (when not under valgrind) - Sound is audible, sounds good, and no jitter [10] Generate given rock beat [5] Generate 2nd drum beat [5] Quit on 'Q' - Smooth shutdown. OK if it takes a moment for all modules to shutdown. [15] Buttons to control the mode and play sound [5] Mode button [4] Base drum [4] Snare drum [4] HiHat [15] Joystick control of tempo and volume [4] Able to change volume (respecting limits) [4] Able to change tempo (respecting limits) [3] Able to press once and have it change once [4] Able to press-and-hold and have it keep changing at a reasonable rate [15] 8x8 LED Matrix Display [4] Show mode [3] Show volume if user changes volume [3] Show tempo if user changes tempo [5] Return to showing mode after at least 0.5s, and within ~2s. [5] Terminal output and interval timing - Display mode, tempo, volume - Display intervals for low level audio, and higher-level beat generation. Interval for beat-generation only analyzed on rock-beat. [ 0] Memory Up to a -20 penalty applied for memory errors found with valgrind. - ~3-5 mark deduction per individual memory error - No deduction for memory still reachable at exit. - While running valgrind audio may jitter. - You may ignore any errors generated by libasound, such as: ==1508== Syscall param semctl(IPC_GETALL, arg.array) points to unaddressable byte(s) ==1508== at 0x49477E6: __libc_do_syscall (libc-do-syscall.S:47) ==1508== by 0x49CEE6F: semctl_syscall (semctl.c:48) ==1508== by 0x49CEE6F: semctl@@GLIBC_2.4 (semctl.c:94) ==1508== by 0x48E9B1D: ??? (in /usr/lib/arm-linux-gnueabihf/libasound.so.2.0.0) ==1508== Address 0xbdf3c000 is not stack'd, malloc'd or (recently) free'd ==1508== Forward to Dr. Brian if... - Material is suspiciously similar to another submission. - Inconsistent submission (inconsistent trace indicating results are forged). - All proven cases of academic dishonesty will be dealt with according to SFU's Academic Honesty policy: http://www.sfu.ca/policies/gazette/student.html