Re: [orca-list] Semi-OT: Selecting Pulse device/profile from the command line



Hello,

I have originally missed this discussion.
I think since pulseaudio 8.0 or gnome 3.20 I am not sure which one, it is not possible to get the audio back by using the keyboard in the sound gnome control center applet. For example If I activate device which is not connected to any output I can't just arrow back to restore the previous configuration.

pacmd is the commandline interface to pulseaudio and it is really possible to do neat funky stuff with it. For example on my laptop I do have internal speakers I either connect simple headphones to it in such case everything plays through this single pulseaudio device. Or I am connecting external usb sound card. Through that external soundcard I am only playing speech dispatcher output. I had to setup this only once i.e. first when I have connected the USB device pulseaudio did nothing in the previous versions now it automagically switches to that similar to what Windows does. So to get the setup I would like to have once the USB is connected I use the sound gnome control center preferences to configure my internal speakers as the default output device and then using pacmd I'll manually route speech dispatcher to the usb device. Next time this usb device is plugged in pulseaudio automagically routes speech-dispatcher to it with no other tweaks for me.

for example here are some pacmd commands
pacmd list-sinks - print outs all the devices with their profiles, properties and similar You may just SSH in when the sound is lost and troubleshoot whether something is not accessing alsa directly locking pulseaudio instance.

pacmd list-sink-inputs - lists all streams with properties. For example you will see speech-dispatcher in this list all the time.

pacmd move-sink-input #n sink - moves sink-input #n to the specified sink. You can either enter its index or its name e.g. I do have the only one sink on the laptop currently.... <alsa_output.pci-0000_00_1b.0.analog-stereo>

pacmd set-default-sink <index or name> - sets what will be the default sound output device. No streams are moved when doing this. New streams start to play on the new default sink.

There are many more commands, this is what I think you might need for this.

Greetings

Peter



On 05.09.2016 at 07:44 Willem van der Walt wrote:
Hi Nolan,
I do not have a direct/detailled answer, but, as your devices are USB, plugging and unplugging will be picked up as events.
Udev is the system that creates device entries on the fly in /dev.
One can set up udev rules to ensure that a particular device will always be created with the same name and in the same way. As I understand it, one can also have a script run when a particular event occurs, with which I suppose, one should be able to set the default sound device automatically.
This might just give you a pointer where to start looking.
Regards, Willem


On Fri, 2 Sep 2016, Nolan Darilek wrote:

I have a semi-complicated soundsetup. My laptop has crappy internal speakers that I don't use unless I have to. It plugs in via USB to a dock, which has an internal sound device that I don't use. To the dock I've connected a Creative USB 5.1 surround system to which my desktop speakers connect, and which sees most of my use. I also run a set of wireless headphones, also connected via USB, which are only occasionally connected and in use.

This complicated setup never gave Windows any issues, but Linux/Pulse just can't handle it. At the moment I have the correct sound setup configured, but if I disconnect my hub then I often don't get sound back when I reconnect it. I've taken to pulling the hub connection, which causes fallback to the internal speakers, at which point I navigate to Settings and reconfigure the right connections.

But lately something is horribly broken and I don't know what. Sometimes, despite arrowing up and down on the device selection combo box, sound goes away and never comes back (I.e. I'd expect it to return at some point if my selection lands back on Internal Speakers, but it never does.) Sometimes, plugging back in the hub doesn't bring back my USB devices (as in, even my USB keyboard doesn't come back) and I can only conclude that rapidly cycling devices is confusing some subsystem or other.

Does anyone have any experience configuring this mess via the command line? It would be useful if I could dump my configuration as it is now, run a terminal command, and restore my preferred configuration without using the GUI. I also want to restore my sound profile to 5.0 Surround, which lately seems to be causing crashes as well. I seem to be locking up Linux entirely such that I can't even switch to another TTY and reboot.

As a semi-related aside, is there a way to navigate settings in combo boxes without selecting them? I'm wondering if I can navigate directly to the device I want and activate it without navigating through, and presumably rapidly cycling, a whole bunch of other devices between my current choice and the one I want. I don't know if that might be causing anything, I'm just annoyed at having to hard shutdown this laptop all of a sudden because I've lost all but my internal speakers.

Thanks.
_______________________________________________
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



--

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. Please consider the environment before printing this email. _______________________________________________
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



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