Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only start ui.py one time hangs on reconnect? #6

Open
mrWheel opened this issue Jan 16, 2015 · 2 comments
Open

Can only start ui.py one time hangs on reconnect? #6

mrWheel opened this issue Jan 16, 2015 · 2 comments

Comments

@mrWheel
Copy link

mrWheel commented Jan 16, 2015

Hi,
I have followed your excellent instructions to install everything for the Adafruit PiTFT 2.8"resistive display.
Now everything works until something goes wrong ;-)
If I start ui.py for the first time I get the following info:

0.17.0
0
fbcon

And than it all works great. If ui.py crashes or if I 'pkill -9 ui.py' and than start ui.py again I only get the first two lines of information:

0.17.0
0

I have to press <Ctrl>+C or 'pkill ui.py' and then I get the messages:

fbcon
Not connected
'ConnectionError' object has no attribute 'errno'
Connection Established!

Am I doing something wrong?
Can it be fixed?
Thanks in advance!

@ISO-B
Copy link
Owner

ISO-B commented Jan 19, 2015

Newest commit should fix this. You should try it and report back. Thanks.

edit: Forgot to add import for that commit, but its fixed now.

@mrWheel
Copy link
Author

mrWheel commented Jan 20, 2015

I will try this today.

Could you please, in pitft-ui.py, change the lines 431-432 from

430    if coverart_url:
431                 subprocess.check_output("wget -q --limit-rate=40k %s -O %s/cover.png" % (coverart_url, self.path), shell=True )
432                 coverart=pygame.image.load(self.path + "cover.png")
433                 self.image["cover"] = pygame.transform.scale(coverart, (163, 163))

to:

430  if coverart_url:
431                  subprocess.check_output("wget -q --limit-rate=40k %s -O %s/cover.png" % (coverart_url, "/tmp/"), shell=True )
432                  coverart=pygame.image.load("/tmp/" + "cover.png")
433                  self.image["cover"] = pygame.transform.scale(coverart, (163, 163))

So the script can be run on a RO filesystem?
Also, does adding the next two lines after 34 in ui.py interfere with normal operation? They are needed when using a USB-DAC so pygame does not lock the USB audio DAC.

os.environ["SDL_AUDIODRIVER"] = "disk"
os.environ["SDL_PATH_DSP"] = "/dev/null"

Would be nice if you could add them to the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants