Skip to contentSkip to conversation

pcm hw parameters?

DISCUSSION Johannes Berg 2 participants 3 messages Mar 24, 2006 – Mar 28, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

Quick question: When are the pcm hardware parameters surfaced to userspace? Are those the ones I register in snd_pcm_new?

Thing is -- I have the problem that in theory, my codec can support anything from 8KHz to 96KHz but when turning on digital output, it needs to be restricted to the ones the digital output is ok with.

Of course I can trivially forbid turning on the digital out when a wrong stream is open, but what about the other way around? When digital out is turned on, and I forbid opening the stream when say 8KHz is selected, does it screw over userspace and fail, or can I tell it what else to use?

Similar things happen when you have digital input and it clocks both out and in -- then you have to output the same bitrate as the input is coming in at...

Thanks,
johannes

#1 lore raw

At Fri, 24 Mar 2006 14:19:47 +0100,

Quoted 9 lines · Johannes Berg

Hi,

Quick question: When are the pcm hardware parameters surfaced to userspace? Are those the ones I register in snd_pcm_new?

Thing is -- I have the problem that in theory, my codec can support anything from 8KHz to 96KHz but when turning on digital output, it needs to be restricted to the ones the digital output is ok with.

It's hard to restrict parameters on demands (although theoretically it's possible). We usually provide two different devices, one for the normal i/o and another for the digital i/o, to avoid such conflicts.

The apps that send to the digital data would choose "spdif" or whatever appropriate PCM name, and the system will reroute it.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#2 lore raw
Quoted 4 lines · Takashi Iwai

It's hard to restrict parameters on demands (although theoretically it's possible). We usually provide two different devices, one for the normal i/o and another for the digital i/o, to avoid such conflicts.

I'm doing something like that now... Mind taking a look at i2sbus-pcm.c in my git repo http://johannes.sipsolutions.net/snd-aoa.git/ ?

johannes