Re: [orca-list] orca command-line configuration question



Hello Peter,

well, actually  we set no default sound driver, in the sense that pulseaudio is not started by defaut. Let me 
elaborate a bit.

pulseadio is not started automatically: neither by an init script (it is not started system wide, at least by 
default), nor by a .desktop file, whatever.

It is only started on demand by an application, either if it is built this way (like firefox in Slint, for 
instance, as we just rebuilt an official binary, or a desktop sound mixer, whatever), or if set to be used in 
a configuration file (like  /etc/libao.conf or /etc/speech-disatcher/speechd.conf).

So, in case of a "real" alsa app, the chain is rather:
hardware audio device, alsa app.
In other words, pulseaudio doesn't come into play at all then (but does as you describe if I type "apulse 
firefox", for instance).

I know that several distributions do the opposite, i.e. they redirect alsa to pulseaudio insteda of setting 
pulseaudio to use dmix:
1. either in /etc/asound.conf as does the genuine Slackware (although Patrick now also provides an alternate 
"pure-alsa" setting in Slackware-current):
# ALSA system-wide config file
# By default, redirect to PulseAudio:
pcm.default pulse
ctl.default pulse
2. Or in other alsa configuration files, for instance /usr/share/alsa/alsa.conf and files in 
/usr/share/alsa.d/*.conf) as does Debian IIRC. 

Let's take a few practical example for Slint.
1. If the user starts in Console aka CLI,  pulseaudio will be spawn only if needed, e.g. because the screen 
reader (espeakup, speechd-up or fenrir) rely on speech-dispatcher, itself configured by the user to use 
pulseaudio directly or indirectly, or because the TTS in use is built with a dependency on pulseaudio (as 
e.g.RHVoice, I have to ask Olga if this can be avoided).
BTW @Olga, if you read this...
If then the user starts an application linked to pulseaudio, of course it will be started.
2. If the user starts in a graphical login with speech (lightdm or gdm2), all depends on the 
speech-dispatcher settings and the TTS in use.
3. When going graphical (either typing startx or from gdm2 or lightdm) the same apply, but additionally some 
of the DEs themselves include a component linked to pulseaudio.

Sorry for these too long and probably not that clear message.

Best and greetings,

Didier  


On 02/05/2019 12:55, Peter Vágner wrote:
Hello Didier,

Yes this is another approach to this issue.

You are using pulseaudio as the default sound server.
Thus for pulseaudio aware apps the chain is: hardware audio device, alsa drivers, pulseaudio, an app.
For alsa apps it's: hardware audio device, alsa drivers, pulseaudio, pulseaudio-alsa emulating alsa user 
space libraries, alsa app.

It really depends on what's is the primary choice for the target user.
For example user who prefers CLI over graphical desktop is likelly to prefer direct alsa with dmix.
User running graphical desktop as his default is more likely to choose either pulseaudio on its own the way 
I have pointed to, or pulseaudio-alsa with dmix the way you are setting up in slint.

Thanks and greetings

Peter


Dňa May 2, 2019 10:37:45 AM UTC používateľ Didier Spaier <didier slint fr> napísal:

    Hello,

    in Slint we also use dmix but another way: instead of including a setting in /etc/asound. conf we do it 
in /etc/pulse/default.pa, cf the four lines below:
    ### In Slint, we want to share audio resources between speech apps that
    ### rely on alsa and other apps that rely on pulseaudio.  
    load-module module-alsa-sink device=dmix
    load-module module-alsa-source device=dsnoop

    I attach the whole file.

    We do not ship an /etc/asound.conf by default, unless the user have chosen another card than the first 
one at the beginning of installation, in which case we set this one as default in /etc/asound.conf, cf. 
http://slackware.uk/slint/x86_64/slint-testing/source/localization/scripts/probe_sound_cards

    Also, we allow he user to tell which card to use with espeakup and speechd-up editing their respective 
config file, with instructions in these code snippets:

    1. In /etc/espeakup.conf:

    # You only need to set the value of ALSA_CARD if you have several sound
    # cards and want to specify which one espeakup should send the speech
    # to, otherwise the default sound card will be used. The value should be
    # a number in a range beginning with 0, like for instance ALSA_CARD=1 or
    # the corresponding id, preferable as the sounds cards number can
    # change, like ALSA_CARD=PCH. To know the number and id of your cards,#
    # type: list-cards. To know more about your sound cards, type: aplay -l
    # or aplay -L
    # By default ALSA_CARD=0 (the first sound card), but if you used
    # espeakup during installation, ALSA_CARD will be initially set to the
    # id of the card you selected at the beginning of Slint installation
    # 
    #ALSA_CARD=0

    2. In /etc/speechd-up.conf:

    # You only need to set the value of ALSA_CARD if you have several sound
    # cards and want to specify which one speechd-up should send the speech
    # to, otherwise the default sound card will be used. The value should be
    # a number in a range beginning with 0, like for instance ALSA_CARD=1
    # If not uncommented the default sound card is used.
    # to know the numeric id of your sound cards you can type:
    # cat /proc/asound/cards
    # For this setting to be effective, the file /etc/speechd.conf should
    # include 'AudioOutputMethod "libao"' and the file /etc/libao.conf
    # should include: 'default_driver=alsa'. This is the default in Slint.
    # 
    #ALSA_CARD=0

    Maybe something like that could be included in /etc/fenrirscreenreader/settings/settings.conf ?

    @ Chrys: what do you think?

    Most audio apps in Slint use pulseaudio, but someone wanting to hear a youtube tune using alsa instead 
of pulseaudio can always type "apulse firefox" to start firefox <smile>

    Best,

    Didier


    On 02/05/2019 11:09, Peter Vágner wrote:

        Hello,

        I am sorry I have overlooked this conversation mentions my earlier experiment with using espeak 
directly within orca through python-espeak.

        I would recommend not to use this in production if you have that choice.

        Originally I have assumed that I can get orca talking directly to eSpeak so I can make it work on 
termux for Android, on raspberry pi and other configurations where speech-dispatcher might not be required 
or can't be made to run at all.

        I have managed to wrap up that quickly in a few hours. I have even posted it here to the list for 
tinkerers like I am to play with or possibly to look at.
        However I have quickly discovered that this is much less responsive than orca talking to 
speech-dispatcher. And that turned to be something I was unable to resolve easily as python-espeak does not 
care about the audio handled by espeak. Audio is simply played to the default sound device using espeak 
runtime pulseaudio vs alsa detection the same way calling it via command line does.

        Another experiment of such sort would be writing some wery basic gstreamer based player that would 
run in a background thread holding the audio device open all the time, using espeak via ctypes directly and 
feeding its audio to that gstreamer based player. It would have the same flav as speech-dispatcher has that 
it may not be possible to play multiple sounds at the same time on some devices.

        Orca can now optionally produce progress bar update beeps via gstreamer so it would introduce no 
extra dependencies.

        I have just not played with this more and since I can now run speech-dispatcher with proot on 
termux for android I am no longer motivated to experiment with that too much.

        I haven't asked to apply these changes to orca master because I know they are not stable.

        To talk a bit on the currently discussed audio output configuration:
        There are single channel audio devices and multi channel audio devices.
        Single channel devices only allow playing one sound at a time. For most audio devices alsa tries to 
compensate for not being to play more than one sound by automagically enabling dmix plugin.
        This is not working on all hardware. If it's not, you can see the behaviour like this:
        Espeakup is running as root it grabs the audio device and nothing can grab it and play another 
sound through it later.
        See this part in the Arch wiki to see how to manually enable dmix: 
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Dmix
        I think this will apply to most other distributions as well.

        Another way on how to compensate for this is by running pulse audio as it should naturally handle 
multiple streams.
        Even while using pulseaudio user intervention might be needed as allowing multiple users to play 
sound at a same time is considered a security risk thus it's not configured by default.
        I like this blog post on the matter to better explain how to do it. 
http://billauer.co.il/blog/2014/01/pa-multiple-users/
        I am using this pulseaudio tweak and Chrys, Storm and other guys running Fenrir are doing the same 
thing I guess.

        Luke has developed a different solution for Vinux 5.0 which I think is working on that version but 
is not easily portable to other setups.

        Greetings

        Peter


        Dňa 26. 4. 2019 o 12:23 Didier Spaier napísal(a):

            Hello,

            Some information and corrections.

            spd-say is part of speech-dispatcher, so if speech-dispatcher is not
            installed, neither is spd-say, or if it is "standalone", it won't work.
            This has nothing to do with espeakup grabbing alsa.

            espeakup being a bridge between speakup, and espeak or espeak-ng,
            has nothing to do with alsa anyway, at least directly.

            If alsa is properly set, there is no reason that espeak or espeak-ng
            grabs alsa. It doesn't here

            Sorry, AFAIK there is no other available option currently than
            speech-dispatcher for Orca (Joanie, please correct me if that's wrong).

            I am not optimistic about the use of Peter's patch, as it is against
            an old Ora version but again. Peter, is it right?

            Last libao can use a lot of audio backends, but you can set the default
            driver in /etc/libao.conf. Here I set: default_driver=alsa

            But esd, pulse and oss are also available as they are installed when I
            configure libao.

            So, I think that in case speech-dispatcher relies on libao, the audio
            card used depends on the backend of libao rather than libao itself.

            Best,

            Didier

            On 26/04/2019 11:45, Willem van der Walt wrote:

                Thanks both to Zahari and Janina.
                Yes, I am running espeakup/speakup.
                Yes, spd-say does not work, likely because espeakup grabs alsa.
                Yes, I am using alsa, not pulseaudio.
                I do not really want to run speechd_up, but I suppose that might be another option.
                No, I do not have the luxury of a second sound device, so that one cannot work here.
                I might look at Peter's patch.
                Kind regards, Willem


                On Fri, 26 Apr 2019, Janina Sajka wrote:

                    Hi, Willem:

                    You need to get speech-dispatcher working. In that effort spd-say is
                    your friend from the cli. If you can pass it a string and hear speech,
                    you should be good to go with Orca.
                    You don't say, but I presume you're also running Speakup on this same
                    machine? If so, espeakup could be blocking speech-dispatcher. At least,
                    that's how things work on my machines and it's the reason I use a second
                    audio card for speech-dispatcher. If using alsa in such a configuration
                    you'll want to identify the appropriate device in
                    /etc/speech-dispatcher/speechd.conf. Here's the relevant line from my
                    file:

                    #AudioALSADevice "plughw:1"

                    Note this line is commented because I'm using libao, not alsa, which is
                    slected higher up in that file. libao simply chooses the first available
                    audio card when launched. In my case that turns out to be hw:1.

                    People using pulseaudio will have a different approach. I can't speak to
                    that, it's never worked for me.

                    hth

                    Janina

                    Willem van der Walt writes:

                        Good day,
                        I have revived my x-windows system, but still need to get orca running.
                        Actually, it seem to be running, but it is not talking as my
                        speech-dispatcher is not working.
                        I kind of remember that one had a choice to either directly use espeak or
                        use it through speech-dispatcher.
                        OK, so I am trying to run orca from a console, to set it up to use espeak
                        directly, but it wants to connect to the x server.
                        How can I make this change from the command line?
                        I am happy to edit configuration files if I know which one and where to look
                        for it.
                        I am running ubuntu 18.04, reached through an upgrade.
                        The orca version is 3.28.0
                        TIA, Willem
                        
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                        orca-list mailing list
                        orca-list gnome org
                        https://mail.gnome.org/mailman/listinfo/orca-list
                        Orca wiki: https://wiki.gnome.org/Projects/Orca
                        Orca documentation: https://help.gnome.org/users/orca/stable/
                        GNOME Universal Access guide: 
https://help.gnome.org/users/gnome-help/stable/a11y.html
                        Log bugs and feature requests at http://bugzilla.gnome.org

                    -- 

                    Janina Sajka

                    Linux Foundation Fellow
                    Executive Chair, Accessibility Workgroup:    http://a11y.org

                    The World Wide Web Consortium (W3C), Web Accessibility Initiative (WAI)
                    Chair, Accessible Platform Architectures    http://www.w3.org/wai/apa


                
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                orca-list mailing list
                orca-list gnome org
                https://mail.gnome.org/mailman/listinfo/orca-list
                Orca wiki: https://wiki.gnome.org/Projects/Orca
                Orca documentation: https://help.gnome.org/users/orca/stable/
                GNOME Universal Access guide: https://help.gnome.org/users/gnome-help/stable/a11y.html
                Log bugs and feature requests at http://bugzilla.gnome.org

            
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            orca-list mailing list
            orca-list gnome org
            https://mail.gnome.org/mailman/listinfo/orca-list
            Orca wiki: https://wiki.gnome.org/Projects/Orca
            Orca documentation: https://help.gnome.org/users/orca/stable/
            GNOME Universal Access guide: https://help.gnome.org/users/gnome-help/stable/a11y.html
            Log bugs and feature requests at http://bugzilla.gnome.org



-- 
Odoslané z môjho Android zariadenia prostredníctvom K-9 Mail. Prosím, ospravedlňte moju stručnosť.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]