Hi Jean-Jacques.
I have tried what you suggested by updating /root/.profile like this:

========
aplay /usr/share/sounds/alsa/Front_Left.wav
/home/george/startfs
sleep 2
aplay /usr/share/sounds/alsa/Front_Right.wav
killall fluidsynth
sleep 2
/home/george/startfs
aplay /usr/share/sounds/alsa/Front_Left.wav
========

.. and ALL of these files play OK in left-right-left sequence and
fluidsynth plays from the midi input correctly at the end.

if I change the file like this:

========
aplay /usr/share/sounds/alsa/Front_Left.wav
### /home/george/startfs
sleep 2
aplay /usr/share/sounds/alsa/Front_Right.wav
### killall fluidsynth
sleep 2
/home/george/startfs
aplay /usr/share/sounds/alsa/Front_Left.wav
========

.. this time the wav files are again all played correctly but fluidsynth
does not play the midi input!!

So there is something happening in my environment such that fluidsynth has
to be started, stopped and restarted for it to play correctly.

So my little project is working and I am happy - but as an 'old school'
engineer I'd still like to know just what is going on :-)

George



On Wed, 29 Jan 2020 at 13:15, Ceresa Jean-Jacques <
jean-jacques.cer...@orange.fr> wrote:

> Hello Georges,
>
>
>
> After reading your issue about no Alsa audio when starting FluidSynth from
> root .profile.
>
> This sounds like if Alsa hadn't started (or not yet finished its
> initialization) before FluidSynth starts.
>
> May be could you validate this supposing trying to start Alsa player
> (aplay) from root .profile by requesting it playing an audio file
>
> instead of starting FluidSynth ?.
>
>
>
> Regards
>
> jjc
>
> > Message du 29/01/20 13:25
> > De : "George Poulson" <george.poul...@gmail.com>
> > A : "FluidSynth mailing list" <fluid-dev@nongnu.org>
> > Copie à :
> > Objet : Re: [fluid-dev] Problem starting Fluidsynth on a headless RPi
> >
> >
>
> @Marcus - many thanks for your help.
>
> >
> I tried directing the output from fluidsynth to a file but it was too
> brief to reveal anything.
> I also used 'aconnect -l' to determine whether it was the midi connection
> from my keyboard that was not being made correctly but everything was as
> expected;
> >
> Next I tried using aconnect to manually disconnect and re-make the midi
> connections with fluidsynth in both its 'not working' and 'working' states
> but again the outcome did not change. Removing the midi.autoconnect
> command-line switch and connecting using aconnect once fluidsynth had
> started also made no difference
> >
>
> >
> This kind of made me think that the issue was not with the midi connection
> so I went back to looking at whether it could be the alsa audio connection.
>
> >
> I had received another [email-only] reply (thanks Alberto!) suggesting
> that I try setting my Pi to automatically create a login as root at boot
> time and to use the root .profile to run fluidsynth. I decided to give this
> a try and the first attempt failed again but I could at least see that
> fluidsynth was now running with an attached tty.
> >
> Purely by accident I ran 'sudo su' on another SSH session (and thus
> inadvertently started another instance of fluidsynth) and suddenly somehow
> fluidsynth started producing audio!!
>
> >
> To cut a long story short after more 'tinkering in the dark' I now have my
> system working as I need it to (albeit with a nasty root-login security
> hole - unimportant to me as this is going to be a stand-alone box).
>
> >
> So I now have :
> >
> 1) a '/home/george/startfs' shell script which contains:
> ==========
> /home/george/fluidsynth -s -i -o midi.autoconnect=1 -m alsa_seq -a alsa -g
> 1 /home/george/GeneralUser_GS_v1.471.sf2 &
> ==========
> >
>
> >
> 2) a root login created at boot time (
> https://raspberrypi.stackexchange.com/questions/45552/login-automatically-as-root-at-startup
> )
> >
>
> >
> 3) root's .profile contains:
> ==========
> >
> /home/george/startfs
> > sleep 2
> > killall fluidsynth
> > /home/george/startfs
> ==========
> >
>
> >
> Somewhat bizarrely fluidsynth only produces audio via alsa having been
> started once, killed and restarted, but this approach does now work
> reliably.
> >
>
> >
> When I get chance I may investigate using jackd or a different audio
> connection method, but for now I have what I need - albeit a bit of a nasty
> hack!!
>
> >
> Thanks guys for the help.
> Kind regards,
> George
> ((Somerset, UK))
>
> >
>
> >
>
>
>
> _______________________________________________
> fluid-dev mailing list
> fluid-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>
> _______________________________________________
> fluid-dev mailing list
> fluid-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to