HardwarePi install

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  CHYRON (DSMITHHFX)  
 To:  Chris (CHRISSS)     
42216.21 In reply to 42216.20 
Here's a preview:

“Just to remind you, we’re still waiting for Donald Trump to tweet.”
+1/1
 Reply   Quote More 

 From:  graphitone   
 To:  CHYRON (DSMITHHFX)     
42216.22 In reply to 42216.21 
(fail)
0/0
 Reply   Quote More 

 From:  graphitone   
 To:  All     
42216.23 In reply to 42216.22 
Ok, this portion of the script works really well, (thank you PB!)
 
Code: 
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)


oldButtonState1 = True


while True:

    #grab the current button state
    buttonState1 = GPIO.input(5)


    # check to see if button has been pushed

    if buttonState1 != oldButtonState1 and buttonState1 == False:

        subprocess.call("echo 1 > /sys/class/backlight/rpi_backlight/bl_power && shutdown -h now", shell=True,

            stdout=subprocess.PIPE, stderr=subprocess.PIPE)

        oldButtonState1 = buttonState1



        time.sleep(.1)

On a click of the button it turns off the backlight and shuts the Pi down. I only need that one line as it automatically turns the backlight back on on a power up. However, although it was working initially on a rebuild, the sound's dropped off again. :C
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  graphitone      
42216.24 In reply to 42216.22 
No? How about this:

“Just to remind you, we’re still waiting for Donald Trump to tweet.”
0/0
 Reply   Quote More 

 From:  graphitone   
 To:  CHYRON (DSMITHHFX)     
42216.25 In reply to 42216.24 
What you doing taking pictures of Throb's living room?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  graphitone      
42216.26 In reply to 42216.12 
"Somehow I've lost all sound"

My sound broke in Arch by doing something that buggered around with PulseAudio, which then fucked up ALSA, because PulseAudio is a buggy bloated piece of shit that nobody actually needs.

So maybe you installed/upgraded (possibly automatically) something that did fiddled with PA?

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  graphitone      
42216.27 In reply to 42216.23 
You're still using the "Are we there yet? Are we there yet? ..." method instead of the "Tell me when we're there" one.

If you do really want to do it this way, since you only care about shutdown, you don't need to store/check oldButtonState and can simplify it to:

GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)

# endless loop until button is pressed
while GPIO.input(5):
	time.sleep(.1)

# verify button state before switching off
if not GPIO.input(5):
	subprocess.call("echo 1 > /sys/class/backlight/rpi_backlight/bl_power && shutdown -h now",
		shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)

The if verification is probably not necessary (depending on how Python works), but even so it acts as both a safety against unwanted shutdown (incase something goes wrong), and clarifies the intent slightly. (The event-driven/callback method would make it even clearer.)

0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  CHYRON (DSMITHHFX)     
42216.28 In reply to 42216.21 
:D

Me
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  graphitone      
42216.29 In reply to 42216.25 
Has he really got a 70s stereo system?
“Just to remind you, we’re still waiting for Donald Trump to tweet.”
0/0
 Reply   Quote More 

 From:  graphitone   
 To:  Peter (BOUGHTONP)     
42216.30 In reply to 42216.26 
Could well be.

IQaudIO produce this document (a pdf download) which seems to be wrriten in multiple styles and changes between being helpful and downright confusing.

I'll check the onboard audio is properly disabled and might go back to a vanilla image, and test the sound after every change made.

 
0/0
 Reply   Quote More 

 From:  graphitone   
 To:  Peter (BOUGHTONP)     
42216.31 In reply to 42216.27 
Quote: 
You're still using the "Are we there yet? Are we there yet? ..." method instead of the "Tell me when we're there"



Other than being more optimised (and I appreciate the arguments for non-bloated code) does that have a knock on effect on real world performance or not?

Thanks for the suggestions though, I'll try that once I get the sound working again!.

 

0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  graphitone      
42216.32 In reply to 42216.30 
"changes between being helpful and downright confusing"

So standard documentation.
“Just to remind you, we’re still waiting for Donald Trump to tweet.”
0/0
 Reply   Quote More 

 From:  graphitone   
 To:  CHYRON (DSMITHHFX)     
42216.33 In reply to 42216.32 
(nod)

Pretty much. There's an indepth walkthrough of how to build a case with diagrams, then when it comes to installing a rotary encoder as a volume knob it's referencing external libraries and assumes ones knows how to call seperate processes as part of the code.

As a linux luddite, I'm able to fumble my way through most of it with online guides and PB's assistance, but it's not something I use everyday, so whatever I learn soon leaves my brain to be replaced with ingratiating one line lyrics from songs that seem to be on a permanent repeat. 
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  graphitone      
42216.34 In reply to 42216.33 
I think many/most engineers who write their own documentation fail to appreciate the ambiguities of language, and assume users will be able to infer WTF they are talking about, and if they can't, tough shit you lose. I suppose we should be grateful even for that.  :C
“Just to remind you, we’re still waiting for Donald Trump to tweet.”
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  graphitone      
42216.35 In reply to 42216.30 
How does a sound card require 48 pages of documentation? :/

And what's wrong with the onboard sound that made you opt for this route?

0/0
 Reply   Quote More 

 From:  graphitone   
 To:  Peter (BOUGHTONP)     
42216.36 In reply to 42216.35 
The onboard sound is crap. I've got a DAC setup on another Pi attached to my drawing desk and it really makes a difference, the audio is clean and sounds brilliant, way way better than the awful quality through the 3.5mm jack on the Pi.

 
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  graphitone      
42216.37 In reply to 42216.31 
> does that have a knock on effect on real world performance or not?

Dunno - it has the potential to, but I suspect one instance isn't going to have much impact - but if you do get symptoms of the CPU being congested (e.g. stuttering audio or sluggish response), I'd check that first.

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  graphitone      
42216.38 In reply to 42216.36 
Is that music-snob awful or actually bad? :/

The cards in that documentation look chunky - presumably mixing Pi extension cards can quickly give rise to compatibility/connectivity issues.

0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Peter (BOUGHTONP)     
42216.39 In reply to 42216.38 
Actually bad.
There's a vast difference even when you use a 99p USB DAC compared to on board. I think on board has improved since the first gen Pis but still not great due to the design restrictions.
There's an even bigger improvement if you use the I2S DACs. Not checked the one graphitone is using but there's some nice models out there that also incorporate an amplifier into the DAC HAT.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS     
42216.40 In reply to 42216.39 
Makes sense, but was frustrating me thinking about having lots of cards/wires and extra complexity.

But it's been a long day and I only just remembered that my plan was to go via MDI connection, so the audio on the Pi is irrelevant. \o/

0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  41–60  …  81–92

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats