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

problem with python3 and scarlett 18i20 #2

Open
batteur-geek opened this issue Sep 8, 2022 · 2 comments
Open

problem with python3 and scarlett 18i20 #2

batteur-geek opened this issue Sep 8, 2022 · 2 comments

Comments

@batteur-geek
Copy link

Helo I am using python3, and a scarlet 18i20. I got an error in extract_controls().
I have add to print to check the problem
def _extract_controls():
dump = subprocess.check_output(
["amixer", "-cUSB", "controls"])
#print(dump)
for line in dump.splitlines():
print("line : ",line)
num_id, _, name = line.split(b",")
_, num_id = num_id.split(b"=")
num_id = int(num_id.decode('ascii'))
_, name = name.split(b"=")
name = name.decode('ascii').strip("'")
print("name = ",name,"num_id =", num_id)
yield name, num_id

it ends with :
line : b"numid=9,iface=MIXER,name='Master Playback Volume'"
name = Master Playback Volume num_id = 9
line : b"numid=1,iface=MIXER,name='Extension Unit Switch'"
name = Extension Unit Switch num_id = 1
line : b"numid=6,iface=MIXER,name='Extension Unit Switch',index=1"
Traceback (most recent call last):
File "/home/didier/Musique/scarlett-yaml/scarlett_yaml/scarlett_yaml.py", line 478, in
main()
File "/home/didier/Musique/scarlett-yaml/scarlett_yaml/scarlett_yaml.py", line 468, in main
mixer.load_controls() # prepopulates enums, even for loading.
File "/home/didier/Musique/scarlett-yaml/scarlett_yaml/scarlett_yaml.py", line 169, in load_controls
for name, num_id in sorted(self._extract_controls()):
File "/home/didier/Musique/scarlett-yaml/scarlett_yaml/scarlett_yaml.py", line 405, in _extract_controls
num_id, _, name = line.split(b",")
ValueError: too many values to unpack (expected 3)

Not find a solution yet

@batteur-geek
Copy link
Author

Solution find,I prepare a pullrequest

@piratebab
Copy link

piratebab commented Feb 12, 2023

Hello, I dont know how to propose a pull request. I have modified the script to read the missing parameters. I have not modified the yaml file and the load function.
The modified script is here
https://github.com/piratebab/scarlett_G1_conf

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