summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-audio.c
AgeCommit message (Collapse)Author
2009-04-14backport commit 758021bfa9ea25c58e62d2f68512628b19502ce7Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Takashi Iwai <tiwai@suse.de> Date: Mon Jan 12 15:17:09 2009 +0100 drivers/media: Convert to snd_card_create() Convert from snd_card_new() to the new snd_card_create() function. While here, backport also cx231xx-audio upstream changes for using snd_card_create(). kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-19em28xx: register device to soundcard for sysfsMauro Carvalho Chehab
From: Nicola Soranzo <nsoranzo@tiscali.it> As explained in "Writing an ALSA driver" (T. Iwai), audio drivers should set the struct device for the card before registering the card instance. This will add the correct /sys/class/sound/cardN/device symlink, so HAL can see the device and ConsoleKit sets its ACL permissions for the logged-in user. For em28xx audio capture cards found e.g. in Hauppauge WinTV-HVR-900 (R2), this patch fixes errors like: ALSA lib pcm_hw.c:1429:(_snd_pcm_hw_open) Invalid value for card Error opening audio: Permission denied when running mplayer as a normal user. Priority: normal Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-12em28xx: CodingStyle fixesDouglas Schilling Landgraf
From: Nicola Soranzo <nsoranzo@tiscali.it> Coding style fixes for recent changesets in em28xx. Priority: normal Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-11em28xx: Coding style fixes and a typo correctionDouglas Schilling Landgraf
From: Nicola Soranzo <nsoranzo@tiscali.it> Lots of coding style fixes and a typo correction for em28xx. Priority: normal Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> [dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c] Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx-audio: Add macros EM28XX_START_AUDIO / EM28XX_STOP_AUDIODouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Added macros EM28XX_START_AUDIO and EM28XX_STOP_AUDIO for em28xx_cmd(). Priority: normal Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx-audio: replace printk with em28xx_errdevDouglas Schilling Landgraf
From: Alexey Klimov <klimov.linux@gmail.com> Patch removes printk and place em28xx_errdev macros to provide information about driver name to dmesg. Priority: normal Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx-audio: Add lock for usersDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Added lock for users count Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx-audio: Add spinlock for triggerDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Added spinlock for trigger session Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx: Fix for em28xx audio startupDouglas Schilling Landgraf
From: Robert Krakora <rob.krakora@messagenetsystems.com> Essentially if a snd_em28xx_capture_trigger() stop followed by a snd_em28xx_capture_trigger() start would not yield any data because there was some logic put in with an adev->shutdown variable which did not seem warranted in my humble opinion. It would cause snd_em28xx_capture_trigger start never to start up the audio stream until the device was closed and reopened again. Upon re-opening the device adev->shutdown is reset and audio data would again flow. Priority: high Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx: Fix for em28xx memory leak and function renameDouglas Schilling Landgraf
From: Robert Krakora <rob.krakora@messagenetsystems.com> Fix for em28xx memory leak and function rename Priority: high Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-02-08em28xx: remove bad check (changeset a31c595188af)Douglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Removed bad check. Thanks to Robert Krakora <rob.krakora@messagenetsystems.com> to report that. Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-01-25em28xx: Add check before call em28xx_isoc_audio_deinit()Douglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Just call em28xx_isoc_audio_deinit() if em28xx sent a usb_submit(). Priority: normal Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-01-25em28xx: fix spacesDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@redhat.com> Fixed spaces Priority: normal Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-01-25em28xx: Fix for fail to submit URB with IRQs and Pre-emption DisabledDouglas Schilling Landgraf
From: Robert Krakora <rob.krakora@messagenetsystems.com> Trace: (Provided by Douglas) BUG: sleeping function called from invalid context at drivers/usb/core/urb.c:558 in_atomic():0, irqs_disabled():1 Pid: 4918, comm: sox Not tainted 2.6.27.5 #1 [<c04246d8>] __might_sleep+0xc6/0xcb [<c058c8b0>] usb_kill_urb+0x1a/0xd8 [<c0488e68>] ? __kmalloc+0x9b/0xfc [<c0488e85>] ? __kmalloc+0xb8/0xfc [<c058cd5a>] ? usb_alloc_urb+0xf/0x31 [<f8dd638c>] em28xx_isoc_audio_deinit+0x2f/0x6c [em28xx_alsa] [<f8dd6573>] em28xx_cmd+0x1aa/0x1c5 [em28xx_alsa] [<f8dd65e1>] snd_em28xx_capture_trigger+0x53/0x68 [em28xx_alsa] [<f8aa8674>] snd_pcm_do_start+0x1c/0x23 [snd_pcm] [<f8aa85d7>] snd_pcm_action_single+0x25/0x4b [snd_pcm] [<f8aa9833>] snd_pcm_action+0x6a/0x76 [snd_pcm] [<f8aa98f5>] snd_pcm_start+0x14/0x16 [snd_pcm] [<f8aae10e>] snd_pcm_lib_read1+0x66/0x273 [snd_pcm] [<f8aac5a3>] ? snd_pcm_kernel_ioctl+0x46/0x5f [snd_pcm] [<f8aae4a7>] snd_pcm_lib_read+0xbf/0xcd [snd_pcm] [<f8aad774>] ? snd_pcm_lib_read_transfer+0x0/0xaf [snd_pcm] [<f89feeb6>] snd_pcm_oss_read3+0x99/0xdc [snd_pcm_oss] [<f89fef9c>] snd_pcm_oss_read2+0xa3/0xbf [snd_pcm_oss] [<c064169d>] ? _cond_resched+0x8/0x32 [<f89ff0be>] snd_pcm_oss_read+0x106/0x150 [snd_pcm_oss] [<f89fefb8>] ? snd_pcm_oss_read+0x0/0x150 [snd_pcm_oss] [<c048c6e2>] vfs_read+0x81/0xdc [<c048c7d6>] sys_read+0x3b/0x60 [<c04039bf>] sysenter_do_call+0x12/0x34 ======================= The culprit in the trace is snd_pcm_action() which invokes a spin lock which disables pre-emption which disables an IRQ which causes the __might_sleep() function to fail the irqs_disabled() test. Since pre-emption is enabled then it is safe to de-allocate the memory if you first unlink each URB. In this instance you are safe since pre-emption is disabled. If pre-emption and irqs are not disabled then call usb_kill_urb(), else call usb_unlink_urb(). Thanks to Douglas for tracking down this bug originally!!! Priority: high Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> [dougsland@redhat.com: Fixed codyingstyle] Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2009-01-18merge: http://linuxtv.org/hg/~dheitmueller/v4l-dvb-em28xx-audio-panic/Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-17em28xx: fix kernel panic on audio shutdownDevin Heitmueller
From: Devin Heitmueller <dheitmueller@linuxtv.org> Revert a change made in change 9743 which resulted in a kernel panic in some cases on shutdown of the audio stream. First discovered when working on the Pinnacle 880e support, and later reproduced by a user on the mailing list with the HVR-900 as well. Priority: high Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
2009-01-16em28xx: Fix audio URB transfer buffer race conditionMauro Carvalho Chehab
From: Robert Krakora <rob.krakora@messagenetsystems.com> em28xx: Fix audio URB transfer buffer memory leak and race condition/corruption of capture pointer Leak fix kindly contributed by Pádraig Brady. Priority: normal Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-31em28xx: allocate adev together with struct em28xx devMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Some devices require different setups on struct_audio. Due to that, we may need to change some fields at dev.adev during device probe. So, this patch moves the dynamic memory allocation of adev at em28xx-alsa to the dynamic allocation of struct em28xx dev that happens during device probe. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24em28xx: fix oops audioDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@linuxtv.org> Replaced usb_kill_usb for usb_unlink_usb (wait until urb to fully stop require USB core to put the calling process to sleep). Oops: http://www.kerneloops.org/raw.php?rawid=71799&msgid= Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
2008-11-24em28xx-alsa: implement another locking schemaMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Instead of using a spinlock, it is better to call the proper pcm stream locking schema. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-12Don't load em28xx audio module for digital-only devicesMauro Carvalho Chehab
From: Devin Heitmueller <devin.heitmueller@gmail.com> Don't load em28xx audio module for digital-only devices Rework the logic so that the em28xx-alsa module does not get loaded for devices that don't support analog audio (such as the em2874) Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-12Remove unused variable from em28xx-audio.cMauro Carvalho Chehab
From: Devin Heitmueller <devin.heitmueller@gmail.com> Remove unused variable from em28xx-audio.c Fix warning for unused "ret" variable Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-07Properly handle error messages during alsa registeringMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-28em28xx: HVR-900 B3C0 - fix audio clicking issueDouglas Schilling Landgraf
From: Wiktor Grebla <greblus@gmail.com> Fixed audio clicking problem which could be heard when using analog tv or composite input Priority: high Signed-off-by: Wiktor Grebla <greblus@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
2008-09-04em28xx-audio: fix memory leakMauro Carvalho Chehab
From: Douglas Schilling Landgraf <dougsland@linuxtv.org> Free allocated memory Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-06-14Avoids an OOPS if dev struct can't be successfully recoveredMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> On some alsa versions, it seems that snd_pcm_substream_chip(substream) is returning a NULL pointer. This causes an OOPS, as reported by: https://bugs.launchpad.net/ubuntu/+source/linux-ubuntu-modules-2.6.24/+bug/212271 https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/212960 This patch avoids the OOPS by not letting and open() succeed. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-10From: Devin Heitmueller <devin.heitmueller@gmail.com>Mauro Carvalho Chehab
Ensure em28xx extensions only get run against devs that support them em28xx-audio.c em28xx-dvb.c - Em28xx extensions should ensure they are being only loaded against devices that support them. Deals with case where there are multiple em28xx devices, some of which have DVB (or ALSA) support and some do not. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-08media/video/em28xx replace remaining __FUNCTION__ occurrencesMichael Krufky
From: Harvey Harrison <harvey.harrison@gmail.com> __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2008-02-06em28xx-alsa: Add a missing mutexMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-18include sound/driver.h should be before sound/core.hMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Add compat.h at the proper place Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-18Remove sound/driver.hMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> sound/driver.h is already included by sound/core. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Add code for autoloading em28xx-alsa, if neededMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Older em28xx devices does implement standard Audio Class. However, on newer devices, this were replaced by a Vendor Class. This patch autodetects that an em28xx lacks Audio Class and auto-loads em28xx-alsa, for the devices that implements only a Vendor Class. For devices with Audio Class, snd-usb-audio module will provide an ALSA interface. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Integrates em28xx-audio.c into em28xx kernel moduleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Also fixes the remaining CodingStyle issues that Lindent didn't fix. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Lindent em28xx-audio.cMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Adds em28xx-audio moduleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> em28xx-audio module exports em28xx Vendor Class audio as an -alsa driver. This module were written based on usbaudio driver by Markus Rechberger. Recently, he acked to allow us to merge it on kernel: http://lists-archives.org/video4linux/20408-supporting-prolink-pixelview-405-dvd-maker.html Thanks to Markus Rechberger <mrechberger@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>