From: Andy Walls <awalls@md.metrocast.net>
To: AW <arne_woerner@yahoo.com>
Cc: linux-media@vger.kernel.org, dheitmueller@kernellabs.com
Subject: Re: PCTV USB2 PAL / adds loud hum to correct audio
Date: Sat, 12 Feb 2011 18:34:17 -0500 [thread overview]
Message-ID: <1297553657.2413.66.camel@localhost> (raw)
In-Reply-To: <450670.60996.qm@web30306.mail.mud.yahoo.com>
On Sat, 2011-02-12 at 13:44 -0800, AW wrote:
> Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
> > > When I use this command simultaneously:
> > > arecord -D front:CARD=PAL,DEV=0 -f S16_LE -c 2 -r 8000 /aux/tmp/bla.wav
> > > I get correct audio with strong noise:
> > > http://www.wgboome.de./bla.wav
> > > (it is from input=1 for copyright reasons... so there is silence plus
> noise)
> >
> > The "-r" argument should almost certainly be 48000, not 8000.
> >
> Maybe...
> That device is rather old...
> And i didnt tell pactl anything about sample rate...
I find audio at 8 ksps very unusual for a TV capture device.
> With the filter from the appendix the noise is gone...
> But it feels like a dirty hack, because it would cut out (overly?) loud noise,
> 2...
>
> My wild guess is, that the usbaudio driver injects some bad samples
> (0x8000..0x9000) every appr. 256 bytes...
I looked at the data. It is mostly hovering around 0, but you have
bursts of very negative values periodically:
(These values are shown as little endian, so swap the bytes to consider the value)
0000630: faff fdff f9ff fbff 1080 1080 1080 1080 ................
0000640: 1080 1080 faff fbff 1080 1080 8888 8888 ................
0000650: 1080 1080 fbff fcff fbff fcff fdff fdff ................
...
0002fe0: 0000 0000 0100 0100 ffff 0000 1080 1080 ................
0002ff0: 1080 1080 1080 1080 1080 1080 1080 1080 ................
0003000: 8888 8888 0100 0000 ffff ffff 0000 0000 ................
0x8010 is -32752 and 0x8888 is -30584.
The data set contains no large positive values (nothing in the range
0x1000-0x7fff).
The valuex 0x10 and 0x80 do remind me of the YUV values for black: Y =
0x10, U = 0x80, V = 0x80. Maybe some video data is getting thrown in
with the audio?
Regards,
Andy
> -Arne
>
> appendix:
> #include <stdint.h>
> #include <unistd.h>
>
> int main() {
> uint16_t buf[1000000];
> const int r = read(0,buf,sizeof(buf));
> for (int i=0; i*sizeof(*buf)<r; i++) {
> if (buf[i]/256>=0x80 && buf[i]/256<0x90) continue;
> if (write(1,buf+i,2) != 2) break;
> }
> return 0;
> }
>
next prev parent reply other threads:[~2011-02-12 23:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-12 20:22 PCTV USB2 PAL / adds loud hum to correct audio AW
2011-02-12 21:33 ` Devin Heitmueller
2011-02-12 21:44 ` AW
2011-02-12 23:34 ` Andy Walls [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-13 8:41 AW
2011-02-17 9:24 AW
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297553657.2413.66.camel@localhost \
--to=awalls@md.metrocast.net \
--cc=arne_woerner@yahoo.com \
--cc=dheitmueller@kernellabs.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox