[alsa-devel] notifying userspace of hwparams change
Greetings,
I've got an HDMI receiver chip I'm working on a driver for which provides the audio signal from the HDMI source. An HDMI source can be a variety of sample-rates, channels, widths, and formats. If I understand correctly I need to register the device as supporting all the possible rates/channels/formats then constrain these to what is actually available at the time in the startup callback with snd_pcm_hw_contstraint_minmax and snd_pcm_hw_constraint_mask.
How do I notify userspace when the chip tells me that the HDMI audio source rate/channels/format has changed?
I know on the Video side the driver sends a V4L2_EVENT_SOURCE_CHANGE event to userspace when input format/resolution has changed so that userspace can stop streaming, call VIDIOC_QUERY_DV_TIMINGS and then VIDIOC_S_DV_TIMINGS with new timings.
Regards,
Tim
On Tue, 03 Oct 2017 18:11:50 +0200, Tim Harvey wrote:
Greetings,
I've got an HDMI receiver chip I'm working on a driver for which provides the audio signal from the HDMI source. An HDMI source can be a variety of sample-rates, channels, widths, and formats. If I understand correctly I need to register the device as supporting all the possible rates/channels/formats then constrain these to what is actually available at the time in the startup callback with snd_pcm_hw_contstraint_minmax and snd_pcm_hw_constraint_mask.
How do I notify userspace when the chip tells me that the HDMI audio source rate/channels/format has changed?
I know on the Video side the driver sends a V4L2_EVENT_SOURCE_CHANGE event to userspace when input format/resolution has changed so that userspace can stop streaming, call VIDIOC_QUERY_DV_TIMINGS and then VIDIOC_S_DV_TIMINGS with new timings.
This is one thing we need to address, but currently there is no notification mechanism for such changes. Or, better to say, we don't expect that the hw_constraint may change during the PCM operation.
When HDMI/DP is concerned, usually they have disconnect/reconnect before such hw_constraint change happens, so we can expect user-space doing re-opening the device in anyway.
But, the device disconnection is another issue to be improved. We're currently allowing the disconnection of the whole card, triggered by snd_card_disconnect(), but not in each component level. So it depends on the driver / device whether the current implementation works well or not.
thanks,
Takashi
participants (2)
-
Takashi Iwai
-
Tim Harvey