Soundcard Left Busy After Killall Csound
Date | 2017-02-15 19:44 |
From | Emmett Palaima |
Subject | Soundcard Left Busy After Killall Csound |
Hi, I am working on a project using Csound on the Raspberry Pi. I control the running of csd files via ssh. I often use the command 'killall csound', as an easy way to stop all the csound processes I have running. However, after running this command, the next time I run a csd I get the following error:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
*** Cannot open device 'hw:0,0' for audio input: Device or resource busy It seems that using killall Csound is confusing the soundcard somehow. After I reboot the Pi everything works again. I am using the AudioInjector (http://www.audioinjector.net/). Is there an alternative way of quitting Csound via command line, or a command I could use to reset the soundcard? Thanks, Emmett |
Date | 2017-02-15 19:53 |
From | Guillermo Senna |
Subject | Re: Soundcard Left Busy After Killall Csound |
Is Csound effectively killed after the killall? Alsa or Jack? On 15/02/17 16:44, Emmett Palaima wrote: > Hi, I am working on a project using Csound on the Raspberry Pi. I control > the running of csd files via ssh. I often use the command 'killall csound', > as an easy way to stop all the csound processes I have running. However, > after running this command, the next time I run a csd I get the following > error: > > *** Cannot open device 'hw:0,0' for audio input: Device or resource busy > > It seems that using killall Csound is confusing the soundcard somehow. > After I reboot the Pi everything works again. I am using the AudioInjector ( > http://www.audioinjector.net/). > > Is there an alternative way of quitting Csound via command line, or a > command I could use to reset the soundcard? > > Thanks, > > Emmett > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2017-02-15 20:07 |
From | Emmett Palaima |
Subject | Re: Soundcard Left Busy After Killall Csound |
I am using Alsa. After running killall, fuser -fv /dev/snd/* returns: USER PID ACCESS COMMAND /dev/snd/controlC0: pi 747 F.... lxpanel /dev/snd/pcmC0D0c: pi 1032 F.... csound /dev/snd/pcmC0D0p: pi 1032 F.... csound So perhaps Csound is not being properly exited. Any idea what might be causing this? Here is also the simple csd I am using for testing, just to be thorough:
<CsoundSynthesizer>
<CsOptions>
-odac:hw:0,0
-iadc:hw:0,0
-+rtaudio=alsa
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 128
nchnls = 2
0dbfs = 1.0
turnon "helloWorld"
instr helloWorld
ares lfo 1, 440, 2
outs ares, ares
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer> On Wed, Feb 15, 2017 at 2:53 PM, Guillermo Senna <gsenna@gmail.com> wrote: Is Csound effectively killed after the killall? Alsa or Jack? |
Date | 2017-02-15 20:12 |
From | Guillermo Senna |
Subject | Re: Soundcard Left Busy After Killall Csound |
So after the killall what does 'ps aux | grep csound' returns? If it still there then it might be a Csound bug, kill it with 'killall -9 csound' On 15/02/17 17:07, Emmett Palaima wrote: > I am using Alsa. > > After running killall, fuser -fv /dev/snd/* returns: > > USER PID ACCESS COMMAND > > /dev/snd/controlC0: pi 747 F.... lxpanel > > /dev/snd/pcmC0D0c: pi 1032 F.... csound > > /dev/snd/pcmC0D0p: pi 1032 F.... csound > > > So perhaps Csound is not being properly exited. Any idea what might be > causing this? > > Here is also the simple csd I am using for testing, just to be thorough: > > |
Date | 2017-02-15 20:22 |
From | Emmett Palaima |
Subject | Re: Soundcard Left Busy After Killall Csound |
ps aux | grep csound returns:
After I do killall 9 it returns
I think that might have been what I was looking for, but what is the second Csound process? On Wed, Feb 15, 2017 at 3:12 PM, Guillermo Senna <gsenna@gmail.com> wrote: So after the killall what does 'ps aux | grep csound' returns? If it |
Date | 2017-02-15 20:24 |
From | Emmett Palaima |
Subject | Re: Soundcard Left Busy After Killall Csound |
Yes, now that I replaced killall with killall -9 the problem is solved! On Wed, Feb 15, 2017 at 3:22 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2017-02-15 20:36 |
From | Guillermo Senna |
Subject | Re: Soundcard Left Busy After Killall Csound |
By second process you mean this ▽? pi 1110 0.0 0.2 4276 2008 pts/0 S+ 20:20 0:00 grep --color=auto csoundThat is just the grep command you passed in "ps aux | grep csound". What actually happened is that your first "killall csound" command was not effective because Csound is ignoring the signal or could not unblock. I've no idea what it was as your csd seems simple enough. On 15/02/17 17:22, Emmett Palaima
wrote:
ps aux | grep csound returns: pi 1037 81.4 1.3 28500 12404 ? Rs 20:19 0:56 csound test.csd pi 1110 0.0 0.2 4276 2008 pts/0 S+ 20:20 0:00 grep --color=auto csound After I do killall 9 it returns pi 1110 0.0 0.2 4276 2008 pts/0 S+ 20:20 0:00 grep --color=auto csound I think that might have been what I was looking for, but what is the second Csound process? On Wed, Feb 15, 2017 at 3:12 PM, Guillermo Senna <gsenna@gmail.com> wrote:So after the killall what does 'ps aux | grep csound' returns? If it still there then it might be a Csound bug, kill it with 'killall -9 csound' On 15/02/17 17:07, Emmett Palaima wrote:I am using Alsa. After running killall, fuser -fv /dev/snd/* returns: USER PID ACCESS COMMAND /dev/snd/controlC0: pi 747 F.... lxpanel /dev/snd/pcmC0D0c: pi 1032 F.... csound /dev/snd/pcmC0D0p: pi 1032 F.... csound So perhaps Csound is not being properly exited. Any idea what might be causing this? Here is also the simple csd I am using for testing, just to be thorough: <CsoundSynthesizer> <CsOptions> -odac:hw:0,0 -iadc:hw:0,0 -+rtaudio=alsa </CsOptions> <CsInstruments> sr = 48000 ksmps = 128 nchnls = 2 0dbfs = 1.0 turnon "helloWorld" instr helloWorld ares lfo 1, 440, 2 outs ares, ares endin </CsInstruments> <CsScore> </CsScore> </CsoundSynthesizer> On Wed, Feb 15, 2017 at 2:53 PM, Guillermo Senna <gsenna@gmail.com>wrote:Is Csound effectively killed after the killall? Alsa or Jack? On 15/02/17 16:44, Emmett Palaima wrote:Hi, I am working on a project using Csound on the Raspberry Pi. Icontrolthe running of csd files via ssh. I often use the command 'killallcsound',as an easy way to stop all the csound processes I have running.However,after running this command, the next time I run a csd I get thefollowingerror: *** Cannot open device 'hw:0,0' for audio input: Device or resourcebusyIt seems that using killall Csound is confusing the soundcard somehow. After I reboot the Pi everything works again. I am using theAudioInjector (http://www.audioinjector.net/). Is there an alternative way of quitting Csound via command line, or a command I could use to reset the soundcard? Thanks, Emmett Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2017-02-15 20:45 |
From | Emmett Palaima |
Subject | Re: Soundcard Left Busy After Killall Csound |
I think it is probably something to do with how I am communicating with the Pi via ssh. I send each ssh command individually, as in: pi@<IP> 'my command' killall -9 definitely does the trick though. What does the -9 do? I can't seem to find that in the killall docs for command line flags. On Wed, Feb 15, 2017 at 3:36 PM, Guillermo Senna <gsenna@gmail.com> wrote:
|
Date | 2017-02-15 20:45 |
From | Emmett Palaima |
Subject | Re: Soundcard Left Busy After Killall Csound |
* ssh pi@<IP> 'my command' On Wed, Feb 15, 2017 at 3:45 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2017-02-15 20:59 |
From | Guillermo Senna |
Subject | Re: Soundcard Left Busy After Killall Csound |
-9 is the same as passing SIGKILL.You can read a little about signals here: http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html But Csound should behave correctly if you run it like that. Unless it needs to be attached to a tty. I really don't know why the killall wasn't effective. Maybe it was your particular audio interface's alsa module. On 15/02/17 17:45, Emmett Palaima wrote: > I think it is probably something to do with how I am communicating with the > Pi via ssh. I send each ssh command individually, as in: > > pi@ |
Date | 2017-02-15 21:08 |
From | jpff |
Subject | Re: Soundcard Left Busy After Killall Csound |
SIGINT is caugt andinterats wit exitnow I suspet tat might be te probem; sigal andle in Top/csound,c ==J On Wed, 15 Feb 2017, Guillermo Senna wrote: > -9 is the same as passing SIGKILL.You can read a little about signals > here: > http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html > > But Csound should behave correctly if you run it like that. Unless it > needs to be attached to a tty. I really don't know why the killall > wasn't effective. Maybe it was your particular audio interface's alsa > module. > > > On 15/02/17 17:45, Emmett Palaima wrote: >> I think it is probably something to do with how I am communicating with the >> Pi via ssh. I send each ssh command individually, as in: >> >> pi@ |
Date | 2017-02-15 21:12 |
From | Richard |
Subject | Re: Soundcard Left Busy After Killall Csound |
sudo kill -9 <pid of csound> should also work, since you have only one csound process, no need for killall, IMO RichardOn 15/02/17 21:24, Emmett Palaima
wrote:
|
Date | 2017-02-15 21:18 |
From | Guillermo Senna |
Subject | Re: Soundcard Left Busy After Killall Csound |
I can't debug it because his example works here in my Ubuntu Studio x86_64. On 15/02/17 18:08, jpff wrote: > SIGINT is caugt andinterats wit exitnow > I suspet tat might be te probem; sigal andle in Top/csound,c > > ==J > > On Wed, 15 Feb 2017, Guillermo Senna wrote: > >> -9 is the same as passing SIGKILL.You can read a little about signals >> here: >> http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html >> >> >> But Csound should behave correctly if you run it like that. Unless it >> needs to be attached to a tty. I really don't know why the killall >> wasn't effective. Maybe it was your particular audio interface's alsa >> module. >> >> >> On 15/02/17 17:45, Emmett Palaima wrote: >>> I think it is probably something to do with how I am communicating >>> with the >>> Pi via ssh. I send each ssh command individually, as in: >>> >>> pi@ |