I am pruning the logs in previous e-mails here since its becoming too lengthy to read. After rewriting the pointer function I am not getting the input/output error but I am getting underruns. I think I am little closer to the working driver now, am I?
here is the log, after getting couple of underrun error messages the dma just gets halted.
Log:
snd_card_omap_alsa_open start
eac_enable_clocks start Clocks are already enabled eac_set_samplerate start
eac_set_samplerate end after audio init audio_dma_request start omap_request_alsa_sound_dma start omap_request_alsa_sound_dma end snd_card_omap_alsa_open end Playing WAVE 'startup.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo snd_omap_alsa_hw_params start data format is 2 -- Channel 0 rate =2 and buffer size is ac44 snd_omap_alsa_hw_params end snd_omap_alsa_prepare start audio_configure_dma_channel start dma_size is 2000 dma_ptr is c3540000 snd_omap_alsa_prepare end SNDRV_PCM_IOCTL1_RESET Inside snd_pcm_lib_ioctl_reset Inside snd_pcm_do_start snd_omap_alsa_trigger start audio_set_dma_params_play start audio_set_dma_params_play end audio_start_dma_chain start /*These are the platform specific dma setup routines*/ Inside omap_start_dma 1 Inside omap_start_dma 2 Inside omap_start_dma 3 audio_start_dma_chain end snd_omap_alsa_trigger end sound_dma_irq_handler start !!! In DMA IRQ handler lch=0,status=0x20, dma_status=32, data=c3cb5704 callback_omap_alsa_sound_dma start Inside /snd_pcm_period_elapsed Inside snd_pcm_update_hw_ptr_interrupt Inside snd_pcm_update_hw_ptr_pos snd_omap_alsa_pointer start Inside snd_pcm_update_hw_ptr_pos, pos is 18153472 /**Here is a BUG**/ ALSA sound/core/pcm_lib.c:167: BUG: stream = 0, pos = 0x1150000, buffer size = 0x4000, period size = 0x800 Inside snd_pcm_do_stop snd_omap_alsa_trigger start audio_stop_dma start omap_stop_alsa_sound_dma end omap_clear_alsa_sound_dma start omap_clear_alsa_sound_dma end snd_omap_alsa_trigger end Not active sound_dma_irq_handler end Inside snd_pcm_status /***Under run here ****/ underrun!!! (at least -33.431 mssnd_omap_alsa_prepare start long) audio_configure_dma_channel start dma_size is 2000 dma_ptr is c3540000 snd_omap_alsa_prepare end SNDRV_PCM_IOCTL1_RESET Inside snd_pcm_lib_ioctl_reset Inside snd_pcm_do_start snd_omap_alsa_trigger start audio_set_dma_params_play start audio_set_dma_params_play end audio_start_dma_chain start Inside omap_start_dma 1 Inside omap_start_dma 2 Inside omap_start_dma 3 audio_start_dma_chain end snd_omap_alsa_trigger end sound_dma_irq_handler start !!! In DMA IRQ handler lch=0,status=0x20, dma_status=32, data=c3cb5704 callback_omap_alsa_sound_dma start Inside /snd_pcm_period_elapsed Inside snd_pcm_update_hw_ptr_interrupt Inside snd_pcm_update_hw_ptr_pos snd_omap_alsa_pointer start Inside snd_pcm_update_hw_ptr_pos, pos is 18153472
/***Bug ***/ ALSA sound/core/pcm_lib.c:167: BUG: stream = 0, pos = 0x1150000, buffer size = 0x4000, period size = 0x800 Inside snd_pcm_do_stop snd_omap_alsa_trigger start audio_stop_dma start omap_stop_alsa_sound_dma end omap_clear_alsa_sound_dma start omap_clear_alsa_sound_dma end snd_omap_alsa_trigger end Not active sound_dma_irq_handler end Inside snd_pcm_status /***underrun***/ underrun!!! (at least -33.633 mssnd_omap_alsa_prepare start long) audio_configure_dma_channel start dma_size is 2000 dma_ptr is c3540000 snd_omap_alsa_prepare end SNDRV_PCM_IOCTL1_RESET Inside snd_pcm_lib_ioctl_reset Inside snd_pcm_do_start snd_omap_alsa_trigger start audio_set_dma_params_play start audio_set_dma_params_play end audio_start_dma_chain start Inside omap_start_dma 1 Inside omap_start_dma 2 Inside omap_start_dma 3 audio_start_dma_chain end snd_omap_alsa_trigger end sound_dma_irq_handler start !!! In DMA IRQ handler lch=0,status=0x20, dma_status=32, data=c3cb5704 callback_omap_alsa_sound_dma start Inside /snd_pcm_period_elapsed Inside snd_pcm_update_hw_ptr_interrupt Inside snd_pcm_update_hw_ptr_pos snd_omap_alsa_pointer start Inside snd_pcm_update_hw_ptr_pos, pos is 18153472 /***BUG**/ ALSA sound/core/pcm_lib.c:167: BUG: stream = 0, pos = 0x1150000, buffer size = 0x4000, period size = 0x800 Inside snd_pcm_do_stop snd_omap_alsa_trigger start audio_stop_dma start omap_stop_alsa_sound_dma end omap_clear_alsa_sound_dma start omap_clear_alsa_sound_dma end snd_omap_alsa_trigger end Not active sound_dma_irq_handler end Inside snd_pcm_status /***Underrun**/ underrun!!! (at least -33.759 mssnd_omap_alsa_prepare start long) audio_configure_dma_channel start dma_size is 2000 dma_ptr is c3540000 snd_omap_alsa_prepare end SNDRV_PCM_IOCTL1_RESET Inside snd_pcm_lib_ioctl_reset Inside snd_pcm_do_start snd_omap_alsa_trigger start audio_set_dma_params_play start audio_set_dma_params_play end audio_start_dma_chain start Inside omap_start_dma 1 Inside omap_start_dma 2
/******It hangs here, the dma halts here and no further messages are shown*******/