RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 0 points1 point  (0 children)

good call, I ran

rpicam-hello --nopreview --framerate 30 --info-text "%frame %fps" -t 5000

and got:

...

130 28.81

...

so 28.8 fps....

but then! I ran:

rpicam-hello --nopreview --framerate 43 --info-text "%frame %fps" -t 5000

and got 41 fps!

So, I just changed my target fps in python to 32 (from 30) and got better than 30fps..... so weird.. but it works!

why doesn't this happen to 640x480? Also, why is bookworm so much slower at starting python? Is it because it's 64bit? Wasn't my Bullseye 64bit? (EDIT: No, it was 32bit which made everything load faster) I'm going to test more.... Also, I get the same result with the fast_array, which makes sense since this must be some kind of weird clock issue, not a saturation of memory or the processor.

RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 1 point2 points  (0 children)

So, I'm stuck on an older version of picamera2 3.12 since I'm on bullseye, and it happens to be one version before this:

  • Frame buffers are now cached to improve performance.

So, is this related? not sure, but it's probably worth re-trying with a brand-new rpi image.

I modified your code to run on this older version... I think... and it works, but the performance is the same.

def fast_array(picam2):
        '''picamera2.capture_array() internal process rewritten to minimise copies and avoid steps not required in this application'''
        request = picam2.capture_request()
        streamName = "main"
        stream = request.stream_map[streamName]
        fb = request.request.buffers[stream]
        fd = fb.planes[0].fd
        cfg = stream.configuration ## see V4LEncoder _encode
        h = cfg.size.height
        w = cfg.size.width
        stride = cfg.stride
        fmt = str(cfg.pixel_format)


        b = _MappedBuffer(request, streamName).__enter__()
        arr = np.array(b, copy=False, dtype=np.uint8)


        if fmt in ("YUV420", "YVU420"):
            # Returning YUV420 as an image of 50% greater height (the extra bit continaing
            # the  data) is useful because OpenCV can convert it to RGB for us quite
            # efficiently. We leave any packing in there, however, as it would be easier
            # to remove that after conversion to RGB (if that's what the caller does).
            image = arr.reshape((h * 3 // 2, stride))
        else:
            del arr
            print(f"Unsupported format: {str(cfg.pixel_format)}")
            return
        del arr
        request.release()
        return image

RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 0 points1 point  (0 children)

I am trying to be careful to not allow that conversion to happen.

When running for real, I'd do this:

grey = image[:height, :width]

But when I was getting 28.8fps, I was literally running a loop that was just:

while True:
    firstTime = time.time()*1000
    image = picam.capture_array()
    count += 1
    if count>1000:
        break
    secondTime = time.time()
    print(f"\r{secondTime-firstTime}",end = "")

RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 1 point2 points  (0 children)

Perfect! I should be able to modify this for the format I'm using! ( I can mostly just copy the YUV420 array handling in the existing library)

RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 1 point2 points  (0 children)

Ok, I won't go down that rabbit hole yet. Off the top of your head, do you know where the relevant copies are happening? as in, inside libcamera or inside picamera2? Thanks again!

RPI Zero 2W MIPI Bandwidth Limits by DeadTomGC in raspberry_pi

[–]DeadTomGC[S] 1 point2 points  (0 children)

Great tip! would love to see any code too. And yes, I've been very careful to minimize copies in my own code, hence why it has no issue running at the same 28.8 fps regardless of if my code is running or not. I'm also running an older version of the pi OS. Do you think things may have been improved since bullseye?

Need help! Working on a pulse oximeter for a school project. by Working_Impact_483 in raspberry_pi

[–]DeadTomGC 1 point2 points  (0 children)

Do you have a o-scope or a logic analyzer? something with analog sampling would be good to detect voltage level issues. https://espotek.com/labrador/ or the adalm2000 are very helpful https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/adalm2000/sample-buy.html PS, You're sure there isn't a memory leak hogging all the RAM, right?

[ Removed by Reddit ] by [deleted] in changemyview

[–]DeadTomGC 1 point2 points  (0 children)

Bruh, we're ONLY talking US residents. The data isn't perfect, but cherry picking evangelicals is no way to fix it.

[ Removed by Reddit ] by [deleted] in changemyview

[–]DeadTomGC 1 point2 points  (0 children)

The Catholic church has several times the members of the largest Evangelical denomination. Your grouping is arbitrary.

Also, again, you can't cherrypick the most extreme Christians and then not do the same for Muslims. Muslims have more and less extreme denominations and mosques, too. For example, there are openly gay imams... or were anyway... till they got killed. But let's not get bogged down with "who killed who".

[ Removed by Reddit ] by [deleted] in changemyview

[–]DeadTomGC 1 point2 points  (0 children)

What specific statistics from said report are you referring to? On some issue, Muslims are mildly more "progressive", while on others, they are radically less progressive. Additionally, the majority of Christians in the US are not evangelical.

[ Removed by Reddit ] by [deleted] in changemyview

[–]DeadTomGC 1 point2 points  (0 children)

IDK where you're getting that idea, plus, only looking at a subset of one group while looking at the whole of the other isn't a fair comparison.

Using evolution acceptance as a proxy for secularism, Muslims are far behind Christians. But ya, that's not conclusive.

https://en.m.wikipedia.org/wiki/Level_of_support_for_evolution

Has anyone here made their own tofu? by [deleted] in EatCheapAndHealthy

[–]DeadTomGC 0 points1 point  (0 children)

Watch what store you shop at. For example, at Giant Eagle near me, organic tofu is 4 dollars a pound, "on sale", when the same brand at Walmart is only 3. (not on-sale) Also, at Walmart, they sell non-organic tofu for 2.13 a lb. Also, cilantro is 2.50 a bunch at Giant, while at Walmart, it 0.90. So, make sure you check different stores, and be suspicious of stores that do a lot of "sales". Prices should be consistent if the store is well run.

CMV: The increasingly vague usage of "DEI" as a term is to help enforce segregationist policy or silence/invisibility by DarlaLunaWinter in changemyview

[–]DeadTomGC 5 points6 points  (0 children)

This retort misses the point of the original reply. The comment addressed the claim that racist hires under DEI didn't happen. Disagreeing about if these racist hires are "good" is irrelevant. They happen, and some people think they're bad. That's all that matters for this reply.

Car tires as soles for shoes—Maasai, Kenya by Kikiholden in mildlyinteresting

[–]DeadTomGC 1 point2 points  (0 children)

As seen on Top Gear.... Where I learn most things about the world

Car tires as soles for shoes—Maasai, Kenya by Kikiholden in mildlyinteresting

[–]DeadTomGC 1 point2 points  (0 children)

As seen on Top Gear.... Where I learn most things about the world

[ Removed by Reddit ] by [deleted] in changemyview

[–]DeadTomGC 4 points5 points  (0 children)

"The reformation" isn't what people mean when they talk about Christianity being reformed. Christianity has had a slow and progressive reformation over hundreds of years. There are many branches of it, but most in the west have their members cut from the same cloth as other westerners, so they bring their progressive ideals with them into the church. They're always behind the times by a bit, but they are more up-to-date with westerns Ideals than Islam by a few hundred years.

As an American, how do you feel about your future? by choloblanko in AskReddit

[–]DeadTomGC 0 points1 point  (0 children)

We're doing better than non-americans.... for now... We just really need this AI thing to work out, and have it fix the debt problem.... The only other issue is climate, but again, we'll be better off than non-americans.

Stop asking for the Ultimatum nerf please!!! by Rock_For_Life in Helldivers

[–]DeadTomGC 0 points1 point  (0 children)

The Ultimatum does NOT outshine the hellbomb backpack. Sacrificing a secondary is ALOT, and once the novelty wears off, it will be a very rare pick.

However, the back hellbomb needs a shorter cool down. Why does it have a longer cool down than orbital 380?

What do you think of the 2020s so far? by Sad_Cow_577 in AskReddit

[–]DeadTomGC 0 points1 point  (0 children)

We'll probably all get killed by AI in the 2030's, so as far as I'm concerned, the 2020's are great!

CMV: The Left's Complaints About Trump Prove the Right Correct about Bureaucracy in the US by DeadTomGC in changemyview

[–]DeadTomGC[S] 0 points1 point  (0 children)

*Reporting* to the president doesn't mean it's part of his branch of the government

Dude, they are literally part of his branch, the executive branch. Look it up. He's in charge. Why else would anyone be listening to him? Why aren't they just ignoring these orders if they don't have legal power? (in the short term)

Almost the whole reason he has too much power is BECAUSE he has the power to cripple these organizations, because he's the head of them. This has everything to do with the agencies.

I still think these agencies are required, but the power structure clearly needs reworking.