← Back to team overview

ubuntu-phone team mailing list archive

Re: Getting cpuinfo hardware field via API

 

Hello Michi,

I am not sure if it helps. However, since it seems to be a threading
problem you could try the C++11 hardware_concurrency to find out how
many threads are allowed. Have a look here:
http://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency

Best regards,

Marco

Am Mittwoch, den 24.06.2015, 15:08 +1000 schrieb Michi Henning:
> Hi folks, I'm looking for some advice for how to figure out the phone model we are running on.
> 
> Specifically, we are having major grief with gstreamer. On a Nexus 4, we can run two processes side by side that each use a single gstreamer pipeline (at least most of the time). On a BQ, we can run only one, otherwise, things crash, hang, silently deliver the wrong information without an error, etc.
> 
> So, by looking at /proc/cpuinfo, I can tell a BQ from, say, a Nexus 4. On a BQ, I get:
> 
> Hardware        : MT6582
> 
> On a Nexus 4, I get:
> 
> Hardware	: QCT APQ8064 MAKO
> 
> Now, this is the information I need, and I can set things up such that they work based on that.
> 
> But having to parse the output of /proc/cpuinfo sucks majorly. It's brittle and just awful.
> 
> I tried using QDeviceInfo (even though it's unofficial), but there don't appear to be any methods in there that deliver the hardware string I need.
> 
> Any suggestions as to how I can get at this information without having to parse /proc/cpuinfo and mucking around with regex and the like?
> 
> Thanks,
> 
> Michi.

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References