SPS decoder library for Linux

3rd Party Software, Tools & Add-ons for KryoFlux
Post Reply
tan1
Posts: 7
Joined: Wed Aug 22, 2018 4:06 pm

SPS decoder library for Linux

Post by tan1 » Thu Aug 23, 2018 3:27 pm

To make the CAPSImage library work for Linux (building from spsdeclib_5.1_source.zip), I had to replace

Code: Select all

__attribute__((aligned)
in C2Comm.h with

Code: Select all

__attribute__((aligned(1))
as we need minimum alignment, not maximum alignment.

User avatar
npomarede
Posts: 29
Joined: Fri Mar 08, 2013 7:09 pm

Re: SPS decoder library for Linux

Post by npomarede » Thu Aug 23, 2018 3:38 pm

Hi
this is something I already noticed and sent by email to IFW some times ago (in 2016 :) )
Here's what I sent him
npomarede wrote:The problem is that it's defined as :

typedef struct {
uint8_t sign; // c2eOOB
uint8_t type; // type of OOB following the header
uint16_t size; // size of following data
} __attribute__ ((packed)) __attribute__((aligned)) C2OOBHdr;

and when using gcc, if you don't specify a value for "aligned" then you get a machine dependant default value, which in this case is 16

One possible change could be to use aligned(1), but as gcc now also supports "pragma pack(1)" as windows and clang do, I think the best way would be to remove all those __atribute__ and only keep this :

#pragma pack(push, 1)

<...structs definitions...>

#pragma pack(pop)
So, instead of keeping __attribute__, better use pack pragma which will make the code common with windows.
Hopefully SPS team will have some free time in the future to release some updated source for capslib.

Nicolas

tan1
Posts: 7
Joined: Wed Aug 22, 2018 4:06 pm

Re: SPS decoder library for Linux

Post by tan1 » Thu Aug 23, 2018 3:43 pm

...preferably one that supports Kryoflux streams.

User avatar
npomarede
Posts: 29
Joined: Fri Mar 08, 2013 7:09 pm

Re: SPS decoder library for Linux

Post by npomarede » Sun Aug 26, 2018 5:40 pm

Yes, would be nice :)

See this other thread about this stream topic https://forum.kryoflux.com/viewtopic.php?f=7&t=1339
Hopefully IFW will have time to work on this when he had more spare time.

Nicolas

Post Reply