RandomVertebrate / raspi-looper

Easy 4 track looper for RaspBerry Pi
93 stars 18 forks source link

specify default soundcard in alsa.conf #5

Open phil291 opened 3 years ago

phil291 commented 3 years ago

using "2021-03-04-raspios-buster-armhf-full" i needed to change the index of the usb-soundcard in

/usr/share/alsa/alsa.conf

defaults.ctl.card 0 defaults.pcm.card 0 defaults.pcm.device 0

to

defaults.ctl.card 1 defaults.pcm.card 1 defaults.pcm.device 1

to get the main.py script working.

however, if i clear the first track, for example if i didn't like what i recorded, i'm not able to record again.

phil291 commented 3 years ago

and of course, great project, respect, thanks man!

RandomVertebrate commented 3 years ago

This shouldn't be necessary if

a) you run device.py and setup.py and set the audio device index correctly beforehand b) you run everything as sudo

Had you done this? If so then there's something wrong. If you didn't run the script as sudo then it won't work because the script won't be allowed to switch audio devices (as far as I understand).

Let me know.

On Sun, May 30, 2021, 2:00 PM phil291 @.***> wrote:

using "2021-03-04-raspios-buster-armhf-full" i needed to change the index of the usb-soundcard in

/usr/share/alsa/alsa.conf

defaults.ctl.card 0 defaults.pcm.card 0 defaults.pcm.device 0

to

defaults.ctl.card 1 defaults.pcm.card 1 defaults.pcm.device 1

to get the main.py script working.

however, if i clear the first track, for example if i didn't like what i recorded, i'm not able to record again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RandomVertebrate/raspi-looper/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDTAGOLL36YVSNOWH6U77LTQHZTLANCNFSM45ZDQCZA .

phil291 commented 3 years ago

i'm sorry, after pressing record and play of the first track together the looper is again ready to record, didn't figure that out.

regarding soundcard defaults: i tried with a fresh image, did all the suggested updates (i have a touch-screen connected to the display-port), then did all console setups with sudo, did not work out.

firstly i noticed that the audio-out was routed to the raspberry headphone jack, not to the usb-card, so latency.py couldn't really measure anything, but still printed out 69ms and some other data.

secondly, after all script configuration the internal sound was still the default in alsa.conf and stayed like that after the reboot. after correcting this, all ok.

RandomVertebrate commented 3 years ago

regarding soundcard defaults: i tried with a fresh image, did all the suggested updates (i have a touch-screen connected to the display-port), then did all console setups with sudo, did not work out.

So, just to be clear: You installed the OS fresh, ran devices.py to look up the index for your USB soundcard, ran settings.py and input these device indices, then ran sudo main.py and it still did not work?

If so, I will try to recreate this issue ASAP.

phil291 commented 3 years ago

yes, exactly.

after settings.py, where i have set two times index 1 as input and output, i checked in the desktop-gui that still the headphone jack was active as output, but input was correctly set to my usb soundcard.

as mentioned, i'm using a touchscreen, i guess it's the desktop-gui that prevents the update via terminal by somehow keeping the internal sound device busy after a possible startup sound, which i actually did not hear, because nothing was plugged in in the headphone jack.

however, main.py, when started manually, complains via alsa-lib-message that there is no bcm-32yadayada-thingie, so intilization fails and the script stops.

i remember also there have been issues on the volumio player regarding startup sounds when it comes to activate a kodi plugin at boot, which fires up his own gui including sound device initialzation. maybe it's a good idea to disable startup-sounds via your settings.py and kill running device processes before changing the alsa configuration, if i'm right on this, but the easiest way would be to mention this topic in you documentation as most people will not have a gui running.

if i get some free time tomorrow i will send you a recording of that click sound. additionally i will doublecheck for clicks on tracks 2-4 using my guitar. if my theory is right, clicks should be noticable there, too.