diff options
author | Eliot Blennerhassett <eliot@blennerhassett.gen.nz> | 2014-11-19 22:22:50 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-22 16:27:04 -0500 |
commit | 35a8dc1f66a0fa88144fcbcd562eb2b2c1e36f11 (patch) | |
tree | d50ff1b29ae7ae7c95481620743525d49ca9c7ef /sound/pci/asihpi | |
parent | 3872f19d96a55ec1d1e7af904d84457d91ef5a63 (diff) |
ALSA: asihpi: Logging format improvements
Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi')
-rw-r--r-- | sound/pci/asihpi/asihpi.c | 85 |
1 files changed, 39 insertions, 46 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 628ef7f146d9..c06903304e12 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
@@ -288,21 +288,17 @@ static void print_hwparams(struct snd_pcm_substream *substream, | |||
288 | { | 288 | { |
289 | char name[16]; | 289 | char name[16]; |
290 | snd_pcm_debug_name(substream, name, sizeof(name)); | 290 | snd_pcm_debug_name(substream, name, sizeof(name)); |
291 | snd_printd("%s HWPARAMS\n", name); | 291 | snd_printdd("%s HWPARAMS\n", name); |
292 | snd_printd(" samplerate %d Hz\n", params_rate(p)); | 292 | snd_printdd(" samplerate=%dHz channels=%d format=%d subformat=%d\n", |
293 | snd_printd(" channels %d\n", params_channels(p)); | 293 | params_rate(p), params_channels(p), |
294 | snd_printd(" format %d\n", params_format(p)); | 294 | params_format(p), params_subformat(p)); |
295 | snd_printd(" subformat %d\n", params_subformat(p)); | 295 | snd_printdd(" buffer=%dB period=%dB period_size=%dB periods=%d\n", |
296 | snd_printd(" buffer %d B\n", params_buffer_bytes(p)); | 296 | params_buffer_bytes(p), params_period_bytes(p), |
297 | snd_printd(" period %d B\n", params_period_bytes(p)); | 297 | params_period_size(p), params_periods(p)); |
298 | snd_printd(" access %d\n", params_access(p)); | 298 | snd_printdd(" buffer_size=%d access=%d data_rate=%dB/s\n", |
299 | snd_printd(" period_size %d\n", params_period_size(p)); | 299 | params_buffer_size(p), params_access(p), |
300 | snd_printd(" periods %d\n", params_periods(p)); | 300 | params_rate(p) * params_channels(p) * |
301 | snd_printd(" buffer_size %d\n", params_buffer_size(p)); | ||
302 | snd_printd(" %d B/s\n", params_rate(p) * | ||
303 | params_channels(p) * | ||
304 | snd_pcm_format_width(params_format(p)) / 8); | 301 | snd_pcm_format_width(params_format(p)) / 8); |
305 | |||
306 | } | 302 | } |
307 | 303 | ||
308 | static snd_pcm_format_t hpi_to_alsa_formats[] = { | 304 | static snd_pcm_format_t hpi_to_alsa_formats[] = { |
@@ -480,7 +476,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
480 | params_buffer_bytes(params), runtime->dma_addr); | 476 | params_buffer_bytes(params), runtime->dma_addr); |
481 | if (err == 0) { | 477 | if (err == 0) { |
482 | snd_printdd( | 478 | snd_printdd( |
483 | "stream_host_buffer_attach succeeded %u %lu\n", | 479 | "stream_host_buffer_attach success %u %lu\n", |
484 | params_buffer_bytes(params), | 480 | params_buffer_bytes(params), |
485 | (unsigned long)runtime->dma_addr); | 481 | (unsigned long)runtime->dma_addr); |
486 | } else { | 482 | } else { |
@@ -490,12 +486,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
490 | } | 486 | } |
491 | 487 | ||
492 | err = hpi_stream_get_info_ex(dpcm->h_stream, NULL, | 488 | err = hpi_stream_get_info_ex(dpcm->h_stream, NULL, |
493 | &dpcm->hpi_buffer_attached, | 489 | &dpcm->hpi_buffer_attached, NULL, NULL, NULL); |
494 | NULL, NULL, NULL); | ||
495 | |||
496 | snd_printdd("stream_host_buffer_attach status 0x%x\n", | ||
497 | dpcm->hpi_buffer_attached); | ||
498 | |||
499 | } | 490 | } |
500 | bytes_per_sec = params_rate(params) * params_channels(params); | 491 | bytes_per_sec = params_rate(params) * params_channels(params); |
501 | width = snd_pcm_format_width(params_format(params)); | 492 | width = snd_pcm_format_width(params_format(params)); |
@@ -563,10 +554,10 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
563 | char name[16]; | 554 | char name[16]; |
564 | 555 | ||
565 | snd_pcm_debug_name(substream, name, sizeof(name)); | 556 | snd_pcm_debug_name(substream, name, sizeof(name)); |
566 | snd_printdd("%s trigger\n", name); | ||
567 | 557 | ||
568 | switch (cmd) { | 558 | switch (cmd) { |
569 | case SNDRV_PCM_TRIGGER_START: | 559 | case SNDRV_PCM_TRIGGER_START: |
560 | snd_printdd("%s trigger start\n", name); | ||
570 | snd_pcm_group_for_each_entry(s, substream) { | 561 | snd_pcm_group_for_each_entry(s, substream) { |
571 | struct snd_pcm_runtime *runtime = s->runtime; | 562 | struct snd_pcm_runtime *runtime = s->runtime; |
572 | struct snd_card_asihpi_pcm *ds = runtime->private_data; | 563 | struct snd_card_asihpi_pcm *ds = runtime->private_data; |
@@ -587,7 +578,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
587 | * data?? | 578 | * data?? |
588 | */ | 579 | */ |
589 | unsigned int preload = ds->period_bytes * 1; | 580 | unsigned int preload = ds->period_bytes * 1; |
590 | snd_printddd("%d preload x%x\n", s->number, preload); | 581 | snd_printddd("%d preload %d\n", s->number, preload); |
591 | hpi_handle_error(hpi_outstream_write_buf( | 582 | hpi_handle_error(hpi_outstream_write_buf( |
592 | ds->h_stream, | 583 | ds->h_stream, |
593 | &runtime->dma_area[0], | 584 | &runtime->dma_area[0], |
@@ -610,7 +601,6 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
610 | } else | 601 | } else |
611 | break; | 602 | break; |
612 | } | 603 | } |
613 | snd_printdd("start\n"); | ||
614 | /* start the master stream */ | 604 | /* start the master stream */ |
615 | snd_card_asihpi_pcm_timer_start(substream); | 605 | snd_card_asihpi_pcm_timer_start(substream); |
616 | if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || | 606 | if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || |
@@ -619,6 +609,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
619 | break; | 609 | break; |
620 | 610 | ||
621 | case SNDRV_PCM_TRIGGER_STOP: | 611 | case SNDRV_PCM_TRIGGER_STOP: |
612 | snd_printdd("%s trigger stop\n", name); | ||
622 | snd_card_asihpi_pcm_timer_stop(substream); | 613 | snd_card_asihpi_pcm_timer_stop(substream); |
623 | snd_pcm_group_for_each_entry(s, substream) { | 614 | snd_pcm_group_for_each_entry(s, substream) { |
624 | if (snd_pcm_substream_chip(s) != card) | 615 | if (snd_pcm_substream_chip(s) != card) |
@@ -637,7 +628,6 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
637 | } else | 628 | } else |
638 | break; | 629 | break; |
639 | } | 630 | } |
640 | snd_printdd("stop\n"); | ||
641 | 631 | ||
642 | /* _prepare and _hwparams reset the stream */ | 632 | /* _prepare and _hwparams reset the stream */ |
643 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); | 633 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); |
@@ -650,12 +640,12 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
650 | break; | 640 | break; |
651 | 641 | ||
652 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 642 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
653 | snd_printdd("pause release\n"); | 643 | snd_printdd("%s trigger pause release\n", name); |
654 | hpi_handle_error(hpi_stream_start(dpcm->h_stream)); | 644 | hpi_handle_error(hpi_stream_start(dpcm->h_stream)); |
655 | snd_card_asihpi_pcm_timer_start(substream); | 645 | snd_card_asihpi_pcm_timer_start(substream); |
656 | break; | 646 | break; |
657 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 647 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
658 | snd_printdd("pause\n"); | 648 | snd_printdd("%s trigger pause push\n", name); |
659 | snd_card_asihpi_pcm_timer_stop(substream); | 649 | snd_card_asihpi_pcm_timer_stop(substream); |
660 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); | 650 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); |
661 | break; | 651 | break; |
@@ -730,7 +720,6 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
730 | 720 | ||
731 | snd_pcm_debug_name(substream, name, sizeof(name)); | 721 | snd_pcm_debug_name(substream, name, sizeof(name)); |
732 | 722 | ||
733 | snd_printdd("%s snd_card_asihpi_timer_function\n", name); | ||
734 | 723 | ||
735 | /* find minimum newdata and buffer pos in group */ | 724 | /* find minimum newdata and buffer pos in group */ |
736 | snd_pcm_group_for_each_entry(s, substream) { | 725 | snd_pcm_group_for_each_entry(s, substream) { |
@@ -790,19 +779,20 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
790 | newdata); | 779 | newdata); |
791 | } | 780 | } |
792 | 781 | ||
793 | snd_printdd("hw_ptr 0x%04lX, appl_ptr 0x%04lX\n", | 782 | snd_printddd("timer1, %s, %d, S=%d, elap=%d, rw=%d, dsp=%d, left=%d, aux=%d, space=%d, hw_ptr=%ld, appl_ptr=%ld\n", |
783 | name, s->number, state, | ||
784 | ds->pcm_buf_elapsed_dma_ofs, | ||
785 | ds->pcm_buf_host_rw_ofs, | ||
786 | pcm_buf_dma_ofs, | ||
787 | (int)bytes_avail, | ||
788 | |||
789 | (int)on_card_bytes, | ||
790 | buffer_size-bytes_avail, | ||
794 | (unsigned long)frames_to_bytes(runtime, | 791 | (unsigned long)frames_to_bytes(runtime, |
795 | runtime->status->hw_ptr), | 792 | runtime->status->hw_ptr), |
796 | (unsigned long)frames_to_bytes(runtime, | 793 | (unsigned long)frames_to_bytes(runtime, |
797 | runtime->control->appl_ptr)); | 794 | runtime->control->appl_ptr) |
798 | 795 | ); | |
799 | snd_printdd("%d S=%d, " | ||
800 | "rw=0x%04X, dma=0x%04X, left=0x%04X, " | ||
801 | "aux=0x%04X space=0x%04X\n", | ||
802 | s->number, state, | ||
803 | ds->pcm_buf_host_rw_ofs, pcm_buf_dma_ofs, | ||
804 | (int)bytes_avail, | ||
805 | (int)on_card_bytes, buffer_size-bytes_avail); | ||
806 | loops++; | 796 | loops++; |
807 | } | 797 | } |
808 | pcm_buf_dma_ofs = min_buf_pos; | 798 | pcm_buf_dma_ofs = min_buf_pos; |
@@ -820,7 +810,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
820 | 810 | ||
821 | next_jiffies = max(next_jiffies, 1U); | 811 | next_jiffies = max(next_jiffies, 1U); |
822 | dpcm->timer.expires = jiffies + next_jiffies; | 812 | dpcm->timer.expires = jiffies + next_jiffies; |
823 | snd_printdd("jif %d buf pos 0x%04X newdata 0x%04X xfer 0x%04X\n", | 813 | snd_printddd("timer2, jif=%d, buf_pos=%d, newdata=%d, xfer=%d\n", |
824 | next_jiffies, pcm_buf_dma_ofs, newdata, xfercount); | 814 | next_jiffies, pcm_buf_dma_ofs, newdata, xfercount); |
825 | 815 | ||
826 | snd_pcm_group_for_each_entry(s, substream) { | 816 | snd_pcm_group_for_each_entry(s, substream) { |
@@ -852,7 +842,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
852 | } | 842 | } |
853 | 843 | ||
854 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 844 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
855 | snd_printddd("P%d write1 0x%04X 0x%04X\n", | 845 | snd_printddd("write1, P=%d, xfer=%d, buf_ofs=%d\n", |
856 | s->number, xfer1, buf_ofs); | 846 | s->number, xfer1, buf_ofs); |
857 | hpi_handle_error( | 847 | hpi_handle_error( |
858 | hpi_outstream_write_buf( | 848 | hpi_outstream_write_buf( |
@@ -862,7 +852,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
862 | if (xfer2) { | 852 | if (xfer2) { |
863 | pd = s->runtime->dma_area; | 853 | pd = s->runtime->dma_area; |
864 | 854 | ||
865 | snd_printddd("P%d write2 0x%04X 0x%04X\n", | 855 | snd_printddd("write2, P=%d, xfer=%d, buf_ofs=%d\n", |
866 | s->number, | 856 | s->number, |
867 | xfercount - xfer1, buf_ofs); | 857 | xfercount - xfer1, buf_ofs); |
868 | hpi_handle_error( | 858 | hpi_handle_error( |
@@ -872,7 +862,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
872 | &ds->format)); | 862 | &ds->format)); |
873 | } | 863 | } |
874 | } else { | 864 | } else { |
875 | snd_printddd("C%d read1 0x%04x\n", | 865 | snd_printddd("read1, C=%d, xfer=%d\n", |
876 | s->number, xfer1); | 866 | s->number, xfer1); |
877 | hpi_handle_error( | 867 | hpi_handle_error( |
878 | hpi_instream_read_buf( | 868 | hpi_instream_read_buf( |
@@ -880,7 +870,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
880 | pd, xfer1)); | 870 | pd, xfer1)); |
881 | if (xfer2) { | 871 | if (xfer2) { |
882 | pd = s->runtime->dma_area; | 872 | pd = s->runtime->dma_area; |
883 | snd_printddd("C%d read2 0x%04x\n", | 873 | snd_printddd("read2, C=%d, xfer=%d\n", |
884 | s->number, xfer2); | 874 | s->number, xfer2); |
885 | hpi_handle_error( | 875 | hpi_handle_error( |
886 | hpi_instream_read_buf( | 876 | hpi_instream_read_buf( |
@@ -933,7 +923,7 @@ snd_card_asihpi_playback_pointer(struct snd_pcm_substream *substream) | |||
933 | snd_pcm_debug_name(substream, name, sizeof(name)); | 923 | snd_pcm_debug_name(substream, name, sizeof(name)); |
934 | 924 | ||
935 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); | 925 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); |
936 | snd_printddd("%s pointer = 0x%04lx\n", name, (unsigned long)ptr); | 926 | snd_printddd("%s, pointer=%ld\n", name, (unsigned long)ptr); |
937 | return ptr; | 927 | return ptr; |
938 | } | 928 | } |
939 | 929 | ||
@@ -1081,9 +1071,10 @@ snd_card_asihpi_capture_pointer(struct snd_pcm_substream *substream) | |||
1081 | { | 1071 | { |
1082 | struct snd_pcm_runtime *runtime = substream->runtime; | 1072 | struct snd_pcm_runtime *runtime = substream->runtime; |
1083 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; | 1073 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; |
1074 | char name[16]; | ||
1075 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
1084 | 1076 | ||
1085 | snd_printddd("capture pointer %d=%d\n", | 1077 | snd_printddd("%s, pointer=%d\n", name, dpcm->pcm_buf_dma_ofs); |
1086 | substream->number, dpcm->pcm_buf_dma_ofs); | ||
1087 | /* NOTE Unlike playback can't use actual samples_played | 1078 | /* NOTE Unlike playback can't use actual samples_played |
1088 | for the capture position, because those samples aren't yet in | 1079 | for the capture position, because those samples aren't yet in |
1089 | the local buffer available for reading. | 1080 | the local buffer available for reading. |
@@ -2867,6 +2858,8 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2867 | asihpi->in_min_chans = 1; | 2858 | asihpi->in_min_chans = 1; |
2868 | } | 2859 | } |
2869 | 2860 | ||
2861 | snd_printk(KERN_INFO "update_interval_frames: %d", | ||
2862 | asihpi->update_interval_frames); | ||
2870 | snd_printk(KERN_INFO "Has dma:%d, grouping:%d, mrx:%d\n", | 2863 | snd_printk(KERN_INFO "Has dma:%d, grouping:%d, mrx:%d\n", |
2871 | asihpi->can_dma, | 2864 | asihpi->can_dma, |
2872 | asihpi->support_grouping, | 2865 | asihpi->support_grouping, |