SamEureka/balenaPhono

start.sh line 19

Closed this issue · 4 comments

Hey,

I am new to the whole world of balena. I have tried setting up balenaPhono, but am running into some trouble.
The following error is shown in the logs:
balenaPhono /balenaPhono/start.sh: line 19: [: missing `]'
balenaPhono /balenaPhono/start.sh: line 19: /proc/asound/card1: Is a directory
balenaPhono Waiting for USB sound device

The response to the aplay -l command in the terminal for balenaPhono is:
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

So I have set the DARKICE_DEVICE variable to "plughw:2,0"

Shouldto set the start.sh line 19 to: /proc/asound/card2?

First, I'd like to say welcome to the world of balena! Thanks for trying balenaPhono!

I'm a bit rusty on this project but I think you are on the right track with /proc/asound/card2

I would change line 19 in start.sh to until [ -d /proc/asound/card2 ] sometimes I've had bad luck with the 'or' logic.

If that doesn't work, please comment again with your hardware setup. It would help me to know the device type (e.g... Raspberry Pi Zero W), and the type of USB sound device. It looks like it is a Pi4 based on the 2 HDMI sound cards. Maybe we can turn off the HDMI sound to simplify the setup. There are also some DARKICE_DEVICE changes we can make.

Are you deploying with `balena push' from a cloned repo, or using the "Deploy with balena" button? I get mixed results with the button. I recommend installing the balena-cli and pushing from the repo.

If all of that is clear as mud, let me know! I can walk you through anything that isn't clear.

//Sam

@franksterke,
I did some testing with a 'Raspberry Pi 4' and discovered that the HDMI sound takes up /proc/asound/card0 and card1. So you should be good to go by changing line 19 of start.sh to what I mentioned in my previous comment. You were absolutely correct that your DARKICE_DEVICE should be plughw:2,0

I did some refactoring of the start.sh script and now it will attempt to detect the USB Audio device and then display it for you in the console log. It won't automagically set the DARKICE_DEVICE variable yet... but I'll automate that soon.

All these changes have been merged into the 'main' branch so if you want to use the new code you will have to delete the repo you cloned and clone again if you made any changes to the code. If you haven't made any changes you can just do a git pull and it will update. git pull origin main and then balena push balenaPhono to get the new code on your device. If you did the 'Deploy With balena' button, it might update itself?? I'm not 100% sure how that works.

I'll keep checking this issue for a few days and I'm happy to help if I can.

Regards,
//Sam

Thanks that solved the issue. I deployed it to the same fleet with the deploy button, I noticed it kept the 'old' device variables, since the mount point is still rapi.mp3. Anyways, thanks for the support.

/Frank

@franksterke,

I'm glad it is working for you! I didn't change any of the variable names, so any that you have already set should work just fine.

Enjoy, and let me know if you have any other issues.

Very respectfully,
//Sam