View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 10 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Aug 01, 2006 11:52 pm 
Offline
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
What follows are my experiences only. I do not claim to be an expert but in the hopes that someone else may not have to have the troubles I did I post the following;

I added a fourth tuner to my system. I had a PVR-150 and a PVR-500 (Dual-Tuner). My new tuner is an ATI TV-Wonder PCI. The ATI TV-Wonder PCI has been a challenge for me to get working.

The video and audio streams from the tuner are two separate PCI devices in the ATI TV-Wonder PCI (and most other bt878 cards) we will need to configure the devices separately for MythTV to access them. We shall discuss the video first and then the audio second.

VIDEO
The video configuration is fairly simple compared to the audio. The bttv driver is native and installed with the KnoppMyth kernel. The only thing we must do is setup the options file. We must do this due to the tuner parameters often are guessed wrong on boot. In my case the OS thinks I am running a PAL tuner when I have an NTSC.
All commands must be run as root!

From a bash shell prompt;
Code:
su
dmesg | grep bttv.*tuner

It responds;
bttv0: using tuner=19

Using http://www.tldp.org/HOWTO/BTTV/modprobe.html as a look-up table I see NTSC should be 2 not 19.

Determine your card number;
Code:
dmesg | grep bttv.*card

It responded;
bttv0: detected: ATI TV Wonder [card=63], PCI subsystem ID is 1002:0001
bttv0: using: ATI TV-Wonder [card=63,autodetected]


In my case it was 63… Write this down we will need it later. If you want to make sure it is correct you can check http://www.linuxtv.org/v4lwiki/index.php/Cardlist.BTTV and see. In my case it was. From what I have read the card detection usually works…. The tuner detection often is wrong.

We have to edit the bttv config file. I must have spent hours scouring the board where everyone said just modify the bttv file. If you looked you know what I mean… I finally came across a post by Xsecrets in the thread at http://mysettopbox.tv/phpBB2/viewtopic.php?t=8158 that made a big light bulb go on in my head. Thanks!!!

We must determine which bttv file to edit;
Code:
nano /etc/modprobe.d/KnoppMyth

Look for the line;
include /etc/mythtv/modules/bttv
include /etc/mythtv/modules/bttv0
include /etc/mythtv/modules/bttv1
include /etc/mythtv/modules/bttv2
include /etc/mythtv/modules/bttv3

Exit nano (<Ctrl – X>)

You should only have one of these files listed. In my case it was bttv1. If you edit any of the other files they will not process.

Now here we edit the config file;
Code:
nano /etc/mythtv/modules/bttv1

(Be sure to edit the correct file as discussed above)

Add the following;
options bttv card=63 tuner=2

You need to use the correct numbers for your card as we determined above. This is the correct line for an ATI TV-Wonder PCI with an NTSC tuner.
Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/mythtv/modules/bttv1)

Now we test it out.
Code:
rmmod bttv
modprobe bttv
tail /var/log/syslog

It should report;
Aug 2 00:35:52 mythtv kernel: tuner 0-0060: chip found @ 0xc0 (bt878 #0 [sw])
Aug 2 00:35:52 mythtv kernel: bttv0: using tuner=2
Aug 2 00:35:52 mythtv kernel: tuner 0-0060: type set to 2 (Philips NTSC (FI1236,FM1236 and compatibles))
Aug 2 00:35:52 mythtv kernel: bttv0: i2c: checking for MSP34xx @ 0x80... found
Aug 2 00:35:52 mythtv kernel: bttv0: i2c: checking for TDA9875 @ 0xb0... not found
Aug 2 00:35:52 mythtv kernel: bttv0: i2c: checking for TDA7432 @ 0x8a... not found
Aug 2 00:35:52 mythtv kernel: bttv0: i2c: checking for TDA9887 @ 0x86... not found
Aug 2 00:35:52 mythtv kernel: bttv0: registered device video0
Aug 2 00:35:52 mythtv kernel: bttv0: registered device vbi0
Aug 2 00:35:53 mythtv kernel: bttv0: PLL: 28636363 => 35468950 .. ok


Note: If you have had a lot of system log activity it may not show because it would be deeper in the log.

Just to be sure reboot and then,
Code:
dmesg | grep bttv

It should output something like;
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
bttv0: Bt878 (rev 2) at 0000:01:08.0, irq: 18, latency: 32, mmio: 0xe0000000
bttv0: detected: ATI TV Wonder [card=63], PCI subsystem ID is 1002:0001
bttv0: using: ATI TV-Wonder [card=63,insmod option]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
bttv0: using tuner=2
bttv0: i2c: checking for MSP34xx @ 0x80... found
bttv0: i2c: checking for TDA9875 @ 0xb0... not found
bttv0: i2c: checking for TDA7432 @ 0x8a... not found
bttv0: i2c: checking for TDA9887 @ 0x86... not found
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: PLL: 28636363 => 35468950 .. ok
bttv0: PLL can sleep, using XTAL (28636363).


It worked… Note the device video0 and vbi0. Your numbers may be different. Once you get the audio working you will need to setup the video for linux V4L sotware card in the backend setup. You will need these two numbers then.

AUDIO
These instructions should work with any bt787 based audio device with a MSP34xx chipset (http://www.linuxtv.org/v4lwiki/index.php/Btaudio). How do you know if you have this chipset?
From a bash shell prompt;
Code:
 dmesg | grep bttv.*MSP34

If you have the chipset you should see something like;
bttv0: i2c: checking for MSP34xx @ 0x80... found

There are two options for audio output on the ATI TV-Wonder PCI. You can use the bt878 ALSA driver or the btaudio OSS driver. In KnoppMyth R5C7 btaudio is no longer part of the default compiled kernel but the source code is provided. It may have been this way in previous KnoppMyth kernel revisions but this is my first run-in with it. The default KnoppMyth driver for the bt878 audio chipset is to use the bt878 ALSA driver (Driver is at: /lib/modules/2.6.15-chw-2/kernel/drivers/media/dvb/bt8xx/bt878.ko Source is at: /usr/src/kernel-source-2.6.15-chw-2/drivers/media/dvb/bt8xx/bt878.c in R5C7). This works great if you are using the line out on the tuner card to the line in on a sound card but for my MythTV usage btaudio is a better driver choice for two reasons, first btaudio’s ability to place data on the PCI bus using DMA creating a dsp device allows for one less digital to analogue and back to digital audio conversion (using an external cable), second I do not need an audio cable or sound card input available for each tuner card in my chassis. This may seem trivial for one card but when you have multiple tuners the sound cards add up quick.

So how do we disable bt878, compile btaudio, install bt878 and verify it all worked?

Just so people don’t think I am reinventing the wheel I have tried the following with no success;

In the MythTV wiki (as of 2006/08/01 - http://www.mythtv.org/wiki/index.php/Btaudio) it talk about using btaudio by initializing it on boot. There is an assumption that btaudio is part of the kernel. For MythTV this is no longer the case.

In the KnoppMyth wiki (as of 2006/08/01 - http://wiki.knoppmyth.net/index.php?page=BTTV+BTAudio) it talks about downloading the source and make file. For me I got as far as the make command when it dumped a verification error and would go no further…. I am not sure if the kernel version causes an issue or what the root cause is. It may be possible to play with the make file and get it to work but my level of expertise in caused me to look elsewhere. All commands should be run as root.

Step One: disable bt878
Using concepts from the KnoppMyth wiki post above;
From a bash shell prompt;
Code:
su root

Now type your root password.
Open the modules instantiation file
Code:
nano /etc/modules

Comment out the bt878 line. It should look like…
#bt878
Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/modules)
Now blacklist bt878 so hotplug will not load it
Code:
nano /etc/hotplug/blacklist

Scroll to the last line of the file and add
bt878
Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/hotplug/blacklist)

Step Two: Compile btaudio
The btaudio default location for the source and documentation are;
/usr/src/kernel-source-2.6.15-chw-2/sound/oss/btaudio.c
/usr/src/kernel-source-2.6.15-chw-2/Documentation/sound/oss/btaudio
From a bash shell prompt;
Code:
cd /usr/src/kernel-source-2.6.15-chw-2/
make menuconfig

A text based gui will pop up
Scroll down to “Device Drivers” <Enter>
Scroll down to “Sound” <Enter>
Scroll down to “Open Sound System” <Enter>
Scroll down to “Open Sound System (DEPRECATED)” <Space Bar>
Scroll down to “Obsolete OSS drivers (NEW)” <Space Bar>
Scroll down to “BT878 audio dma (NEW)” <Space Bar>
You should see it go
-from: < > BT878 audio dma (NEW)
-to: <M> BT878 audio dma
Press <Esc> four times.
It now asks “Do you wish to save your new kernel configuration?”
Select “Yes”


You should be back at a bash shell prompt.
Now we compile…
Code:
make modules

One of the last few lines you should see should be;
LD [M] sound/oss/btaudio.ko

Step Three: Install btaudio
There are two ways to do this….
The quick way is to use the make modules_install command. The downside is it will reload a lot of other thing but it will verify dependencies…. I prefer to make things easy as possible but I will provide directions for both methods…

As a sidenote btaudio does depend on soundcore.ko but for now it is already there in R5C7… should this change in the future it would need to be added.

If you want the easiest way (Preferred method for me)
Code:
make modules_install


If you are concerned with a make modules_install command
Code:
mkdir /lib/modules/2.6.15-chw-2/kernel/sound/oss
cp /usr/src/kernel-source-2.6.15-chw-2/sound/oss/btaudio.ko /lib/modules/2.6.15-chw-2/kernel/sound/oss/btaudio.ko
depmod -a

Now we have to add it to the list of modules to load at boot
Open the modules instantiation file
Code:
nano /etc/modules

Below where we commented out the bt878 line add btaudio. It should look like…
#bt878
btaudio

Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/modules)
I know some will say “But we could just have done this earlier”, but for the process and to understand the flow I structured it this way…

Now we have to load the “Options” for the driver. We could stick it in another file (Say the video configuration file) or we could make an audio specific one… I am going to describe how to make an audio specific one… you can see what is going on and modify to your liking.

Here we tell it to load the config file;
Code:
nano /etc/modprobe.d/KnoppMyth

Add to the last line;
include /etc/mythtv/modules/btaudio
Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/modprobe.d/KnoppMyth)

Now here we make the config file;
Code:
touch /etc/mythtv/modules/btaudio

Now here we edit the config file;
Code:
nano /etc/mythtv/modules/btaudio

You should see a blank file.
Add the following;
options btaudio dsp1=1 digital=1 analog=0 rate=32000
Exit nano (<Ctrl – X>, Yes to save changes and overwrite /etc/mythtv/modules/btaudio)
Note: dsp=X Where X is will determine the dsp device number assigned…. Modify if needed.

If you want to play around there are more parameters (as shown below) you can play with but the above options line works for me.
parm: latency:pci latency timer (int)
parm: rate:int
parm: analog:int
parm: digital:int
parm: irq_debug:int
parm: debug:int
parm: mixer:int
parm: dsp2:int
parm: dsp1:int

Step Four: Verify it all worked
Unload the bt878 module
Code:
rmmod bt878

Load the btaudio module
Code:
modprobe btaudio

Check the logs to make sure it all worked…
Code:
cat /var/log/syslog | grep btaudio

You should see something like….
Aug 2 05:03:17 mythtv kernel: btaudio: driver version 0.7 loaded [digital]
Aug 2 05:03:17 mythtv kernel: btaudio: Bt878 (rev 2) at 01:08.1, irq: 18, latency: 32, mmio: 0xe0001000
Aug 2 05:03:17 mythtv kernel: btaudio: using card config "default"
Aug 2 05:03:17 mythtv kernel: btaudio: registered device dsp1 [digital]


Reboot
Get back to a shell and run
Code:
dmesg | grep btaudio

You should see something like;
btaudio: driver version 0.7 loaded [digital]
btaudio: Bt878 (rev 2) at 01:08.1, irq: 18, latency: 32, mmio: 0xe0001000
btaudio: using card config "default"
btaudio: registered device dsp1 [digital]


Now you can configure the video for linux V4L Software setting for audio in the backend setup. Use the dsp device you set in the options file. In my case it is dsp1.

It is important to note that you should not have any output device attached to the tuner line-out but rather your soundcard line-out/speakers. The card will be initialized with the backend and audio will immediately start from the tuner line-out. If you are using your sound card you will never even know it is there.

-Steve


Last edited by sgunther on Thu Aug 10, 2006 10:09 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 02, 2006 9:58 am 
Offline
Joined: Mon Jul 31, 2006 10:41 pm
Posts: 149
A variation that I used to solve the channels off by one because of the ntsc/pal issue or "bttv0: using tuner=19" which now reads "bttv0: using tuner=2"

touch /etc/modprobe.d/bttv
then:
nano /etc/modprobe.d/bttv
inserted the line:
options bttv card=64 tuner=2
then: save and exit
then:update-modules
then:reboot machine

My card is a ati tv wonder ve


Top
 Profile  
 
PostPosted: Wed Aug 02, 2006 11:31 am 
Offline
Joined: Mon Jul 31, 2006 7:09 pm
Posts: 15
Location: Newfoundland Canada
Thanks sgunther,
after following your instructions I was able to edit my bttv parameters and bingo! my TV is working. I didn't have to alter the sound mudules, just had to plug in the jumper.

now I am watching day time TV - why did I bother. Well I hope I'll be able to what I want when I want now.

Thanks again for all the help.

_________________
Currently I am a help leach here, but I hope to eventually figure out what I am doing and help others with Mythtv problems.


Top
 Profile  
 
PostPosted: Wed Aug 02, 2006 9:44 pm 
Offline
Joined: Wed Jan 05, 2005 3:52 pm
Posts: 8
see my post

R5C7 and Avermedia 771 - no tv
http://mysettopbox.tv/phpBB2/viewtopic. ... 3c2b0e67a9

Probably something else I did or didn't do

bill


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 4:35 pm 
Offline
Joined: Sat Jul 29, 2006 5:32 am
Posts: 9
dude thanks for the simple explanation of btaudio and tutorial.
you seem to have played with that a bit.. so could you really please take a look at my case here:
http://mysettopbox.tv/phpBB2/viewtopic. ... 4612#64612
i have bt878 based pinnacle pctv card with no MSP34xx and the audio from the tuner audio jack is messed up. video is ok. somebody mentioned a pal/ntsc issue any chance that this could be a reason for broken audio?

again thanks for the effort and feedback


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 04, 2006 6:34 pm 
Offline
Joined: Tue Feb 14, 2006 12:07 am
Posts: 132
Location: White City OR
Thats a great tutorial on getting btaudio working. It seemed to get everything working for me except that when I disable bt878, and its dependancies my sound card quits working. So playing dvd's, or watching tv, or anything involving sound quits working also. Any hints as to keep my sound card working while using btaudio for my tv card as well?


Top
 Profile  
 
PostPosted: Thu Oct 19, 2006 1:46 am 
Offline
Joined: Wed Oct 18, 2006 1:45 am
Posts: 3
sgunther wrote:

AUDIO
.....
Step Two: Compile btaudio
The btaudio default location for the source and documentation are;
/usr/src/kernel-source-2.6.15-chw-2/sound/oss/btaudio.c
/usr/src/kernel-source-2.6.15-chw-2/Documentation/sound/oss/btaudio
From a bash shell prompt;
Code:
cd /usr/src/kernel-source-2.6.15-chw-2/
make menuconfig

A text based gui will pop up
Scroll down to “Device Drivers” <Enter>
Scroll down to “Sound” <Enter>
Scroll down to “Open Sound System” <Enter>
Scroll down to “Open Sound System (DEPRECATED)” <Space Bar>
Scroll down to “Obsolete OSS drivers (NEW)” <Space Bar>
Scroll down to “BT878 audio dma (NEW)” <Space Bar>
You should see it go
-from: < > BT878 audio dma (NEW)
-to: <M> BT878 audio dma
Press <Esc> four times.
It now asks “Do you wish to save your new kernel configuration?”
Select “Yes”


-Steve


Hey Steve.
Just a small question
In KnoppMyth R5D1 when i go to Open Sound System, there is no “Obsolete OSS drivers (NEW)”
Though there is “BT878 audio dma". Should i use this one?

Do you have any ideas if btaudio is possible to work on KnoppMyth R5D1?

I tried

Code:
 dmesg | grep bttv.*MSP34
and it returns .... found, so i think it should be possible

Also, if the video works fine, should i do the changes in the "video" section that you suggest?


Thanx
Panos


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 10:47 pm 
Offline
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
In R5D1 it is a little different.....
Code:
cd /usr/src/kernel-source-2.6.17-chw-8/
make menuconfig


Device Drivers <Space>
Sound <Space>
Open Sound System <Space>
Open Sound Systam (Deprecated) <Space>
BT878 Audio DMA <Space>
<Esc><Esc><Esc>
Save? <Yes>

Code:
make modules SUBDIRS=/sound/oss


This is a much better command as it is much more specific as to what to build... If you do just the make modules then in R5D1 it will re-compile a lot of other modules....

Then install it... Again a better way than I mentione before....

Code:
make modules_install SUBDIRS=sound/oss


That should cover the differences...

If the video is working fine I would not mess with it..... In my case the card was not being detected correctly and I had to force the settings...

Let me know how it goes....


Top
 Profile  
 
 Post subject: R5D1 tuner=19
PostPosted: Thu Oct 19, 2006 11:15 pm 
Offline
Joined: Sun Oct 15, 2006 11:37 am
Posts: 1
On a clean install of R5D1 nothing i found here or googling would change tuner=19. After much trial and error I discovered that the only file change that works "for me" is by changing /etc/modprobe.conf
after
"alias ra0 rt2400
alias rausb0 rt2570"
I added
options bttv tuner=2 #in order to get my ATV wonder VE to work.

If I added a WINTV card I had to change the line to
options bttv tuner=2,2 #to force both cards to the right tuner

Then update-modules and reboot.


Top
 Profile  
 
PostPosted: Fri Dec 11, 2009 3:18 pm 
Offline
Joined: Wed Jul 14, 2004 3:32 pm
Posts: 142
Hiya

I have been banging my head against the wall for ages on this, and this post may help me

I have been trying to use early hauppage wintv cards to plug a video in and capture all of my vhs tapes, the only problem was capturing the sound !!!

One of the cards has an audio input, but it never worked !!!

Will these instructions help me ???

_________________
Thanks in advance
Matt Shaw
matt@shagshaw.com

AMD Sempron 2400+ on Via Motherboard,
512MB Ram, 160GB IDE HDD,
Nvidia Geforce FX5500 128MB TV-Out,
2 x Twinhan DVB-T BT878 (Freeview UK)
KnoppMYTH R5F27


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu