Thanks Jun,
I want to clarify/correct two things: (1) The most important issue is the impossible access to /dev/mem, even being root. This character device is registered in /dev/ with major=0 and minor=0. user is root, group is kmem and rights are rw-r-----. Apparently this prevents full use of the GPIO as we have to map memory regions, like in the code snippet given at the end of this email (taken from http://elinux.org/RPi_Low-level_peripherals#C).
It's a totally terrible idea to access low level SoC registers from within user-space program. DON'T do that. It's a bad design and completely unsecure. As Michael mentioned, the default securelevel setting prevents this (for a good reason).
If you want to utilise GPIO, then investigate the kernel API we are providing for this (see gpio(4) man page). Patch your program to use it instead of /dev/mem!
(2) Concerning audio output, everything is fine now, except that I have no clue how to control the volume level and that it is impossible to do it from within mplayer (no error output, but controls are ineffective).
Please check if the volume level is controllable with mixerctl command.
-- Best regards, Radoslaw Kujawa
|