high-pitch sound while streaming from tuner-tv

*nix specific usage questions
viulian
New Cone
New Cone
Posts: 7
Joined: 30 Jan 2010 18:45

high-pitch sound while streaming from tuner-tv

Postby viulian » 26 Sep 2010 14:40

Hello,

I'm running Ubuntu 10.4 with VLC 1.1.4 compiled manually using:
./configure --enable-shine --disable-swscale --disable-postproc --disable-a52 --disable-glx --enable-x264 --enable-pulse --enable-alsa
I am reading the audio input directly from my tv tuner board:

Code: Select all

[0x8c4130c] [Media: vlc42] access_alsa demux debug: SAA7134 (SAA7134) [0x8c4130c] [Media: vlc42] access_alsa demux debug: hw:1,0 : SAA7134 PCM (SAA7134 PCM)
My streaming configuration is:

Code: Select all

new vlc42 broadcast enabled setup vlc42 input "v4l2://" setup vlc42 option :input-slave=alsa://hw:1,0 setup vlc42 option :v4l2-width=480 setup vlc42 option :v4l2-height=384 setup vlc42 option :v4l2-standard=255 setup vlc42 option :v4l2-audio-volume=12 setup vlc42 option :no-v4l2-audio-mute setup vlc42 option :v4l2-samplerate=32000 # discovery setup vlc42 option :v4l2-tuner-frequency=133250 setup vlc42 option :v4l2-tuner-frequency=196250 setup vlc42 option http-reconnect setup vlc42 output #transcode{venc=x264,vcodec=h264,vb=800,scale=1,acodec=mp3,ab=96,channels=1,samplerate=22050}:std{access=http,mux=ts,dst=0.0.0.0:1234} control vlc42 play
The outcome is that the sound is high pitch (sounds accelerated). My TV Tuner board is known to have a high-pitch issue ( http://www.linuxtv.org/wiki/index.php/Saa7134-alsa -> Sound distorted and high-pitched ) and the recommendation is to use the rate 32KHz.
The problem is that I was not able to control this rate. It seemed that VLC always chooses to use the 'araw' decoder with 48000Hz frequency. I tried the :v4l2-samplerate option, as well as the samplerate in the transcoder, nothing:

Code: Select all

[0x8400cdc] [Media: vlc42] main generic debug: looking for decoder module: 21 candidates [0x8400cdc] [Media: vlc42] araw generic debug: samplerate:48000Hz channels:2 bits/sample:16 [0x8400cdc] [Media: vlc42] main generic debug: using decoder module "araw"
Is there a way to control this value ?

My hard coded solution was to modify the file: modules/codec/araw.c and insert the 32000 line:

Code: Select all

... if( p_dec->fmt_in.audio.i_rate <= 0 ) { msg_Err( p_dec, "bad samplerate" ); return VLC_EGENERIC; } p_dec->fmt_in.audio.i_rate = 32000; /* Allocate the memory needed to store the decoder's structure */ if( ( p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) return VLC_ENOMEM; ...
Now sound is working, but ...

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: high-pitch sound while streaming from tuner-tv

Postby Jean-Baptiste Kempf » 28 Sep 2010 00:20

File a bug.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 12 guests