Skip to contentSkip to conversation

XRUN handling with SND_PCM_MULTI

DISCUSSION Jeremy Hall 2 participants 2 messages Apr 15, 2003 – Apr 22, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

This probably was discussed with the introduction of a pcm_multi device--how to maintain sample-synch.

One possability is when a XRUN is seen on one of the devices, reset that device alone. This breaks sample-synch, for example if half the channels didn't see a XRUN and the other half did, suddenly time has become discontiguous--the half that saw the XRUN is now "ahead" of the half that didn't when you replay the program material.

So do you want to:

1: silence the XRUNning card so that sample-synch is maintained

2: remove good data from the NON-XRUNning card(s)

3: ignore it

I can't figure out what currently happens--currently if two devices try to run snd_pcm_period_elapsed in interrupt context the machine will potentially deadlock as both interrupts try to take the spinlock, each waiting on the other to release it.

Thoughts are welcome.

_J

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 15 lines · Jeremy Hall

Hi,

This probably was discussed with the introduction of a pcm_multi device--how to maintain sample-synch.

One possability is when a XRUN is seen on one of the devices, reset that device alone. This breaks sample-synch, for example if half the channels didn't see a XRUN and the other half did, suddenly time has become discontiguous--the half that saw the XRUN is now "ahead" of the half that didn't when you replay the program material.

So do you want to:

1: silence the XRUNning card so that sample-synch is maintained

Quoted 8 lines

2: remove good data from the NON-XRUNning card(s)

3: ignore it

I can't figure out what currently happens--currently if two devices try to run snd_pcm_period_elapsed in interrupt context the machine will potentially deadlock as both interrupts try to take the spinlock, each waiting on the other to release it.

The deadlock is fixed in CVS. All linked streams will be in same state at same time. On other hand, the actual multi plugin doesn't handle clock drift, so if streams have different clock sources, there will be generated an error (XRUN) after some time.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf