Ticket #619 (reopened enhancement)

Opened 3 years ago

Last modified 2 years ago

Autodetection always shows one device per sound card but sometimes could have more tha one

Reported by: howl Owned by: lennart
Milestone: Component: module-hal-detect
Keywords: Cc: howl.nsp@…

Description

When using autodetection only is shown one device per audio card but some cards can have multiple audio devices available. This let the user without the option to select witch output of a certain sound card is used PER application.

Doing it manually is possible, I attach a screen shot showing a manual configuration result: load-module module-alsa-source device=hw:0,0 load-module module-alsa-source device=hw:1,0 load-module module-alsa-sink device=surround51:0 load-module module-alsa-sink device=hdmi:0

Using module-hal-detect or module-detect only appears one device, you can use the profile selection yo select one or another ouput, but, this doesn't let you to make ones applications to sound to one output and other ones to another.

Attachments

Pantallazo.jpg (245.6 kB) - added by howl 3 years ago.
pulse-config-example.jpg (72.1 kB) - added by howl 2 years ago.
pulse-config-example2.jpg (65.7 kB) - added by howl 2 years ago.

Change History

Changed 3 years ago by howl

  Changed 3 years ago by lennart

  • status changed from new to closed
  • resolution set to duplicate

Duplicate of #139

  Changed 3 years ago by howl

  • status changed from closed to reopened
  • resolution duplicate deleted

I'm sorry but this is not the same bug, it'ss not about the profile selection.

  Changed 3 years ago by howl

Perhaps I have to re-explain it.

Look this screenshot http://pulseaudio.org/attachment/ticket/618/pulseaudio 0.9.15 recortado.jpg I have only one sound card with 3 outputs, analog (stereo, 4.0, 5.0, 5.1, 7.1...), digital optical (stereo) an digital hdmi (stereo). I have tested 0.9.15 and profiles works well, always one device and with the profile we select the active output. Is only possible to use one profile at time, so if you use analog you don't have sound in hdmi or, optical, if you have sound set to hdmi you don't have sound in analog or optical. I have tested 0.9.15 using karmic livecd.

Now take a look to the screenshot attached here http://pulseaudio.org/attachment/ticket/619/Pantallazo.jpg is my ubuntu jaunty install. with autodetection only one device is shown as 0.9.15 but with manual config we can have multiple devices per output type of the card, in this case I have configured Analog and HDMI. As you can see you ca have simultaneous output in HDMI and Analog, in the screenshot you can see Totem putting sound in the HDMI and VLC putting sound in the analogs, with profiles you can do it.

If you think is related then the approach of profiles is bad. The take out options like the one I'm showing, VLC through analog jacks and Totem through HDMI.

  Changed 3 years ago by howl

...with profiles you can't* do it.

...

  Changed 3 years ago by coling

Yeah, at present (I think this is correct) PA only probes for one output and one input simultaneously. What you're asking for is to probe for and test multiple outputs at the same time - e.g. two outputs + two input during probe (which would increase the number of tests performed and thus the startup time).

It will of course make the list of profiles longer :D

Perhaps we need to start saving this data in a db Lennart? Obviously it needs to be protected in some way against being blocked by other apps during the testing phase to ensure the accuracy of the cached result... which would be a pain :(

  Changed 3 years ago by howl

Profiles are good for example to select the mode of one output of the same time, for example Analogs, you can select Stereo or 4.0 or 5.1. But different outputs shouldn't be shown as profiles of one device, they must be another device in itself.

There is no need to increase the Profile list, in fact with this approach the profiles will decrease and the ones that will increase are the devices available per sound card.

  Changed 3 years ago by coling

For a lot of hardware the "devices" are not mutually exclusive. i.e. if I enable Digital output on device 1, I can no longer use analog output on device 0. That's the main problem this whole system resolves.

  Changed 3 years ago by howl

The conversation is becoming similar to the other ticket I have open before http://www.pulseaudio.org/ticket/618

Perhaps they could have the same solution.

When changing output type, ALSA changes the devices available? If it does could be another way to go without a db.

  Changed 3 years ago by lennart

In PA 0.9.16 you can edit the profile definition files to define your own profiles with more than one sink or more than one source.

https://tango.0pointer.de/pipermail/pulseaudio-discuss/2009-June/004229.html

follow-up: ↓ 11   Changed 3 years ago by howl

There isn't a way in ALSA API to detect this and automatically do it?

If not, If you think that could be possible I can issue it myself to their bug tracker and see if the have time to do it. Make this could be fantastic, automatically have all the possibilities that a certain card have, only need to configure manually situations like analog digital switches for the same connector or other similar situations.

in reply to: ↑ 10   Changed 3 years ago by lennart

Replying to howl:

There isn't a way in ALSA API to detect this and automatically do it?

No there isn't. ALSA has a very weak enumeraton API that includes no information about which device striign are exclusive to each other and which ones aren't.

If not, If you think that could be possible I can issue it myself to their bug tracker and see if the have time to do it. Make this could be fantastic, automatically have all the possibilities that a certain card have, only need to configure manually situations like analog digital switches for the same connector or other similar situations.

Good luck with that!

  Changed 2 years ago by howl

I have been messing arround with /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf and yes, it's very easy to configure multiple i/o per card, but, while doing it I was thinking another way to do it.

When someone have the possibility to have multiple outputs at the same time usually someone wants to use this feature of his/her sound card and when someone have a sound card that have some outputs or inputs that cannot be at the same time it's more likely that he or she is going to use only one and are not going to be switching between the outputs.

So, what about to list the user all the inputs and outputs available detected by pulseaudio, and let the user, with a checkbox per i/o to enable or disable what he or she wants. I think that this can solve the issue and also make much cleaner the configuration tab of pulseaudio's volume control.

  Changed 2 years ago by howl

Also some cases like the analog outputs for the same card (stereo, 4.0, 4.1, 5.0, 5.1...) can be shown with a radiobutton to select the desired channels setup and all of the controlled by a global checkbox that enables or disables the analog output.

follow-up: ↓ 16   Changed 2 years ago by lennart

First, I doubt that driving SPDIF and analog out at the same time is really a much needed feature. I mean, really, how many ears do you have? 4? I am pretty sure some people do want to make sure of that, but I doubt it's a non-trivial number.

Now, the big problem here is that we cannot auto detect whether spdif and analog are exclsuive to each other or not. Currently we try every combinatin of input and output and if it works add it to our list of working profiles. However, if we change this logic to also test every combination of analog out and spdif out then we have a problem: we cannot distuingish the case where the card supports hw mixing but only one output at a time and where the card supports two simultaneous and independant outputs. That means on some hardware we'd expose a profile "spdif out + analog out" which would actuallly mix and output to one, or to both outputs. And we certainly don't want to expose that.

So, as mentioned, the alsa enumeration API is just too simple. It does not include information about which devices of a card can be used together and which devices cannot.

  Changed 2 years ago by howl

First of all, no I haven't got 4 ears but I got a sound card that can have multiple outputs that can serve the same like the mid-end av recievers that have outputs like 7.1+2. The extra independent outputs are usually used by the people to put sound in another room with the same device. This is not recent I have a Tenchnics Stereo Amplifier SU-Z22 of the early 80's with this feature. Don't have 4 ears but seems to have more idea of the applications of multiple output devices.

I'm going to draw a possible gui with pen and scan it to attach here. Could be all the content of the configuration tab of volume control.

Changed 2 years ago by howl

in reply to: ↑ 14 ; follow-up: ↓ 17   Changed 2 years ago by howl

Replying to lennart:

Now, the big problem here is that we cannot auto detect whether spdif and analog are exclsuive to each other or not. Currently we try every combinatin of input and output and if it works add it to our list of working profiles. However, if we change this logic to also test every combination of analog out and spdif out then we have a problem: we cannot distuingish the case where the card supports hw mixing but only one output at a time and where the card supports two simultaneous and independant outputs. That means on some hardware we'd expose a profile "spdif out + analog out" which would actuallly mix and output to one, or to both outputs. And we certainly don't want to expose that.

First I will tell you that your approach is failing with this, with your auto profiles make by combination I can select "Output Digital Stereo (IEC958) + Input Digital Stereo (IEC958)", when the same alsa-mixer has and switch to turn the iec958 in output or capture mode, then your system to detect if profiles combination works fails, al least is some hardware like the one included in M3N78-VM, I said this before.

http://pulseaudio.org/attachment/ticket/619/pulse-config-example.jpg

The idea is start selecting the sound card to configure, then the output (this could be called device as we could configure also inputs). We could enable or disable the selected output and also set the number of channels of it. The test button doesn't need explanation, something like speaker-test. The Remap button could be used for situations like the one we have with the hdmi now a days, you press the Remap button and then the first speaker starts to sound, then the user must click the corresponding speaker in the picture, when finished the mappings should be ok. An interactive and easy way to remap a device, the remap could be saved in /usr/share/pulseaudio/... in a file called "devicename.conf" with the corresponding rules to be applied only to the pertinent device.

This could prevent other issues, for example with the profiles when you are playing sound in Analog for example and select another self-made profile that have multiple outputs including the Analog that is already with applications active on it, sometimes applications lost the stream sometimes not, with the system I'm proposing this shouldn't happen, if I want to Enable HDMI should not affect the other outputs.

in reply to: ↑ 16 ; follow-up: ↓ 18   Changed 2 years ago by lennart

Replying to howl:

First I will tell you that your approach is failing with this, with your auto profiles make by combination I can select "Output Digital Stereo (IEC958) + Input Digital Stereo (IEC958)", when the same alsa-mixer has and switch to turn the iec958 in output or capture mode, then your system to detect if profiles combination works fails, al least is some hardware like the one included in M3N78-VM, I said this before.

Sorry, I cannot parse this paragraph.

http://pulseaudio.org/attachment/ticket/619/pulse-config-example.jpg The idea is start selecting the sound card to configure, then the output (this could be called device as we could configure also inputs). We could enable or disable the selected output and also set the number of channels of it. The test button doesn't need explanation, something like speaker-test. The Remap button could be used for situations like the one we have with the hdmi now a days, you press the Remap button and then the first speaker starts to sound, then the user must click the corresponding speaker in the picture, when finished the mappings should be ok. An interactive and easy way to remap a device, the remap could be saved in /usr/share/pulseaudio/... in a file called "devicename.conf" with the corresponding rules to be applied only to the pertinent device. This could prevent other issues, for example with the profiles when you are playing sound in Analog for example and select another self-made profile that have multiple outputs including the Analog that is already with applications active on it, sometimes applications lost the stream sometimes not, with the system I'm proposing this shouldn't happen, if I want to Enable HDMI should not affect the other outputs.

I am not really convinced that exposing too many UI options here is really such a great idea. Also stuff like channel testing is already being worked on in g-v-c.

Please understand that my interest in hacking and beefing up pavucontrol is rather minimal. g-v-c is the way to the future.

in reply to: ↑ 17   Changed 2 years ago by howl

Replying to lennart:

Replying to howl:

First I will tell you that your approach is failing with this, with your auto profiles make by combination I can select "Output Digital Stereo (IEC958) + Input Digital Stereo (IEC958)", when the same alsa-mixer has and switch to turn the iec958 in output or capture mode, then your system to detect if profiles combination works fails, al least is some hardware like the one included in M3N78-VM, I said this before.

Sorry, I cannot parse this paragraph.

You said that a test if the combination of outputs with inputs when auto generating profiles, and I say that then there is something wrong, pulseaudio generates a "Output Digital Stereo (IEC958) + Input Digital Stereo (IEC958)" profile for the sound card included in the M3N78-EM motherboard which is indeed an impossible combination. You can set the iec958 to be input or output using a switch in alsa-mixer, but cannot be both at the same time.

That's why I tell my approach, don't need to have all the options I putted in the example I taken advantage to leave it more completed for the purpose of the tab, is all configuration of the sound device. I'm going to attach another draw with only the outputs and inputs activation.

The user can choice then separately. I know, you say that some configurations are not possible, let the user to check it, the profile auto generation is making also impossible combinations, so, this option doesn't limit the user and have the same disadvantages. Also I know that touching profiles.conf is possible to do, but this is graphical. Implement this could be better for g-v-c also.

Changed 2 years ago by howl

Note: See TracTickets for help on using tickets.