Skip to content

RFC: Accepting more format changes #342

Open
@pavhofman

Description

Currently the Capture/PlaybackFormatChange carries new samplerate integer. The alsa loopback device already does (and the usb gadget will do https://lore.kernel.org/all/CAB0kiBJm=Ya6a1mWRZ28p9=D_BesH55DFk4fd4wP0be4zKPR7w@mail.gmail.com/T/#mc2b68c2e74ed57e2998c1b0f42bfca82e07db181 ) offer a change in channel count and sample format too.

Rate can be read from the ctl. The sample format and channels params are not announced via some ctl, but would need to be read from the current hw params. These slaved devices always offer only one value as it's specified by their master side when activating the transmission.

Maybe it would be convenient to determine the newly=currently allowed params directly by the capture/playback threads when opening the device. Some params would be acceptable (e.g. sample format), some may be refused => exit (e.g. channel count not fitting the processing), some may require some adjustments (e.g. if the channel count could be accommodated to the current pipeline configuration somehow, or e.g. by selecting a different pipeline configuration for the given number of channels - just brainstorming).

When doing the current format params detection, maybe even the samplerate could be included. That would allow to kick in the resampler automatically even at first start, without the FormatChange message received. That could be usable for all backends. It would result in no parameter having to be carried by the FormatChange message.

In alsa all these format changes could be handled simply by using the plug plugin for the device (apart of samplerate conversion which is much more efficient in CDSP). In other backends which do not have the plug "luxury" they would need some CDSP support (probably just the format conversion which is already available anyway).

Just a thought for a bit of discussion, no real issue :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions