summaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx/em28xx-audio.c
AgeCommit message (Collapse)Author
2012-08-15[media] rename most media/video usb drivers to media/usbMauro Carvalho Chehab
Rename all USB drivers with their own directory under drivers/media/video into drivers/media/usb and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-10[media] em28xx: Remove useless runtime->private_data usageEzequiel García
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21[media] em28xx: Rename AC97 registers to use sound/ac97_codec.h definitionsEzequiel García
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-21[media] em28xx: Fix wrong AC97 mic register usageEzequiel García
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] v4l: fix compiler warningsHans Verkuil
media_build/v4l/au0828-video.c: In function 'au0828_irq_callback': media_build/v4l/au0828-video.c:123:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable] media_build/v4l/cx23888-ir.c: In function 'pulse_clocks_to_clock_divider': media_build/v4l/cx23888-ir.c:334:6: warning: variable 'rem' set but not used [-Wunused-but-set-variable] media_build/v4l/cx25840-ir.c: In function 'pulse_clocks_to_clock_divider': media_build/v4l/cx25840-ir.c:319:6: warning: variable 'rem' set but not used [-Wunused-but-set-variable] media_build/v4l/cx25840-ir.c: In function 'cx25840_ir_tx_write': media_build/v4l/cx25840-ir.c:863:21: warning: variable 'c' set but not used [-Wunused-but-set-variable] media_build/v4l/em28xx-audio.c: In function 'snd_em28xx_hw_capture_params': media_build/v4l/em28xx-audio.c:346:31: warning: variable 'format' set but not used [-Wunused-but-set-variable] media_build/v4l/em28xx-audio.c:346:25: warning: variable 'rate' set but not used [-Wunused-but-set-variable] media_build/v4l/em28xx-audio.c:346:15: warning: variable 'channels' set but not used [-Wunused-but-set-variable] media_build/v4l/hdpvr-control.c: In function 'get_input_lines_info': media_build/v4l/hdpvr-control.c:98:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] media_build/v4l/hdpvr-video.c: In function 'hdpvr_try_ctrl': media_build/v4l/hdpvr-video.c:955:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] media_build/v4l/saa7134-video.c: In function 'saa7134_s_tuner': media_build/v4l/saa7134-video.c:2030:6: warning: variable 'rx' set but not used [-Wunused-but-set-variable] media_build/v4l/sn9c102_core.c: In function 'sn9c102_stream_interrupt': media_build/v4l/sn9c102_core.c:998:7: warning: variable 'timeout' set but not used [-Wunused-but-set-variable] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06[media] em28xx: Reworked probe code to get rid of some hacksHolger Nelson
Reworked device probing to get rid of hacks to guess the maximum size of dvb iso transfer packets. The new code also selects the first alternate config which supports the largest possible iso transfers for dvb. [mchehab@redhat.com: Fix a few checkpatch.pl CodingStyle compliants] Signed-off-by: Holger Nelson <hnelson@hnelson.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx: Add support for devices with a separate audio interfaceMauro Carvalho Chehab
Some devices use a separate interface for the vendor audio class. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-audio: Some Alsa API fixesMauro Carvalho Chehab
Mark the alsa stream with SNDRV_PCM_INFO_BATCH, as the timing to get audio streams can vary. Also, add SNDRV_PCM_TRIGGER for pause/release. while here, fix the stop indicator, to be sure that audio will be properly released at the stop events. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-audio: Properly report failures to start streamMauro Carvalho Chehab
If the audio stream fails for any reason, it should: 1) Report an error via dmesg; 2) Mark internally that the stream didn't started. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-audio: add debug info for the volume controlMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-audio: volumes are invertedMauro Carvalho Chehab
While here, fix volume mask to 5 bits Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-audio: add support for mute controlsMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx-alsa: add mixer support for AC97 volume controlsMauro Carvalho Chehab
Export ac97 volume controls via mixer. Pulseaudio will probably handle it very badly, as it has no idea about how volumes are wired, and how are they associated with each TV input. Those wirings are card model dependent, and we don't have the wiring mappings for each supported device. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] em28xx: Don't initialize a var if won't be using itMauro Carvalho Chehab
Fixes most cases of initializing a var but not using it. There are still 3 cases at em28xx-alsa, were those vars should probably be used. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21[media] em28xx-audio: fix some locking issuesMauro Carvalho Chehab
Those locking issues affect tvtime, causing a kernel oops/panic, due to a race condition. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18V4L/DVB: em28xx: "Empia Em28xx Audio" too longDan Carpenter
card->driver is 15 characters and a NULL. The original code goes past the end of the array. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13289): em28xx-audio: Convert printks to em28xx_errFilipe Rosset
Convert printks to em28xx_err. Signed-off-by: Filipe Rosset <rosset.filipe@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-11-07V4L/DVB (13190): em28xx: fix panic that can occur when starting audio streamingDevin Heitmueller
Because the counters were not reset when starting up streaming, they would be reused from the previous run. This can result in cases such that when the second instance of streaming starts up, the "cnt" variable in em28xx_audio_isocirq() can end up being negative, resulting in attempting to write to memory before the start of runtime->dma_area (as well as having a negative number of bytes to copy). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> CC: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11896): em28xx: Fix for Slow Memory LeakRobert Krakora
Test Code: (Provided by Douglas) v4l-dvb/v4l2-apps/test/stress-buffer.c The audio DMA area was never being freed and would slowly leak over time as the v4l device was opened and closed by an application. Thanks again to Douglas for generating the test code to help locate memory leaks!!! Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10555): em28xx: CodingStyle fixesNicola Soranzo
Coding style fixes for recent changesets in em28xx. Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10525): em28xx: Coding style fixes and a typo correctionNicola Soranzo
Lots of coding style fixes and a typo correction for em28xx. [dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c] Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10523): em28xx-audio: Add macros EM28XX_START_AUDIO / EM28XX_STOP_AUDIODouglas Schilling Landgraf
Added macros EM28XX_START_AUDIO and EM28XX_STOP_AUDIO for em28xx_cmd(). Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10522): em28xx-audio: replace printk with em28xx_errdevAlexey Klimov
Patch removes printk and place em28xx_errdev macros to provide information about driver name to dmesg. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10521): em28xx-audio: Add lock for usersDouglas Schilling Landgraf
Added lock for users count Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10520): em28xx-audio: Add spinlock for triggerDouglas Schilling Landgraf
Added spinlock for trigger session Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10519): em28xx: Fix for em28xx audio startupRobert Krakora
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. Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10518): em28xx: Fix for em28xx memory leak and function renameRobert Krakora
Fix for em28xx memory leak and function rename Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10517): em28xx: remove bad check (changeset a31c595188af)Douglas Schilling Landgraf
Removed bad check. Thanks to Robert Krakora <rob.krakora@messagenetsystems.com> to report that. Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10327): em28xx: Add check before call em28xx_isoc_audio_deinit()Douglas Schilling Landgraf
Just call em28xx_isoc_audio_deinit() if em28xx sent a usb_submit(). Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10326): em28xx: Cleanup: fix bad whitespacingDouglas Schilling Landgraf
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-24Merge branch 'topic/snd_card_new-err' into for-linusTakashi Iwai
2009-02-26V4L/DVB (10659): em28xx: register device to soundcard for sysfsNicola Soranzo
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. Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and ↵Robert Krakora
Pre-emption Disabled 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!!! [dougsland@redhat.com: Fixed codyingstyle] Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10261): em28xx: fix kernel panic on audio shutdownDevin Heitmueller
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. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10254): em28xx: Fix audio URB transfer buffer race conditionRobert Krakora
em28xx: Fix audio URB transfer buffer memory leak and race condition/corruption of capture pointer Leak fix kindly contributed by Pádraig Brady. Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-12drivers/media: Convert to snd_card_create()Takashi Iwai
Convert from snd_card_new() to the new snd_card_create() function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-02V4L/DVB (10163): em28xx: allocate adev together with struct em28xx devMauro Carvalho Chehab
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. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9588): Don't load em28xx audio module for digital-only devicesDevin Heitmueller
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-12-29V4L/DVB (9581): Remove unused variable from em28xx-audio.cDevin Heitmueller
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-12-29V4L/DVB (9532): Properly handle error messages during alsa registeringMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01em28xx: remove backward compat macro added on a previous fixMauro Carvalho Chehab
commit 50f3beb50abe0cc0228363af804e50e710b3e5b0 fixed em28xx-alsa locking schema. However, a backport macro was kept. This patch removes the macro, since it is not needed for the module compilation against upstream. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01V4L/DVB (9743): em28xx: fix oops audioDouglas Schilling Landgraf
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= Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24V4L/DVB (9742): em28xx-alsa: implement another locking schemaMauro Carvalho Chehab
Instead of using a spinlock, it is better to call the proper pcm stream locking schema. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04V4L/DVB (9103): em28xx: HVR-900 B3C0 - fix audio clicking issueWiktor Grebla
Fixed audio clicking problem which could be heard when using analog tv or composite input Signed-off-by: Wiktor Grebla <greblus@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-29V4L/DVB (8884): em28xx-audio: fix memory leakDouglas Schilling Landgraf
Free allocated memory Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-06-26V4L/DVB (8026): Avoids an OOPS if dev struct can't be successfully recoveredMauro Carvalho Chehab
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-26V4L/DVB (8017): Ensure em28xx extensions only get run against devs that ↵Devin Heitmueller
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-24V4L/DVB (7522): media/video/em28xx replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18V4L/DVB (7164): em28xx-alsa: Add a missing mutexMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18V4L/DVB (7049): Remove sound/driver.hMauro Carvalho Chehab
sound/driver.h is already included by sound/core. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>