Skip to contentSkip to conversation

handling rate change on digital inputs?

DISCUSSION Johannes Berg 2 participants 5 messages May 30, 2006 – May 31, 2006

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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

#2 lore raw
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 -EIO in this case when stream is requested to come up (START, PAUSE_RELEASE or 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

#3 lore raw
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 -EIO in this case when stream is requested to come up (START, PAUSE_RELEASE or 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