Lines Matching defs:pPulse
149 PulseVoice *pPulse = (PulseVoice *)userdata;
150 pPulse->fOpSuccess = fSuccess;
153 if (pPulse->cErrors < MAX_LOG_REL_ERRORS)
156 pPulse->cErrors++;
183 PulseVoice *pPulse = (PulseVoice *)userdata;
193 if (pPulse)
194 pPulse->cErrors = MAX_LOG_REL_ERRORS;
226 PulseVoice *pPulse = (PulseVoice *)userdata;
227 pPulse->fOpSuccess = fSuccess;
230 if (pPulse->cErrors < MAX_LOG_REL_ERRORS)
233 pPulse->cErrors++;
240 pa_operation_unref(pPulse->pDrainOp);
241 pPulse->pDrainOp = NULL;
368 PulseVoice *pPulse = (PulseVoice *) hw;
372 pPulse->pDrainOp = NULL;
374 pPulse->SampleSpec.format = aud_to_pulsefmt (as->fmt);
375 pPulse->SampleSpec.rate = as->freq;
376 pPulse->SampleSpec.channels = as->nchannels;
380 pPulse->BufAttr.tlength = (pa_bytes_per_second(&pPulse->SampleSpec)
382 pPulse->BufAttr.maxlength = (pPulse->BufAttr.tlength * 3) / 2;
383 pPulse->BufAttr.prebuf = -1; /* Same as tlength */
384 pPulse->BufAttr.minreq = -1; /* Pulse should set something sensible for minreq on it's own */
387 if (pulse_open (0, &pPulse->pStream, &pPulse->SampleSpec, &pPulse->BufAttr))
390 if (pulse_to_audfmt (pPulse->SampleSpec.format, &obt_as.fmt, &obt_as.endianness))
392 LogRel(("Pulse: Cannot find audio format %d\n", pPulse->SampleSpec.format));
396 obt_as.freq = pPulse->SampleSpec.rate;
397 obt_as.nchannels = pPulse->SampleSpec.channels;
400 cbBuf = audio_MIN(pPulse->BufAttr.tlength * 2, pPulse->BufAttr.maxlength);
402 pPulse->pPCMBuf = RTMemAllocZ(cbBuf);
403 if (!pPulse->pPCMBuf)
417 PulseVoice *pPulse = (PulseVoice *)hw;
419 if (pPulse->pStream)
422 pa_stream_disconnect(pPulse->pStream);
423 pa_stream_unref(pPulse->pStream);
425 pPulse->pStream = NULL;
428 if (pPulse->pPCMBuf)
430 RTMemFree (pPulse->pPCMBuf);
431 pPulse->pPCMBuf = NULL;
437 PulseVoice *pPulse = (PulseVoice *) hw;
454 cbAvail = pa_stream_writable_size (pPulse->pStream);
457 if (pPulse->cErrors < MAX_LOG_REL_ERRORS)
460 pPulse->cErrors++;
477 pu8Dst = advance (pPulse->pPCMBuf, hw->rpos << hw->info.shift);
481 if (pa_stream_write (pPulse->pStream, pu8Dst, cbToWrite,
505 PulseVoice *pPulse = (PulseVoice *) hw;
512 if ( pPulse->pDrainOp
513 && pa_operation_get_state(pPulse->pDrainOp) != PA_OPERATION_DONE)
515 pa_operation_cancel(pPulse->pDrainOp);
516 pa_operation_unref(pPulse->pDrainOp);
517 pPulse->pDrainOp = NULL;
522 pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0,
523 stream_success_callback, pPulse));
532 if (!pPulse->pDrainOp)
535 pulse_wait_for_operation(pa_stream_trigger(pPulse->pStream,
536 stream_success_callback, pPulse));
537 pPulse->pDrainOp = pa_stream_drain(pPulse->pStream,
538 stream_drain_callback, pPulse);
551 PulseVoice *pPulse = (PulseVoice *) hw;
554 pPulse->SampleSpec.format = aud_to_pulsefmt (as->fmt);
555 pPulse->SampleSpec.rate = as->freq;
556 pPulse->SampleSpec.channels = as->nchannels;
559 pPulse->BufAttr.fragsize = (pa_bytes_per_second(&pPulse->SampleSpec)
561 pPulse->BufAttr.maxlength = (pPulse->BufAttr.fragsize * 3) / 2;
564 if (pulse_open (1, &pPulse->pStream, &pPulse->SampleSpec, &pPulse->BufAttr))
567 if (pulse_to_audfmt (pPulse->SampleSpec.format, &obt_as.fmt, &obt_as.endianness))
569 LogRel(("Pulse: Cannot find audio format %d\n", pPulse->SampleSpec.format));
573 obt_as.freq = pPulse->SampleSpec.rate;
574 obt_as.nchannels = pPulse->SampleSpec.channels;
576 hw->samples = audio_MIN(pPulse->BufAttr.fragsize * 10, pPulse->BufAttr.maxlength)
578 pPulse->pu8PeekBuf = NULL;
585 PulseVoice *pPulse = (PulseVoice *)hw;
587 if (pPulse->pStream)
590 pa_stream_disconnect(pPulse->pStream);
591 pa_stream_unref(pPulse->pStream);
593 pPulse->pStream = NULL;
599 PulseVoice *pPulse = (PulseVoice *) hw;
608 cFramesAvail = pa_stream_readable_size(pPulse->pStream) >> hwshift;
613 if (pPulse->cErrors < MAX_LOG_REL_ERRORS)
616 pPulse->cErrors++;
624 if (pPulse->pu8PeekBuf)
625 cFramesAvail += (pPulse->cbPeekBuf - pPulse->offPeekBuf) >> hwshift;
631 if (!pPulse->pu8PeekBuf)
634 pa_stream_peek(pPulse->pStream, (const void**)&pPulse->pu8PeekBuf, &pPulse->cbPeekBuf);
636 pPulse->offPeekBuf = 0;
637 if ( !pPulse->pu8PeekBuf
638 || !pPulse->cbPeekBuf)
642 cFramesToPeek = audio_MIN((signed)( pPulse->cbPeekBuf
643 - pPulse->offPeekBuf) >> hwshift,
652 pPulse->pu8PeekBuf + pPulse->offPeekBuf,
657 pPulse->pu8PeekBuf + pPulse->offPeekBuf + (cFramesDelta << hwshift),
664 pPulse->pu8PeekBuf + pPulse->offPeekBuf,
671 pPulse->offPeekBuf += cFramesToPeek << hwshift;
674 if (pPulse->offPeekBuf == pPulse->cbPeekBuf)
677 pa_stream_drop(pPulse->pStream);
679 pPulse->pu8PeekBuf = NULL;
693 PulseVoice *pPulse = (PulseVoice *)hw;
700 pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 0,
701 stream_success_callback, pPulse));
707 if (pPulse->pu8PeekBuf)
709 pa_stream_drop(pPulse->pStream);
710 pPulse->pu8PeekBuf = NULL;
713 pulse_wait_for_operation(pa_stream_cork(pPulse->pStream, 1,
714 stream_success_callback, pPulse));