Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: syntax_error on June 25, 2018, 04:08:28 PM
-
Hi,
I am trying to write a program using an MP3 player to work with Tinycore. I am currently working to get: https://github.com/dr-soft/mini_al (https://github.com/dr-soft/mini_al) mp3 header to work, but it calls time structures ether CLOCK_MONOTRONIC or CLOCK_REALTIME both of which are supported on the full Linux time.h, but are missing on the piCore time.h. Is there any way I can port the existing Linux library into piCore?
Or if anyone knows any simple and compact mp3/flac/wav library I can use that will compile on piCore (with working player examples would be best) and work with a Pi Zero, it would be greatly appreciated. Thank you in advance...
_err
-
I assume you mean CLOCK_MONOTONIC, I don't understand where the difference comes from but they are defined in my /usr/include/linux/time.h on piCore 9.0.3
/*
* The IDs of the various system clocks (for POSIX.1b interval timers):
*/
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
#define CLOCK_PROCESS_CPUTIME_ID 2
#define CLOCK_THREAD_CPUTIME_ID 3
#define CLOCK_MONOTONIC_RAW 4
#define CLOCK_REALTIME_COARSE 5
#define CLOCK_MONOTONIC_COARSE 6
#define CLOCK_BOOTTIME 7
#define CLOCK_REALTIME_ALARM 8
#define CLOCK_BOOTTIME_ALARM 9
#define CLOCK_SGI_CYCLE 10 /* Hardware specific */
#define CLOCK_TAI 11
#define MAX_CLOCKS 16
#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
#define CLOCKS_MONO CLOCK_MONOTONIC
/*
* The various flags for setting POSIX.1b interval timers:
*/
#define TIMER_ABSTIME 0x01
#endif /* _LINUX_TIME_H */
-
Yes, thank you! That tcz added exactly what I needed. Now if I can just figure out how to get linux/time.h to define time instead of the regular include/time.h. I am unfortunately getting linux/time.h is redefining struct timespec.
-
Hi syntax_error
Try:
#include <linux/time.h>
-
Thanks Rich,
I had to #include <linux/time.h> and set _STRUCT_TIMESPEC #defined to 1 to skip the redefinition.
_err