handling rate change on digital inputs?
Hey,
While thinking about how I can support the optical input on Apple machines, I came to the following question:
What should I do if, while some app is recording, the input rate on the digital connector changes?
If it changes before the app starts recording, I can tell the app during .open what rate I have, but while it is recording? Can I (and should I) kick out the application?
johannes
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel
Quoted 10 lines · Johannes Berg
Hey,
While thinking about how I can support the optical input on Apple machines, I came to the following question:
What should I do if, while some app is recording, the input rate on the digital connector changes?
If it changes before the app starts recording, I can tell the app during .open what rate I have, but while it is recording? Can I (and should I) kick out the application?
Yes, the stream must go to the DRAINING state immediately when rate (or other parameter) does not match (it's good to check this condition in the interrupt handler) and trigger() callback must return -EIO in this case when stream is requested to come up (START, PAUSE_RELEASE or RESUME).
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Quoted 4 lines · Jaroslav Kysela
Yes, the stream must go to the DRAINING state immediately when rate (or other parameter) does not match (it's good to check this condition in the interrupt handler) and
trigger()callback must return-EIOin this case when stream is requested to come up (START,PAUSE_RELEASEor RESUME).
Do you know if there's any sample code for this somewhere? Or if any drivers implement this properly?
johannes
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel
Quoted 9 lines · Johannes Berg
Quoted 4 lines · Jaroslav Kysela
Yes, the stream must go to the DRAINING state immediately when rate (or other parameter) does not match (it's good to check this condition in the interrupt handler) and
trigger()callback must return-EIOin this case when stream is requested to come up (START,PAUSE_RELEASEor RESUME).Do you know if there's any sample code for this somewhere? Or if any drivers implement this properly?
Check pdaudiocf_pcm.c and i2c/other/ak4117.c.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
Quoted 4 lines · Jaroslav Kysela
Quoted 2 lines
Do you know if there's any sample code for this somewhere? Or if any drivers implement this properly?
Check
pdaudiocf_pcm.candi2c/other/ak4117.c.
Thanks, I'll take a look.
johannes
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel