* [PATCH] em28xx: register device to soundcard for sysfs
@ 2009-02-19 16:41 Nicola Soranzo
2009-02-19 16:57 ` Markus Rechberger
2009-02-19 17:12 ` Douglas Schilling Landgraf
0 siblings, 2 replies; 5+ messages in thread
From: Nicola Soranzo @ 2009-02-19 16:41 UTC (permalink / raw)
To: Linux Media
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>
---
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");
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] em28xx: register device to soundcard for sysfs
2009-02-19 16:41 [PATCH] em28xx: register device to soundcard for sysfs Nicola Soranzo
@ 2009-02-19 16:57 ` Markus Rechberger
2009-02-19 17:15 ` Nicola Soranzo
2009-02-19 17:12 ` Douglas Schilling Landgraf
1 sibling, 1 reply; 5+ messages in thread
From: Markus Rechberger @ 2009-02-19 16:57 UTC (permalink / raw)
To: Nicola Soranzo; +Cc: Linux Media
On Thu, Feb 19, 2009 at 5:41 PM, Nicola Soranzo <nsoranzo@tiscali.it> 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@tiscali.it>
> ---
> 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] em28xx: register device to soundcard for sysfs
2009-02-19 16:57 ` Markus Rechberger
@ 2009-02-19 17:15 ` Nicola Soranzo
2009-02-19 17:20 ` Markus Rechberger
0 siblings, 1 reply; 5+ messages in thread
From: Nicola Soranzo @ 2009-02-19 17:15 UTC (permalink / raw)
To: Markus Rechberger; +Cc: Linux Media
Alle giovedì 19 febbraio 2009, Markus Rechberger ha scritto:
> On Thu, Feb 19, 2009 at 5:41 PM, Nicola Soranzo <nsoranzo@tiscali.it> 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.
I'm sorry Markus, but you're just the inspirer of the patch.
I wanted to use your code and so two weeks ago I asked you twice privately if
it was ok for you, and you didn't answer me.
Then I checked the documentation cited above, changed the one-line patch to be
more general and now it does not contain code from your tree anymore.
Anyway, thanks for the idea
Nicola
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] em28xx: register device to soundcard for sysfs
2009-02-19 17:15 ` Nicola Soranzo
@ 2009-02-19 17:20 ` Markus Rechberger
0 siblings, 0 replies; 5+ messages in thread
From: Markus Rechberger @ 2009-02-19 17:20 UTC (permalink / raw)
To: Nicola Soranzo; +Cc: Linux Media
On Thu, Feb 19, 2009 at 6:15 PM, Nicola Soranzo <nsoranzo@tiscali.it> wrote:
> Alle giovedì 19 febbraio 2009, Markus Rechberger ha scritto:
>> On Thu, Feb 19, 2009 at 5:41 PM, Nicola Soranzo <nsoranzo@tiscali.it> 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.
>
> I'm sorry Markus, but you're just the inspirer of the patch.
> I wanted to use your code and so two weeks ago I asked you twice privately if
> it was ok for you, and you didn't answer me.
> Then I checked the documentation cited above, changed the one-line patch to be
> more general and now it does not contain code from your tree anymore.
>
good to know :-) A short line stating out that the code was simply
diffed from the
other repository would have been enough.
> Anyway, thanks for the idea
you're welcome.
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] em28xx: register device to soundcard for sysfs
2009-02-19 16:41 [PATCH] em28xx: register device to soundcard for sysfs Nicola Soranzo
2009-02-19 16:57 ` Markus Rechberger
@ 2009-02-19 17:12 ` Douglas Schilling Landgraf
1 sibling, 0 replies; 5+ messages in thread
From: Douglas Schilling Landgraf @ 2009-02-19 17:12 UTC (permalink / raw)
To: Nicola Soranzo; +Cc: Linux Media
On Thu, 19 Feb 2009 17:41:56 +0100
Nicola Soranzo <nsoranzo@tiscali.it> wrote:
> 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>
> ---
> 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");
> --
Applied, thanks!
Cheers,
Douglas,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-19 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 16:41 [PATCH] em28xx: register device to soundcard for sysfs Nicola Soranzo
2009-02-19 16:57 ` Markus Rechberger
2009-02-19 17:15 ` Nicola Soranzo
2009-02-19 17:20 ` Markus Rechberger
2009-02-19 17:12 ` Douglas Schilling Landgraf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox