Ticket #521 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

module-combine always uses default sample specs and channel map

Reported by: mkbosmans Owned by: lennart
Milestone: 0.9.16 Component: module-combine-*
Keywords: Cc:

Description

In the case that all the slaves have the same sampling parameters the combined sink should use these instead of the global default.

Attachments

module-combine.patch (2.6 kB) - added by mkbosmans 3 years ago.
proposed patch
module-combine.diff (2.3 kB) - added by mkbosmans 3 years ago.
new patch

Change History

Changed 3 years ago by mkbosmans

proposed patch

Changed 3 years ago by mkbosmans

The proposed patch uses the following logic to determine the paramaters of the combined sink:

  • if all the slave sinks have the same sample format, us it.
  • use the maximum of the slaves' samplerates.
  • if all the slaves have the same channel map use this map.
  • if sample format or channel map of the slaves differ, use the default.
  • explicitly gives parameters are of course always used.

In this patch this logic is only applied for the case of explicitly defined slaves, but it is probably a good idea to do the same for the automatic slave list. This is easily done with some reshuffleing of the code.

Changed 3 years ago by lennart

Uh, what's the point of '(&ss)->' instead of 'ss.'?

More problematic is that ss.channels and map.channels need to match up. Which they don't with the patch.

Changed 3 years ago by mkbosmans

new patch

Changed 3 years ago by mkbosmans

Uh, what's the point of '(&ss)->' instead of 'ss.'?

You caught me, I have no experience in C. I'm one of those high-level language application programmers.

More problematic is that ss.channels and map.channels need to match up. Which they don't with the patch.

The new patch fixes this and is much cleaner in general.

I was thinking about adding some logic to make the channel_map of the combined sink a superset of all the slave channel_maps. This is probably what you want when combining a left,right and a front-left,front-right,rear-left,rear-right sink.
But in other cases this is not wanted, e.g. combining a left,right and a mono sink you would like just a left,right not a three channel combined sink. So I think only using the channel_map if there is an exact match suffices for now.

Changed 3 years ago by lennart

  • milestone 0.9.15 deleted

Changed 3 years ago by lennart

  • milestone set to 0.9.16

Looks mostly good to me. I'd however suggest that similar to how you pick the highest rate of all connected slaves you should pick the highest channel number. And for that channel number you should simply copy the channel map 1:1.

Changed 3 years ago by lennart

Also the parens in (slave_sink->sample_spec).format are unecessary. slave_sink->sample_spec.format works, too.

Changed 2 years ago by lennart

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

Fixed in b98cf3eb45b930a24c89e36689ff30ae3993117d

Note: See TracTickets for help on using tickets.