LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-25-2009, 12:29 AM   #1
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Increase video buffer size in mplayer?


Hi, all. I'm attempting to use mplayer as a video output for my Dazzle DVC 100 USB video capture device. I'm using the following command:

Code:
mplayer tv:// -tv driver=v4l2:width=720:height=486:norm=NTSC-M:device=/dev/video0:audiorate=22050:immediatemode=0:forceaudio:adevice=/dev/dsp1
However, when it starts up, while I can get a display and sound, they're both really laggy. In the console I keep getting non-stop "video buffer full - dropping frame" messages. It seems to do fine when I disable audio, however.

I've tried everything I can think of: changing the sample rate of the sound output, trying to use SoX to play back the sound (can't seem to get that to work out at all), etc. I've also tried looking at the man pages of both mplayer and SoX to see if I can get either method to work (increase video buffer or use SoX for audio instead of mplayer), but to no avail. man pages are too overly verbose and confusing...

For the curious, here are my system specs:

CPU: IntelŪ PentiumŪ 4 @ 2.66 GHz
RAM: 1536MB (1.5GB)
GPU: NVIDIA GeForce 7300 GT AGP 8x 512MB VRAM
Audio: IntelŪ ICH5 AC'97 (integrated)
...those are probably the only relevant specs that I need to share.

And (hopefully) relevant dmesg output:

Code:
[638726.644045] usb 1-7: new high speed USB device using ehci_hcd and address 11
[638726.782342] usb 1-7: configuration #1 chosen from 1 choice
[638727.180195] Linux video capture interface: v2.00
[638727.203137] em28xx v4l2 driver version 0.1.0 loaded
[638727.231667] em28xx new video device (2304:021a): interface 0, class 255
[638727.231676] em28xx Has usb audio class
[638727.231678] em28xx #0: Alternate settings: 8
[638727.231681] em28xx #0: Alternate setting 0, max size= 0
[638727.231683] em28xx #0: Alternate setting 1, max size= 1024
[638727.231686] em28xx #0: Alternate setting 2, max size= 1448
[638727.231688] em28xx #0: Alternate setting 3, max size= 2048
[638727.231691] em28xx #0: Alternate setting 4, max size= 2304
[638727.231694] em28xx #0: Alternate setting 5, max size= 2580
[638727.231696] em28xx #0: Alternate setting 6, max size= 2892
[638727.231698] em28xx #0: Alternate setting 7, max size= 3072
[638727.234138] em28xx #0: em28xx chip ID = 18
[638727.496164] em28xx #0: i2c eeprom 00: 1a eb 67 95 04 23 1a 02 12 00 11 03 98 10 6a 2e
[638727.496177] em28xx #0: i2c eeprom 10: 00 00 06 57 4e 00 00 00 60 00 00 00 02 00 00 00
[638727.496186] em28xx #0: i2c eeprom 20: 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
[638727.496196] em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 10 01 00 00 00 00 00 00
[638727.496205] em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[638727.496214] em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[638727.496223] em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 2e 03 50 00 69 00
[638727.496232] em28xx #0: i2c eeprom 70: 6e 00 6e 00 61 00 63 00 6c 00 65 00 20 00 53 00
[638727.496242] em28xx #0: i2c eeprom 80: 79 00 73 00 74 00 65 00 6d 00 73 00 20 00 47 00
[638727.496251] em28xx #0: i2c eeprom 90: 6d 00 62 00 48 00 00 00 10 03 44 00 56 00 43 00
[638727.496261] em28xx #0: i2c eeprom a0: 31 00 30 00 30 00 00 00 32 00 30 00 33 00 35 00
[638727.496270] em28xx #0: i2c eeprom b0: 36 00 30 00 37 00 35 00 31 00 33 00 34 00 31 00
[638727.496279] em28xx #0: i2c eeprom c0: 30 00 32 00 30 00 30 00 30 00 31 00 00 00 32 00
[638727.496289] em28xx #0: i2c eeprom d0: 33 00 31 00 32 00 33 00 00 00 00 00 00 00 00 00
[638727.496298] em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[638727.496307] em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 af c4 f2 04 ad 62 5d 0e
[638727.496318] EEPROM ID= 0x9567eb1a, hash = 0x526d8884
[638727.496320] Vendor/Product ID= 2304:021a
[638727.496322] AC97 audio (5 sample rates)
[638727.496324] 300mA max power
[638727.496326] Table at 0x06, strings=0x1098, 0x2e6a, 0x0000
[638727.868481] saa7115' 3-0025: saa7113 found (1f7113d0e100000) @ 0x4a (em28xx #0)
[638729.152407] em28xx #0: V4L2 device registered as /dev/video0 and /dev/vbi0
[638729.152412] em28xx #0: Found Pinnacle Dazzle DVC 90/DVC 100
[638729.163344] usbcore: registered new interface driver snd-usb-audio
[638729.190612] usbcore: registered new interface driver em28xx
Is there anything I can do about this problem, or is my machine just too old/slow?

Last edited by MrCode; 10-25-2009 at 12:38 AM.
 
Old 10-25-2009, 05:22 AM   #2
warrob
LQ Newbie
 
Registered: Aug 2005
Posts: 16

Rep: Reputation: 0
Hi,

I think that the problem is the bad responsiveness of the usb connection. Have you tried to reduce the resolution? instead of 720x486 try 640x432 or 320x216 (check the resolutions supported by your camera).
 
Old 10-25-2009, 06:11 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Maybe try:

Code:
mplayer tv:// -tv driver=v4l2:buffersize=50:width=720:height=486:norm=NTSC-M:device=/dev/video0:audiorate=22050:immediatemode=0:forceaudio:adevice=/dev/dsp1
 
Old 10-25-2009, 12:41 PM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Thanks for the replies, but unfortunately neither solution really works well... reducing the resolution doesn't help, and as it turns out, increasing the buffer size, while it makes everything smooth, causes significant delay between input and AV out (I'm using this as a video interface for my Gamecube, as I don't have a TV in my room right now).

Maybe I could use SoX for the audio output and mplayer for the video output as mentioned above? I've tried:

Code:
sox -t alsa -r 48000 -c 2 /dev/dsp1 -t alsa /dev/dsp
But that gives the following:

Code:
ALSA lib pcm.c:2205:(snd_pcm_open_noupdate) Unknown PCM /dev/dsp1
sox formats: can't open input  `/dev/dsp1': cannot open audio device
And I'm pretty sure that the DVC100 audio device is located @ /dev/dsp1, as that's the parameter I give mplayer for audio output.

I'm not sure what else I can do, other than just play w/o sound...

Last edited by MrCode; 10-25-2009 at 12:43 PM.
 
Old 10-25-2009, 04:22 PM   #5
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Anyone? Is there anything I can do for audio that's separate from mplayer? I'll change the thread title if need be, so as to clarify on the new issue.
 
Old 10-26-2009, 05:10 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
So, can you post the two command you are currently trying to run, one for audio one for video.
 
Old 10-26-2009, 05:37 AM   #7
warrob
LQ Newbie
 
Registered: Aug 2005
Posts: 16

Rep: Reputation: 0
It seems to me that dsp1 is an output, not an input.
 
Old 10-26-2009, 01:42 PM   #8
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Here are the commands:

Video (this works):

Code:
mplayer tv:// -tv driver=v4l2:width=720:height=486:norm=NTSC-M:device=/dev/video0 -vf pp=lb
Audio (doesn't work):

Code:
sox -t alsa -r 48000 -c 2 /dev/dsp1 -t alsa /dev/dsp

ALSA lib pcm.c:2205:(snd_pcm_open_noupdate) Unknown PCM /dev/dsp1
sox formats: can't open input  `/dev/dsp1': cannot open audio device
What I'm trying to do with this is use the output from /dev/dsp1 (supposedly where the DVC audio device is located) and put it out using /dev/dsp (the speaker output, if I'm not mistaken). I really don't know a whole lot about the audio architecture of the system...I'm mostly just doing some guesswork here (probably not something you want to do). Is there any way to use SoX (or another audio program) to redirect audio output from /dev/dsp1 to the speakers? I apologize if I seem really n00bish.

Last edited by MrCode; 10-26-2009 at 01:46 PM.
 
Old 10-26-2009, 01:54 PM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Okay, maybe try using:

Code:
sox -r 48000 -c 2 /dev/dsp1 /dev/dsp
or try '-t raw' before or after.

Last edited by H_TeXMeX_H; 10-26-2009 at 01:57 PM.
 
Old 10-26-2009, 09:24 PM   #10
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Okay, I tried that, but then it gave me this error:

Code:
sox formats: bad input format for file `/dev/dsp1': data encoding was not specified
So then I tried it with "-e unsigned-integer" in front of both devices, but I still got the same error. I tried different encodings (signed-integer, floating-point), but still the same thing. I'm guessing this means I won't be able to use SoX for this, then...

Any other recommendations for audio? Perhaps I could just use a second instance of mplayer?

EDIT: Tried the following, freezes at "Starting playback..." message:

Code:
mplayer -rawaudio channels=2:rate=48000 -demuxer rawaudio /dev/dsp1

Last edited by MrCode; 10-26-2009 at 09:45 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
any way to increase CD-ROM buffer, increase spindown delay, XMMS buffer r00tb33r Linux - Hardware 5 06-12-2009 12:10 AM
How to increase the serial transmit buffer size in the Kernel. pwlodarczyk Programming 13 01-21-2009 04:39 PM
How to increase buffer size on the shell just_a_kid Solaris / OpenSolaris 3 06-22-2007 06:12 AM
Increase the command line buffer size Akiles Linux - General 3 04-19-2005 11:17 AM
how to increase serial receive email buffer size? HZC Programming 0 02-14-2005 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration