Kernel Newbies Archive on lore.kernel.org
 help / color / Atom feed
* grab raw data from microphone and send it to the output
@ 2021-02-07 12:33 Ivan Riabtsov
  2021-02-07 12:50 ` Greg KH
  2021-02-07 12:55 ` Pouya Abbassi
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Riabtsov @ 2021-02-07 12:33 UTC (permalink / raw)
  To: kernelnewbies

Hello. There is a task to receive raw data from the microphone and,
after some processing, send it to the output (headphones or speakers)
to speed up the process, I want to do this at the kernel space, please
tell me where to start (which way to look and what to read)? My sound
device: "Family 17h (Models 10h-1fh) HD Audio Controller".
Thanks Everyone

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grab raw data from microphone and send it to the output
  2021-02-07 12:33 grab raw data from microphone and send it to the output Ivan Riabtsov
@ 2021-02-07 12:50 ` Greg KH
  2021-02-07 13:38   ` Ivan Riabtsov
  2021-02-07 12:55 ` Pouya Abbassi
  1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2021-02-07 12:50 UTC (permalink / raw)
  To: Ivan Riabtsov; +Cc: kernelnewbies

On Sun, Feb 07, 2021 at 03:33:34PM +0300, Ivan Riabtsov wrote:
> Hello. There is a task to receive raw data from the microphone and,
> after some processing, send it to the output (headphones or speakers)
> to speed up the process, I want to do this at the kernel space, please
> tell me where to start (which way to look and what to read)? My sound
> device: "Family 17h (Models 10h-1fh) HD Audio Controller".

Who is asking you to do such a "task"?

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grab raw data from microphone and send it to the output
  2021-02-07 12:33 grab raw data from microphone and send it to the output Ivan Riabtsov
  2021-02-07 12:50 ` Greg KH
@ 2021-02-07 12:55 ` Pouya Abbassi
  1 sibling, 0 replies; 6+ messages in thread
From: Pouya Abbassi @ 2021-02-07 12:55 UTC (permalink / raw)
  To: Ivan Riabtsov; +Cc: kernelnewbies

Hi Ivan.

Please consider looking at this question and the comments below it:
https://stackoverflow.com/questions/16360378/kernel-module-vs-user-space-application-which-one-is-faster

If you need a big speed difference, running your code in kernel-space 
won't make a huge difference. In either way, you'll get the same CPU cycles.

The only thing that I can think of, is using FPGA to do the job.
Kernel-space won't do any magic for you.
FPGA development is hard and totally different, but it's all magic!

- Best regards
Pouya

On 2/7/21 16:03, Ivan Riabtsov wrote:
> Hello. There is a task to receive raw data from the microphone and,
> after some processing, send it to the output (headphones or speakers)
> to speed up the process, I want to do this at the kernel space, please
> tell me where to start (which way to look and what to read)? My sound
> device: "Family 17h (Models 10h-1fh) HD Audio Controller".
> Thanks Everyone
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> 

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grab raw data from microphone and send it to the output
  2021-02-07 12:50 ` Greg KH
@ 2021-02-07 13:38   ` Ivan Riabtsov
  2021-02-07 13:45     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Ivan Riabtsov @ 2021-02-07 13:38 UTC (permalink / raw)
  To: Greg KH, kernelnewbies

I want to experiment with active noise cancellation, i want to receive
a wave from an input device (microphone), invert the wave and send it
to the output device (headphone or speaker). Therefore, I need a
minimum delay.

вс, 7 февр. 2021 г. в 15:50, Greg KH <greg@kroah.com>:
>
> On Sun, Feb 07, 2021 at 03:33:34PM +0300, Ivan Riabtsov wrote:
> > Hello. There is a task to receive raw data from the microphone and,
> > after some processing, send it to the output (headphones or speakers)
> > to speed up the process, I want to do this at the kernel space, please
> > tell me where to start (which way to look and what to read)? My sound
> > device: "Family 17h (Models 10h-1fh) HD Audio Controller".
>
> Who is asking you to do such a "task"?

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grab raw data from microphone and send it to the output
  2021-02-07 13:38   ` Ivan Riabtsov
@ 2021-02-07 13:45     ` Greg KH
  2021-02-07 15:51       ` Ivan Riabtsov
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2021-02-07 13:45 UTC (permalink / raw)
  To: Ivan Riabtsov; +Cc: kernelnewbies

On Sun, Feb 07, 2021 at 04:38:08PM +0300, Ivan Riabtsov wrote:
> I want to experiment with active noise cancellation, i want to receive
> a wave from an input device (microphone), invert the wave and send it
> to the output device (headphone or speaker). Therefore, I need a
> minimum delay.

Then I strongly suggest you look into a much smaller kernel, on a
dedicated tiny microcontroller, as that's what systems that do this
today use.

But if you just want to try it with your laptop, good luck, latencies in
your hardware itself are probably going to prevent this from being
possible.

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: grab raw data from microphone and send it to the output
  2021-02-07 13:45     ` Greg KH
@ 2021-02-07 15:51       ` Ivan Riabtsov
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Riabtsov @ 2021-02-07 15:51 UTC (permalink / raw)
  To: Greg KH, kernelnewbies

well, I have a portable microphone and the main source of noise a TV,
which is a few meters behind my back, if i put a microphone (for
example) in the middle, between a laptop and a TV, it may be possible
to compensate for the delay, I repeat, this is all solely for the sake
of experiment.

вс, 7 февр. 2021 г. в 16:45, Greg KH <greg@kroah.com>:
>
> On Sun, Feb 07, 2021 at 04:38:08PM +0300, Ivan Riabtsov wrote:
> > I want to experiment with active noise cancellation, i want to receive
> > a wave from an input device (microphone), invert the wave and send it
> > to the output device (headphone or speaker). Therefore, I need a
> > minimum delay.
>
> Then I strongly suggest you look into a much smaller kernel, on a
> dedicated tiny microcontroller, as that's what systems that do this
> today use.
>
> But if you just want to try it with your laptop, good luck, latencies in
> your hardware itself are probably going to prevent this from being
> possible.
>
> greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-07 12:33 grab raw data from microphone and send it to the output Ivan Riabtsov
2021-02-07 12:50 ` Greg KH
2021-02-07 13:38   ` Ivan Riabtsov
2021-02-07 13:45     ` Greg KH
2021-02-07 15:51       ` Ivan Riabtsov
2021-02-07 12:55 ` Pouya Abbassi

Kernel Newbies Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git