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

[Bug]: launch failure #5966

Open
drkitty28 opened this issue Oct 20, 2023 · 12 comments
Open

[Bug]: launch failure #5966

drkitty28 opened this issue Oct 20, 2023 · 12 comments
Assignees
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Comments

@drkitty28
Copy link

drkitty28 commented Oct 20, 2023

PsychoPy Version

2023.2.3

What OS are your PsychoPy running on?

Linux-based systems

Bug Description

Using Ubuntu 22.04, I created a venv, activated it, installed psychopy 2023.2.3 with pip3 and encountered no errors with the install and directories seem intact

bin/psychopy file:

import re
import sys
from psychopy.app.psychopyApp import main
if name == 'main':
sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0])
sys.exit(main())
bin/psychopy (END)

pyenv.cfg file:

home = /usr/bin
include-system-site-packages = false
version = 3.10.12
pyvenv.cfg (END)

Command "psychopy" does not launch psychopy, No splash, no error message.

Expected Behaviour

Expected psychopy to launch

Steps to Reproduce

  1. typed "psychopy" in command line
  2. created symbolic link /usr/bin/psychopy to .local/bin/psychopy in home directory and typed "psychopy"
    ...

Additional context

No response

@drkitty28 drkitty28 added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Oct 20, 2023
@peircej
Copy link
Member

peircej commented Oct 23, 2023

What is the output of ~/.psychopy3/last_app_load.log ?

@drkitty28
Copy link
Author

Here's the log
psychopy_log.txt

@peircej
Copy link
Member

peircej commented Oct 24, 2023

Many thanks. That gives us something to work with.
My guess, from that file, is that you don't have any mic connected which might explain why this error isn't being seen more widely. It's certainly something we should be able to fix though

@drkitty28
Copy link
Author

drkitty28 commented Oct 24, 2023 via email

@mdcutone mdcutone self-assigned this Oct 25, 2023
@drkitty28
Copy link
Author

Any progress on this?

@drkitty28
Copy link
Author

Is this still being worked on?

@drkitty28
Copy link
Author

Any progress on this?

@drkitty28
Copy link
Author

This seems to be an old problem still unresolved: https://discourse.psychopy.org/t/ptb-error-portaudio-cant-detect-any-supported-sound-device-on-this-system/25670 - The last_app_load.log points to the audio python files (e.g., python3.8/site-packages/psychtoolbox/audio.py) line 70:

def get_devices(device_type=None, device_index=None):
64 """Get a list of devices on the current system, optionally of certain types
65
66 :param device_type:
67 :param device_index:
68 :return:
69 """
70 return PsychPortAudio('GetDevices', device_type, device_index)

Could be a psychtoolbox issue with getting sound device info - http://psychtoolbox.org/docs/PsychPortAudio-GetDevices

Is there any way of setting the sound device manually - All psychopy sound preferences seem to be set through the gui

@drkitty28
Copy link
Author

@peircej
Copy link
Member

peircej commented Jan 10, 2024

Well, if your mic can't be used/detected by PTB (or by portaudio, which PTB uses) then it's very unlikely you'll be able to use that mic in psychopy. BUT we'll try and make sure in the upcoming 2024.1.0 release that a failure to load a mic doesn't prevent the app from starting! 😬

@drkitty28
Copy link
Author

I don't think this is just a mic problem, seems to be a problem in detecting any sound device. However, strangely enough, I did run psychtoolbox with Octave and had no problem with sound. So, the problem doesn't seem to be with psychtoobox per se but rather with the file Environments/psychopy-py38/lib/python3.8/site-packages/psychtoolbox/audio.py" (line 70 ) which is created when psychopy is created using pip install in a virtenv. This audio.py file was written in 2018 and starts with:

RIGHT NOW THIS IS A WORK IN PROGRESS. ALTHOUGH THE PsychPortAudio LIB HAS BEEN
TESTED BY MARIO, this additional wrapper is under development. Use with extreme
caution only for development purposes right now.

I've tried manually commenting out references to autio input devices in the file, but that has ramifications for other scripts (e.g., the systemtools.py.

So, is there any way to circumvent callling audio.py or manually setting device info?

@drkitty28
Copy link
Author

From PTB running under Octave

d = PsychPortAudio('GetDevices')
PTB-INFO: Using PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4
d =

1x7 struct array containing the fields:

DeviceIndex
HostAudioAPIId
HostAudioAPIName
DeviceName
NrInputChannels
NrOutputChannels
LowInputLatency
HighInputLatency
LowOutputLatency
HighOutputLatency
DefaultSampleRate

[{d.DeviceIndex}',{d.DeviceName}']
ans =
{
[1,1] = 0
[2,1] = 1
[3,1] = 2
[4,1] = 3
[5,1] = 4
[6,1] = 5
[7,1] = 6
[1,2] = sof-soundwire: - (hw:0,2)
[2,2] = sof-soundwire: - (hw:0,4)
[3,2] = sof-soundwire: - (hw:0,5)
[4,2] = sof-soundwire: - (hw:0,6)
[5,2] = sof-soundwire: - (hw:0,7)
[6,2] = pulse
[7,2] = default
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

No branches or pull requests

3 participants