Ignore:
Timestamp:
Apr 3, 2017, 4:51:56 PM (8 years ago)
Author:
David Azarewicz
Message:

Merged/reintegrated v2 branch into trunk. Trunk is now v2

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c

    r464 r598  
    333333                if (extra) {
    334334                        start_addr += ccis;
    335                         end_addr += ccis;
     335                        end_addr += ccis + emu->delay_pcm_irq;
    336336                }
    337337                if (stereo && !extra) {
     
    361361        snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]);
    362362        snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24));
    363         snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24));
     363        snd_emu10k1_ptr_write(emu, PSST, voice,
     364                        (start_addr + (extra ? emu->delay_pcm_irq : 0)) |
     365                        (send_amount[2] << 24));
    364366        if (emu->card_capabilities->emu_model)
    365367                pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
     
    733735}
    734736
     737static inline void snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu,
     738                struct snd_emu10k1_pcm *epcm,
     739                struct snd_pcm_substream *substream,
     740                struct snd_pcm_runtime *runtime)
     741{
     742        unsigned int ptr, period_pos;
     743
     744        /* try to sychronize the current position for the interrupt
     745           source voice */
     746        period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt;
     747        period_pos %= runtime->period_size;
     748        ptr = snd_emu10k1_ptr_read(emu, CCCA, epcm->extra->number);
     749        ptr &= ~0x00ffffff;
     750        ptr |= epcm->ccca_start_addr + period_pos;
     751        snd_emu10k1_ptr_write(emu, CCCA, epcm->extra->number, ptr);
     752}
     753
    735754static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
    736755                                        int cmd)
     
    754773        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
    755774        case SNDRV_PCM_TRIGGER_RESUME:
     775                if (cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE)
     776                        snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime);
    756777                mix = &emu->pcm_mixer[substream->number];
    757778                snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix);
     
    870891        /*
    871892        printk(KERN_DEBUG
    872                "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n",
    873                ptr, runtime->buffer_size, runtime->period_size);
     893               "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n",
     894               (long)ptr, (long)runtime->buffer_size,
     895               (long)runtime->period_size);
    874896        */
    875897        return ptr;
Note: See TracChangeset for help on using the changeset viewer.