[PATCH v4] sound: rawmidi: Add framing mode
Jaroslav Kysela
perex at perex.cz
Tue Apr 13 17:44:12 CEST 2021
Dne 13. 04. 21 v 17:27 Takashi Iwai napsal(a):
> On Mon, 12 Apr 2021 21:32:37 +0200,
> David Henningsson wrote:
>>
>>> One thing I'm considering is how to inform the current framing and the
>>> timestamp mode to user-space. Currently we have only the ioctl to set
>>> the values but not to inquiry.
>>
>> Yes, this is the same as we do with PCM. There is no ioctl to get
>> current hw/sw params either.
>>
>>> Should we put those new information into the info or the status ioctl?
>>
>> I would prefer neither, because it is not necessary and creates an
>> inconsistency with PCM.
>
> Well, honestly speaking, ALSA PCM API design is no best one you should
> refer to... IMO, it should have had the symmetric get function, too.
> I guess it worked without such ioctl because the current PCM status is
> exposed via proc file. Without a way for inquiry of the current
> status, we may have had trouble for debugging.
>
> In that sense, it might make sense to extend the proc entry of the
> rawmidi status output, too.
The parameters can be cached in the user space. The "set" ioctl should return
an error, if the parameters are not accepted and the caller should check the
protocol version, if the newly added extensions are supported. So, this type
of ioctl can be added only when really necessary.
I see the only use when you pass the file descriptor to another process, but
usually, there's another channel to pass the setup, too.
The proc file is much better, because you can get the information without any
special tool and anytime.
Jaroslav
--
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
More information about the Alsa-devel
mailing list