Re: [PATCH] em28xx: register device to soundcard for sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 19, 2009 at 5:41 PM, Nicola Soranzo <nsoranzo@xxxxxxxxxx> wrote:
> As explained in "Writing an ALSA driver" (T. Iwai),

when writing a patch write the truth about where it comes from, eg.
the author of the patch.

thanks,
Markus

> 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@xxxxxxxxxx>
> ---
> diff -r 80e785538796 -r ef8cc17cc048 linux/drivers/media/video/em28xx/em28xx-audio.c
> --- a/linux/drivers/media/video/em28xx/em28xx-audio.c   Wed Feb 18 18:27:33 2009 +0100
> +++ b/linux/drivers/media/video/em28xx/em28xx-audio.c   Thu Feb 19 17:36:44 2009 +0100
> @@ -560,6 +560,8 @@
>        pcm->info_flags = 0;
>        pcm->private_data = dev;
>        strcpy(pcm->name, "Empia 28xx Capture");
> +
> +       snd_card_set_dev(card, &dev->udev->dev);
>        strcpy(card->driver, "Empia Em28xx Audio");
>        strcpy(card->shortname, "Em28xx Audio");
>        strcpy(card->longname, "Empia Em28xx Audio");
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux