+ v4l-720-alsa-support-for-saa7134-that-should-work-fix.patch added to -mm tree
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines · [email protected] wrote:
The patch titled
v4l-720-alsa-support-for-saa7134-that-should-work-fixhas been added to the -mm tree. Its filename is
v4l-720-alsa-support-for-saa7134-that-should-work-fix.patchFrom: Andrew Morton <[email protected]>
Quoted 8 lines
*** Warning: "
saa7134_irq_alsa_done" [drivers/media/video/saa7134/saa7134.ko] undefined! *** Warning: "alsa_card_saa7134_exit" [drivers/media/video/saa7134/saa7134.ko] undefined! *** Warning: "alsa_card_saa7134_create" [drivers/media/video/saa7134/saa7134.ko] undefined!Cc Ricardo Cerqueira <[email protected]>Cc Nickolay V. Shmyrev <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Well that didn't work. The problem is that drivers/media/video/saa7134/saa7134-alsa.c doesn't appear to be wired up into the build system - it simply doesn't get compiled.
Please send a fix against next -mm?
Quoted 120 lines
drivers/media/video/saa7134/saa7134-alsa.c | 3 +++ 1 files changed, 3 insertions(+)diff -puN
drivers/media/video/saa7134/saa7134-alsa.c~v4l-720-alsa-support-for-saa7134-that-should-work-fixdrivers/media/video/saa7134/saa7134-alsa.cdrivers/media/video/saa7134/saa7134-alsa.c renamed from drivers/media/video/saa7134/saa7134-alsa.c~v4l-720-alsa-support-for-saa7134-that-should-work-fix +3
-0@@ -220,6 +220,7 @@ static int dsp_buffer_init(struct saa713return err;return 0 ; } +EXPORT_SYMBOL (saa7134_irq_alsa_done);static int snd_card_saa7134_pcm_prepare (snd_pcm_substream_t * substream)@@ -811,6 +812,7 @@ __nodev:kfree (card);return err; } +EXPORT_SYMBOL (alsa_card_saa7134_create);void alsa_card_saa7134_exit (void ) {@@ -819,3 +821,4 @@ void alsa_card_saa7134_exit(void)snd_card_free (snd_saa7134_cards[idx]); } } +EXPORT_SYMBOL (alsa_card_saa7134_exit);_
Patches currently in -mm which might be from [email protected] are
fec_8xx-build-fix.patch
posix-timers-smp-race-condition-tidy.patch
increase-maximum-kmalloc-size-to-256k-fix.patch
git-acpi-pciehprm_acpi-fix.patch
git-acpi-update-8250_acpi.patch
pnpacpi-handle-address-descriptors-in-_prs-fix-for-git-acpi-change.patch
git-agpgart.patch
git-alsa.patch
git-blktrace-fixup.patch
git-cpufreq.patch
git-drm-prep.patch
pci-gart-fix.patch
git-audit-audit_inode_context-warning-fix.patch
git-audit-selinux_inode_xattr_getsuffix-warning-fix.patch
git-input.patch
git-netdev-all-ieee80211_get_payload-warning-fix.patch
s2io-warning-fixes.patch
gregkh-pci-pci-driver-owner-removal-intel-agp-fix.patch
gregkh-pci-pci-driver-owner-removal-ali-agp-fix.patch
gregkh-pci-pci-driver-owner-removal-more-agp-borkage.patch
gregkh-pci-pci-driver-owner-removal-even-more-agp-borkage.patch gregkh-pci-pci-driver-owner-removal-even-more-even-more-agp-borkage.patch gregkh-pci-pci-driver-owner-removal-fix-lpfc.patch
gregkh-pci-pci-driver-owner-removal-fix-aic94xx_init.patch
gregkh-usb-usb-pm-09-fix.patch
eagle-and-adi-930-usb-adsl-modem-driver-tidies.patch
dma32-change-zones_shift-back-to-2-gfp_zonemask-too.patch
x86_64-vect-share-build-fix.patch
slab-dont-bug-on-duplicated-cache.patch
mm-poison-struct-page-for-ptlock-rename-private.patch
mm-implement-swap-prefetching-default-y.patch
mm-implement-swap-prefetching-tweaks.patch
swap-migration-v5-lru-operations-tweaks.patch
irda-donauboe-locking-fix.patch
acx1xx-wireless-driver-usb-is-bust.patch
acx1xx-allow-modular-build.patch
acx1xx-wireless-driver-spy_offset-went-away.patch
x86_64-div-by-zero-fix.patch
serial-console-touch-nmi-watchdog.patch
clear_buffer_uptodate-in-discard_buffer-check.patch
write_inode_now-write-inode-if-not-bdi_cap_no_writeback.patch
smbfs-readdir-vs-signal-fix.patch
process-events-connector-fixes.patch
rcu-signal-handling-tidies.patch
additional-catchup-rcu-signal-fixes-for-mm-warning-fix.patch
readahead-commentary.patch
ext3_readdir-use-generic-readahead.patch
slob-introduce-the-slob-allocator-fixes.patch
cpuset-memory-pressure-meter-gcc-295-fix.patch
gregkh-pci-pci-driver-owner-removal-synclink_gt-fix.patch changing-config_localversion-rebuilds-too-much-for-no-good-reason-ipw2200-fix.patch remove-ext2-xattr-permission-checks-warning-fixes.patch
remove-xfs-xattr-permission-checks-warning-fixes.patch replace-inode_update_time-with-file_update_time-switch-ntfs-to-touch_atime.patch
implement-kmap_atomic_irqsave.patch
edac-atomic-scrub-operations-fix.patch
edac-core-edac-support-code-ifdef-warnings.patch
edac-core-edac-support-code-fixes.patch
edac-core-edac-support-code-edac_mc_scrub_block-kunmap_atomic-fix.patch edac-core-edac-support-code-edac_mc_scrub_block-kunmap_atomic-fix-2.patch
parport-constification-fix.patch kprobes-use-rcu-for-unregister-synchronization-base-changes-vs-remove-hlist_for_each_rcu-api-convert-existing-use-to-hlist_for_each_entry_rcu.patch dlm-use-configfs-fix.patch
dvb-usb-urb-printk-fix.patch
v4l-720-alsa-support-for-saa7134-that-should-work-fix.patch
sched-disable-preempt-in-idle-tasks-2-powerpc-fixes.patch
sched-resched-and-cpu_idle-rework-warning-fix.patch
reiser4-only.patch
reiser4-swsusp-build-fix.patch
reiser4-printk-warning-fix.patch
reiser4-mm-remove-pg_highmem-fix.patch
reiser4-page-private-fixes.patch
reiser4-big-update-div64-fix.patch
reiser4-remove-c99isms.patch
reiser4-big-update-update_atime-fixes.patch
reiser4_releasepage-gfp_t-fixes.patch
ide-promise-flushing-hang-fix.patch
nvidiafb-fix-mode-setting-ppc-support-warning-fixes.patch
nr_blockdev_pages-in_interrupt-warning.patch
sysfs-crash-debugging.patch
device-suspend-debug.patch
ide-kmalloc-memset-kzalloc-conversion-fix.patch
tty-layer-buffering-revamp-pmac_zilog-warning-fix.patch-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Andrew Morton
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
Lee
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
Quoted 4 lines
Lee
Cheers,
Mauro.
- Adds alsa support for saa7134 video tuner.
drivers/media/video/saa7134/Makefile | 3 media/video/saa7134/saa7134-alsa.c | 1061 +++++++++++++++++++++++++++++++++ 2 files changed, 1063 insertions(+), 1 deletion(-)
drivers/media/video/saa7134/Makefile +2 -1
@@ -3,7 +3,8 @@ saa7134-objs := saa7134-cards.o saa7134- saa7134-oss.o saa7134-ts.o saa7134-tvaudio.o \ saa7134-vbi.o saa7134-video.o saa7134-input.o -obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o saa6752hs.o +obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ + saa6752hs.o saa7134-alsa.o obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o EXTRA_CFLAGS += -I$(src)/..
media/video/saa7134/saa7134-alsa.c new file +1061 -0
1,061 lines not on this page · raw message
Quoted 13 lines · Mauro Carvalho Chehab
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
Quoted 6 lines
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
OK, a brief review:
- Why couldn't you use ALSA's DMA API?
- The DMA must be stopped and started in the trigger callback, not the
prepare callback.
- If this device lacks a volume control alsa-lib can emulate it in
software, just create a proper /usr/share/alsa/cards/your_card.conf file.
- By ALSA convention the acceptable formats, sample rates, etc should
be directly defined in the snd_pcm_hardware_t structure.
- dev->oss needs to go.
Lee
At Mon, 07 Nov 2005 10:33:35 -0500,
Quoted 22 lines · Lee Revell
Quoted 13 lines · Mauro Carvalho Chehab
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.Quoted 6 lines
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
Quoted 3 lines
OK, a brief review:
- Why couldn't you use ALSA's DMA API?
This is OK, IMO. Basically, it's up to the driver.
Quoted 11 lines
- The DMA must be stopped and started in the trigger callback, not the
prepare callback.- If this device lacks a volume control alsa-lib can emulate it in
software, just create a proper/usr/share/alsa/cards/your_card.conffile.- By ALSA convention the acceptable formats, sample rates, etc should
be directly defined in thesnd_pcm_hardware_tstructure.-
dev->ossneeds to go.
Agreed about the rest.
Takashi
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Quoted 15 lines · Takashi Iwai
Quoted 4 lines
OK, a brief review:
- Why couldn't you use ALSA's DMA API?
This is OK, IMO. Basically, it's up to the driver.
Quoted 7 lines
- The DMA must be stopped and started in the trigger callback, not the
prepare callback.- If this device lacks a volume control alsa-lib can emulate it in
software, just create a proper/usr/share/alsa/cards/your_card.conffile.
Quoted 6 lines
Quoted 4 lines
- By ALSA convention the acceptable formats, sample rates, etc should
be directly defined in thesnd_pcm_hardware_tstructure.-
dev->ossneeds to go.Agreed about the rest.
Thanks, guys.
Despite all that, I am inclined to merge this patch into 2.6.15. Because it's in the middle of a 192-patch series and we do need to get the v4l tree synced up.
Mauro&co, if we do that, do you think the above points can be addressed inside the next four weeks or so?
Quoted 4 lines · Andrew Morton
Despite all that, I am inclined to merge this patch into 2.6.15. Because it's in the middle of a 192-patch series and we do need to get the v4l tree synced up.
I think starting the DMA in the prepare callbacks is a major problem. It should be easy to fix though.
Lee
Andrew,
Em Seg, 2005-11-07 às 11:48 -0800, Andrew Morton escreveu:
Quoted 23 lines
Quoted 15 lines · Takashi Iwai
Quoted 4 lines
OK, a brief review:
- Why couldn't you use ALSA's DMA API?
This is OK, IMO. Basically, it's up to the driver.
Quoted 7 lines
- The DMA must be stopped and started in the trigger callback, not the
prepare callback.- If this device lacks a volume control alsa-lib can emulate it in
software, just create a proper/usr/share/alsa/cards/your_card.conffile.Quoted 6 lines
Quoted 4 lines
- By ALSA convention the acceptable formats, sample rates, etc should
be directly defined in thesnd_pcm_hardware_tstructure.-
dev->ossneeds to go.Agreed about the rest.
Quoted 8 lines
Thanks, guys.
Despite all that, I am inclined to merge this patch into 2.6.15. Because it's in the middle of a 192-patch series and we do need to get the v4l tree synced up.
Mauro, if we do that, do you think the above points can be addressed inside the next four weeks or so?
We are, in fact already working on these. We are about to send you a
newer patch addressing most of the points that Takashi and Lee showed.
You may apply the patches. If they noticed some weird stuff at the
newer patchset, we will have enough time for fix it.
Quoted 7 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Cheers,
Mauro.
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
Quoted 4 lines
Lee
Cheers,
Mauro.
- Adds alsa support for saa7134 video tuner.
drivers/media/video/saa7134/Makefile | 3 media/video/saa7134/saa7134-alsa.c | 1061 +++++++++++++++++++++++++++++++++ 2 files changed, 1063 insertions(+), 1 deletion(-)
drivers/media/video/saa7134/Makefile +2 -1
@@ -3,7 +3,8 @@ saa7134-objs := saa7134-cards.o saa7134- saa7134-oss.o saa7134-ts.o saa7134-tvaudio.o \ saa7134-vbi.o saa7134-video.o saa7134-input.o -obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o saa6752hs.o +obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ + saa6752hs.o saa7134-alsa.o obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o EXTRA_CFLAGS += -I$(src)/..
media/video/saa7134/saa7134-alsa.c new file +1061 -0
1,061 lines not on this page · raw message
At Mon, 07 Nov 2005 04:42:13 -0200,
Quoted 14 lines · Mauro Carvalho Chehab
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
Quoted 6 lines
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
Thanks!
How about Kconfig? Do you select SND or it depends on SND?
The below are some nitpicks.
Quoted 1 line
+#include <
sound/rawmidi.h>
The driver doesn't support any rawmidi function, no?
media/video/saa7134/saa7134-alsa.c line 45
Quoted 3 lines
media/video/saa7134/saa7134-alsa.c new file +3
-0+unsigned int dsp_nr =0 ; +module_param (dsp_nr, int,0444 ); +MODULE_PARM_DESC (dsp_nr,"alsa device number" );
This is what index[] for.
media/video/saa7134/saa7134-alsa.c line 53
Quoted 7 lines
media/video/saa7134/saa7134-alsa.c new file +7
-0+/* +* Configuration macros +*/ + +/* defaults */ +#define MAX_BUFFER_SIZE (256*1024) +#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE
Better to fold lines :)
Quoted 1 line
+static
snd_card_t*snd_saa7134_cards[SNDRV_CARDS] =SNDRV_DEFAULT_PTR;
Simply don't set anything to initialize NULLs.
Quoted 2 lines
media/video/saa7134/saa7134-alsa.c new file +2
-0+void saa7134_irq_alsa_done (struct saa7134_dev *dev,unsigned long status) +{
(snip)
media/video/saa7134/saa7134-alsa.c line 192
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+if (dev->oss.read_count >= dev->oss.blksize * (dev->oss.blocks-2 )) { +dprintk ("irq: overrun [full=%d/%d] - Blocks in %d\n" ,dev->oss.read_count, + dev->oss.bufsize, dev->oss.blocks); +saa7134_dma_stop (dev);
This may bring the PCM state inconsistent.
In such a case, you can call snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN). But call it outside the spinlock. Otherwise you'll get deadlock.
Quoted 5 lines
media/video/saa7134/saa7134-alsa.c new file +5
-0+/* +* ALSA capture trigger +* +* - One of the ALSA capture callbacks. +*
media/video/saa7134/saa7134-alsa.c line 269
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+* Called whenever a capture is started or stopped. Must be defined, +* but there's nothing we want to do here +* +*/ + +static int snd_card_saa7134_capture_trigger (snd_pcm_substream_t * substream, +int cmd) +{ +return 0 ; +}
Hmm, dma_start and dma_stop should be called from trigger callbacks. Calling it from prepare is a wrong implementation.
Quoted 1 line
+static int
snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream)
(snip)
media/video/saa7134/saa7134-alsa.c line 479
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+/* start dma */ +spin_lock_irqsave (&dev->slock,flags); +saa7134_dma_start (dev); +spin_unlock_irqrestore (&dev->slock,flags);
You don't need irqsave in prepare callback, use spin_lock_irq(), instead. But, this part should be anyway in trigger callback...
Quoted 7 lines
media/video/saa7134/saa7134-alsa.c new file +7
-0+static snd_pcm_hardware_t snd_card_saa7134_capture = +{ + .info = (SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | +SNDRV_PCM_INFO_BLOCK_TRANSFER | +SNDRV_PCM_INFO_MMAP_VALID ), + .formats =USE_FORMATS , + .rates =USE_RATE ,
media/video/saa7134/saa7134-alsa.c line 540
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+ .rate_min = USE_RATE_MIN, + .rate_max = USE_RATE_MAX, + .channels_min = USE_CHANNELS_MIN, + .channels_max = USE_CHANNELS_MAX, + .buffer_bytes_max = MAX_BUFFER_SIZE, + .period_bytes_min = 64, + .period_bytes_max = MAX_BUFFER_SIZE, + .periods_min = USE_PERIODS_MIN, + .periods_max = USE_PERIODS_MAX, + .fifo_size = 0x08070503,
fifo_size doesn't play any role in the current version, so leave it empty.
media/video/saa7134/saa7134-alsa.c line 627
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+static int snd_card_saa7134_capture_close (snd_pcm_substream_t * substream) +{ +snd_card_saa7134_t *chip =snd_pcm_substream_chip (substream); +struct saa7134_dev *dev = chip->saadev; +unsigned long flags; + +/* stop dma */ +spin_lock_irqsave (&dev->slock,flags); +saa7134_dma_stop (dev); +spin_unlock_irqrestore (&dev->slock,flags);
No need for irqsave, too.
Quoted 1 line
+static int
snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
(snip)
media/video/saa7134/saa7134-alsa.c line 664
Quoted 1 line
media/video/saa7134/saa7134-alsa.c new file +1
-0+ saapcm =kcalloc (1 ,sizeof (*saapcm),GFP_KERNEL );
Use kzalloc().
media/video/saa7134/saa7134-alsa.c line 677
Quoted 13 lines
media/video/saa7134/saa7134-alsa.c new file +13
-0+if (saapcm ==NULL ) +return -ENOMEM ; + saapcm->saadev=saa7134->saadev; + +spin_lock_init (&saapcm->lock); + + saapcm->substream = substream; + runtime->private_data = saapcm; + runtime->private_free = snd_card_saa7134_runtime_free; + runtime->hw = snd_card_saa7134_capture; + +if ((err =snd_pcm_hw_constraint_integer (runtime,SNDRV_PCM_HW_PARAM_PERIODS )) <0 ) +return err;
You need an error path to release the resource here.
media/video/saa7134/saa7134-alsa.c line 743
Quoted 11 lines
media/video/saa7134/saa7134-alsa.c new file +11
-0+ +static int snd_saa7134_volume_get (snd_kcontrol_t * kcontrol,snd_ctl_elem_value_t * ucontrol) +{ +snd_card_saa7134_t *chip =snd_kcontrol_chip (kcontrol); +unsigned long flags; +int addr = kcontrol->private_value; + +spin_lock_irqsave (&chip->mixer_lock, flags); + ucontrol->value.integer.value[0 ] = chip->mixer_volume[addr][0 ]; + ucontrol->value.integer.value[1 ] = chip->mixer_volume[addr][1 ]; +spin_unlock_irqrestore (&chip->mixer_lock, flags);
No need for irqsave in control callbacks.
(Is this spinlock for what?)
media/video/saa7134/saa7134-alsa.c line 915
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+static int snd_saa7134_free (snd_card_saa7134_t *chip) +{ +return 0 ; +}
Don't you need release_irq?
Quoted 9 lines
media/video/saa7134/saa7134-alsa.c new file +8
-0+ +static int snd_saa7134_dev_free (snd_device_t *device) +{ +snd_card_saa7134_t *chip = device->device_data; +return snd_saa7134_free (chip); +} + +int alsa_card_saa7134_create (struct saa7134_dev *saadev,unsigned int devicenum)
(snip)
media/video/saa7134/saa7134-alsa.c line 953
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+if (devicenum) { + card =snd_card_new (devicenum, id[dev],THIS_MODULE ,0 ); + dsp_nr++; + }else { + card =snd_card_new (index[dev], id[dev],THIS_MODULE ,0 ); + }
It's weird. Any problem to use index[] only?
media/video/saa7134/saa7134-alsa.c line 981
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+ err =request_irq (chip->pci->irq, saa7134_alsa_irq, +SA_SHIRQ |SA_INTERRUPT , saadev->name, saadev); + +if (err <0 ) { +printk (KERN_ERR "%s: can't get IRQ %d for ALSA\n" , + saadev->name, saadev->pci->irq);
You need snd_card_free() and kfree(chip), here.
media/video/saa7134/saa7134-alsa.c line 986
Quoted 5 lines
media/video/saa7134/saa7134-alsa.c new file +5
-0+return err; + } + +if ((err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops)) <0 ) { +snd_saa7134_free (chip);
Here, too.
media/video/saa7134/saa7134-alsa.c line 996
Quoted 1 line
media/video/saa7134/saa7134-alsa.c new file +1
-0+spin_lock_init (&chip->mixer_lock);
You should initialize it beforehand (although it's harmless until register is called).
media/video/saa7134/saa7134-alsa.c line 1007
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+snd_card_set_dev (card, &chip->pci->dev); + +/* End of "creation" */ + +strcpy (card->shortname,"SAA7134" ); +sprintf (card->longname,"%s at 0x%lx irq %d" , + chip->saadev->name, chip->iobase, chip->irq); + +if ((err =snd_card_register (card)) ==0 ) { + snd_saa7134_cards[dev] = card;
Incremant dev here. Otherwise it'll be overridden.
media/video/saa7134/saa7134-alsa.c line 1013
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+return 0 ; + } + +__nodev: +snd_card_free (card); +kfree (card);
Don't kfree. The object is already released in snd_card_free.
Takashi
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
[It seems my previous post wasn't delivered by some reason.
If you already received this, please disregard.]
At Mon, 07 Nov 2005 04:42:13 -0200,
Quoted 14 lines · Mauro Carvalho Chehab
Lee,
Em Dom, 2005-11-06 às 13:33 -0500, Lee Revell escreveu:
Quoted 9 lines · Andrew Morton
Quoted 5 lines
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.Please send a fix against next -mm?
Also please send all ALSA related patches to
[email protected] for review.
Quoted 6 lines
I'm sending you enclosed saa7134-alsa patch. To make easier to
understand, I've merged all stuff. This is highly dependent of the other saa7134 parts, since PCI stuff are common to both video and audio funcion on this device.
This is meant to replace saa7134-oss (after more tests) that,
currently, is part of saa7134 module.
Thanks!
How about Kconfig? Do you select SND or it depends on SND?
The below are some nitpicks.
Quoted 1 line
+#include <
sound/rawmidi.h>
The driver doesn't support any rawmidi function, no?
media/video/saa7134/saa7134-alsa.c line 45
Quoted 3 lines
media/video/saa7134/saa7134-alsa.c new file +3
-0+unsigned int dsp_nr =0 ; +module_param (dsp_nr, int,0444 ); +MODULE_PARM_DESC (dsp_nr,"alsa device number" );
This is what index[] for.
media/video/saa7134/saa7134-alsa.c line 53
Quoted 7 lines
media/video/saa7134/saa7134-alsa.c new file +7
-0+/* +* Configuration macros +*/ + +/* defaults */ +#define MAX_BUFFER_SIZE (256*1024) +#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE
Better to fold lines :)
Quoted 1 line
+static
snd_card_t*snd_saa7134_cards[SNDRV_CARDS] =SNDRV_DEFAULT_PTR;
Simply don't set anything to initialize NULLs.
Quoted 2 lines
media/video/saa7134/saa7134-alsa.c new file +2
-0+void saa7134_irq_alsa_done (struct saa7134_dev *dev,unsigned long status) +{
(snip)
media/video/saa7134/saa7134-alsa.c line 192
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+if (dev->oss.read_count >= dev->oss.blksize * (dev->oss.blocks-2 )) { +dprintk ("irq: overrun [full=%d/%d] - Blocks in %d\n" ,dev->oss.read_count, + dev->oss.bufsize, dev->oss.blocks); +saa7134_dma_stop (dev);
This may bring the PCM state inconsistent.
In such a case, you can call snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN). But call it outside the spinlock. Otherwise you'll get deadlock.
Quoted 5 lines
media/video/saa7134/saa7134-alsa.c new file +5
-0+/* +* ALSA capture trigger +* +* - One of the ALSA capture callbacks. +*
media/video/saa7134/saa7134-alsa.c line 269
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+* Called whenever a capture is started or stopped. Must be defined, +* but there's nothing we want to do here +* +*/ + +static int snd_card_saa7134_capture_trigger (snd_pcm_substream_t * substream, +int cmd) +{ +return 0 ; +}
Hmm, dma_start and dma_stop should be called from trigger callbacks. Calling it from prepare is a wrong implementation.
Quoted 1 line
+static int
snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream)
(snip)
media/video/saa7134/saa7134-alsa.c line 479
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+/* start dma */ +spin_lock_irqsave (&dev->slock,flags); +saa7134_dma_start (dev); +spin_unlock_irqrestore (&dev->slock,flags);
You don't need irqsave in prepare callback, use spin_lock_irq(), instead. But, this part should be anyway in trigger callback...
Quoted 7 lines
media/video/saa7134/saa7134-alsa.c new file +7
-0+static snd_pcm_hardware_t snd_card_saa7134_capture = +{ + .info = (SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | +SNDRV_PCM_INFO_BLOCK_TRANSFER | +SNDRV_PCM_INFO_MMAP_VALID ), + .formats =USE_FORMATS , + .rates =USE_RATE ,
media/video/saa7134/saa7134-alsa.c line 540
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+ .rate_min = USE_RATE_MIN, + .rate_max = USE_RATE_MAX, + .channels_min = USE_CHANNELS_MIN, + .channels_max = USE_CHANNELS_MAX, + .buffer_bytes_max = MAX_BUFFER_SIZE, + .period_bytes_min = 64, + .period_bytes_max = MAX_BUFFER_SIZE, + .periods_min = USE_PERIODS_MIN, + .periods_max = USE_PERIODS_MAX, + .fifo_size = 0x08070503,
fifo_size doesn't play any role in the current version, so leave it empty.
media/video/saa7134/saa7134-alsa.c line 627
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+static int snd_card_saa7134_capture_close (snd_pcm_substream_t * substream) +{ +snd_card_saa7134_t *chip =snd_pcm_substream_chip (substream); +struct saa7134_dev *dev = chip->saadev; +unsigned long flags; + +/* stop dma */ +spin_lock_irqsave (&dev->slock,flags); +saa7134_dma_stop (dev); +spin_unlock_irqrestore (&dev->slock,flags);
No need for irqsave, too.
Quoted 1 line
+static int
snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
(snip)
media/video/saa7134/saa7134-alsa.c line 664
Quoted 1 line
media/video/saa7134/saa7134-alsa.c new file +1
-0+ saapcm =kcalloc (1 ,sizeof (*saapcm),GFP_KERNEL );
Use kzalloc().
media/video/saa7134/saa7134-alsa.c line 677
Quoted 13 lines
media/video/saa7134/saa7134-alsa.c new file +13
-0+if (saapcm ==NULL ) +return -ENOMEM ; + saapcm->saadev=saa7134->saadev; + +spin_lock_init (&saapcm->lock); + + saapcm->substream = substream; + runtime->private_data = saapcm; + runtime->private_free = snd_card_saa7134_runtime_free; + runtime->hw = snd_card_saa7134_capture; + +if ((err =snd_pcm_hw_constraint_integer (runtime,SNDRV_PCM_HW_PARAM_PERIODS )) <0 ) +return err;
You need an error path to release the resource here.
media/video/saa7134/saa7134-alsa.c line 743
Quoted 11 lines
media/video/saa7134/saa7134-alsa.c new file +11
-0+ +static int snd_saa7134_volume_get (snd_kcontrol_t * kcontrol,snd_ctl_elem_value_t * ucontrol) +{ +snd_card_saa7134_t *chip =snd_kcontrol_chip (kcontrol); +unsigned long flags; +int addr = kcontrol->private_value; + +spin_lock_irqsave (&chip->mixer_lock, flags); + ucontrol->value.integer.value[0 ] = chip->mixer_volume[addr][0 ]; + ucontrol->value.integer.value[1 ] = chip->mixer_volume[addr][1 ]; +spin_unlock_irqrestore (&chip->mixer_lock, flags);
No need for irqsave in control callbacks.
(Is this spinlock for what?)
media/video/saa7134/saa7134-alsa.c line 915
Quoted 4 lines
media/video/saa7134/saa7134-alsa.c new file +4
-0+static int snd_saa7134_free (snd_card_saa7134_t *chip) +{ +return 0 ; +}
Don't you need release_irq?
Quoted 9 lines
media/video/saa7134/saa7134-alsa.c new file +8
-0+ +static int snd_saa7134_dev_free (snd_device_t *device) +{ +snd_card_saa7134_t *chip = device->device_data; +return snd_saa7134_free (chip); +} + +int alsa_card_saa7134_create (struct saa7134_dev *saadev,unsigned int devicenum)
(snip)
media/video/saa7134/saa7134-alsa.c line 953
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+if (devicenum) { + card =snd_card_new (devicenum, id[dev],THIS_MODULE ,0 ); + dsp_nr++; + }else { + card =snd_card_new (index[dev], id[dev],THIS_MODULE ,0 ); + }
It's weird. Any problem to use index[] only?
media/video/saa7134/saa7134-alsa.c line 981
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+ err =request_irq (chip->pci->irq, saa7134_alsa_irq, +SA_SHIRQ |SA_INTERRUPT , saadev->name, saadev); + +if (err <0 ) { +printk (KERN_ERR "%s: can't get IRQ %d for ALSA\n" , + saadev->name, saadev->pci->irq);
You need snd_card_free() and kfree(chip), here.
media/video/saa7134/saa7134-alsa.c line 986
Quoted 5 lines
media/video/saa7134/saa7134-alsa.c new file +5
-0+return err; + } + +if ((err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops)) <0 ) { +snd_saa7134_free (chip);
Here, too.
media/video/saa7134/saa7134-alsa.c line 996
Quoted 1 line
media/video/saa7134/saa7134-alsa.c new file +1
-0+spin_lock_init (&chip->mixer_lock);
You should initialize it beforehand (although it's harmless until register is called).
media/video/saa7134/saa7134-alsa.c line 1007
Quoted 10 lines
media/video/saa7134/saa7134-alsa.c new file +10
-0+snd_card_set_dev (card, &chip->pci->dev); + +/* End of "creation" */ + +strcpy (card->shortname,"SAA7134" ); +sprintf (card->longname,"%s at 0x%lx irq %d" , + chip->saadev->name, chip->iobase, chip->irq); + +if ((err =snd_card_register (card)) ==0 ) { + snd_saa7134_cards[dev] = card;
Incremant dev here. Otherwise it'll be overridden.
media/video/saa7134/saa7134-alsa.c line 1013
Quoted 6 lines
media/video/saa7134/saa7134-alsa.c new file +6
-0+return 0 ; + } + +__nodev: +snd_card_free (card); +kfree (card);
Don't kfree. The object is already released in snd_card_free.
Takashi
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Em Dom, 2005-11-06 às 00:12 -0800, Andrew Morton escreveu:
Quoted 5 lines
[email protected] wrote:
Well that didn't work. The problem is that
drivers/media/video/saa7134/saa7134-alsa.cdoesn't appear to be wired up into the build system - it simply doesn't get compiled.
In fact, it was meant to be part of saa7134 module. We've changed it on the newer patchsets I've sent to you today. It shoud compile well now.
Quoted 1 line
Please send a fix against next -mm?
Only after sending I noticed you've released -mm1 (I'm suffering a long
delay on my current ISP - maybe some greylist policy). I'll apply the patches I sent you today against -mm and, if something wents wrong, I'll send you some correcting patches.
Cheers,
Mauro.