zondag 8 november 2015

Room Correction using drc-fir, ladspa_dsp & PulseAudio

This is a combination of notes I kept. Please let me know if you run into problems. I've only loaded mono filters (one measurement) into ladspa_dsp.

In the time honored tradition of UNIX of "do one thing well", getting room correction up and running under Ubuntu will use a lot of different utilities and commands. This text will hopefully guide you through some decisions.

Room Correction is modifying the sound sent to your speakers so that when you hear the audio, it more closely matches the way it was stored. It emulates a 'flat' frequency response, by dropping the amplitude of frequencies that are overrepresented, to match the ones that not as loudly reproduced. It will also measure the series of after-shakes your speaker and stuff in your room makes, and try to correct for that.

Measuring we will do with `drc`. And the LADSPA plugin of  `dsp` will be used to apply the correction. By plugging it into PulseAudio all modern Linux programs can automatically make use of it.

Measuring only needs repeating when you move your speakers, or do large restructuring of the room. Strictly speaking when you take a book of a shelf, your room changes. So the correction would need to change. But you're not really going the hear the difference. A normal room easily has 6dB changes when you walk around.

So, don't sweat it. Probably most of the audio you'll hear is made worse sounding equipment. E.g. news being recorded with a smartphone, indie bands recording and mixing in their basement on second hand equipment sort of thrown in the room ;)

If you want a more hands-off automated approach I suggest plunking down about $1000 for a MiniDSP DDRC with Dirac Live. I read it works very well, and requires Windows or OS X to set up. But that's for someone else to use. Dirac Live is also more advanced, since it uses all speakers and takes multiple measurement locations into account. While `drc` only does per channel (speaker) and for one listening position. There are also things like Trinnov & Four Audio HD2, which appears to be priced a point that if you have to ask for it you can't afford it :P

I am going to assume you:
  • have a fresh Ubuntu 14.04 install
  • want to use MythTV, Chrome, mplayer and VLC
  • want only stereo playback (and not say an ambisonics decode of 5.1 surround placement)
  • want room correction that also does impulse correction, over just equalization
  • have a UMIK-1 calibrated microphone - $75
The UMIK-1 appears to be a nice USB calibration microphone. Be sure to note that there is apparently some clock synchronization 'problem' with using two sound cards during calibration measurements (one for speakers & one for mic). But people appear to be happy with this microphone. Also, 'at the same time' (clock in sync) is physically impossible. You are going to have some delay, due to the speed of sound in a air and electricity in cables. But YMMV.

We are going to:
  • generate a sound sweep from 20 HZ to 20KHz, using `glsweep`.
  • play the sweep over your speakers
  • record the sweep using the UMIK-1
  • convolute the file we played with the recording, using `lsconv`
  • create a filter, using `drc`
  • try the filter using `drc` and some MP3 file
  • apply this filter in real-time, using ladspa_dsp in PulseAudio.
The runtime setup:

Speakers - Amp - TV - HDMI - ALSA - PulseAudio + ladspa_dsp - {MythTV, mplayer, VLC, Chrome}

We first need to install some software for later use:

$ sudo apt-get install unar drc build-essential git libasound2-dev ladspa-sdk libfftw3-dev libmad0-dev sox libsndfile-dev

Measuring

Ubuntu does not ship with the `measure` utility script. So we download the source code file.

$ wget http://sourceforge.net/projects/drc-fir/files/drc-fir/3.2.1/drc-3.2.1.tar.gz
$ unar drc-3.2.1.tar.gz
$ cd drc-3.2.1

Plug in your UMIK-1. Set it as default recording device and unmute it. Place it where you want the sound to be optimal. Make sure non-monotonic noises such as ticking clocks are turned off. Also, pets are probably best kept outside of the room you are measuring, if only for the distress of the sweep sounds.

My speakers (Jamo SL-90) specify they work from 35Hz to 20KHz. I'm going to sweep that range (35 - 20000). Going outside of the range of your speakers may fix some of their problems. But could easily send very loud signals through them in the attempt to correct deficiencies. Burning out the voice coils in the process ("blown out speakers"), iff your amp is high enough power. Also, it will need more dramatic shaping.

Bookshelf speakers (±30cm height) usually drop off below 75Hz, so use that as a start if you have one of those. Anyways, we can't really hear below 20Hz so no need to go much below that.

As the upper range, do not go above half your bitrate. As the encoding will not be able do represent anything above that range. See: 24bit/192-kHz Music Downloads ...and why they make no sense

To see the command line syntax of the `measure` script:

$ bash ./source/contrib/Measure/measure

The measure script will play a sound and record "two" channels from the UMIK-1. Only the left channel is populated by the microphone (TODO: is it?). The right channel will collect (mostly the same) noise of the microphone's USB sound card. The noise will be removed from the measurement, and the "impulse reponse" will be calculated by also subtracting the inverse of the sweep that was played.

Run the `measure` script. First do it as a test-run to assess sound pressure. For the actual measurement you will probably want to leave the room and run this remotely or on a timer (e.g. `sleep`).

Disconnect your left channel. We will measure your right channel.

$ bash ./source/contrib/Measure/measure 16 44100 35 20000 45 2 default front:CARD=Microphone,DEV=0 outdev impulse-right.pcm

Disconnect your right channel, and plug in the left again. We will measure your left channel.

$ bash ./source/contrib/Measure/measure 16 44100 35 20000 45 2 default front:CARD=Microphone,DEV=0 impulse-left.pcm

Copy the 44100 Hz ERB psychoacoustics config, which is best tuned for home theater. It places more importance on sounds you can hear better. It also deemphasized strong correction side-effects that you would be able notice, when you are not in the exact measurement location (e.g. your left vs. your right ear).

$ cp /usr/share/drc/config/44.1\ kHz/erb-44.1.drc .
$ cp /usr/share/drc/target/44.1 kHz/pa-44.1.txt .

You'll probably want to change all the "StartFreq = 20" entries to your own speaker start frequency, e.g. 35Hz.

$ sed -i 's/StartFreq = 20/StartFreq = 35/' erb-44.1.drc

Download the calibration file of your microphone from miniDSP.

Change the microphone calibration to your own UMIK-1 (YOUR_CALIBRATION.txt):

$ sed -i 's/MCPointsFile = wm-61a.txt/MCPointsFile = YOUR_CALIBRATION.txt/' erb-44.1.drc

Copy the prepared config file to a left and right config.

$ cp erb-44.1.drc erb-44.1-left.drc
$ cp erb-44.1.drc erb-44.1-right.drc

Now we mangle the config a bit further so it takes the correct input.

$ sed -i 's/BCInFile = rs.pcm/BCInFile = impulse-left.pcm/' erb-44.1-left.drc
$ sed -i 's/BCInFile = rs.pcm/BCInFile = impulse-right.pcm/' erb-44.1-right.drc

$ sed -i 's/TCOutFile = rtc.pcm/TCOutFile = rtc-left.pcm/' erb-44.1-left.drc
$ sed -i 's/TCOutFile = rtc.pcm/TCOutFile = rtc-left.pcm/' erb-44.1-right.drc

$ sed -i 's/PSOutFile = rps.pcm/PSOutFile = rps-left.pcm/' erb-44.1-left.drc
$ sed -i 's/PSOutFile = rps.pcm/PSOutFile = rps-right.pcm/' erb-44.1-right.drc

Run the calibration:

$ drc erb-44.1-left.drc
$ drc erb-44.1-right.drc

Next we want to use the rps-left.pcm and rps-right.pcm with `dsp`. For this we will first need to combine them into a single WAVE sound file.

sox -t f32 -r 44100 -c 1 rps-left.pcm -t f32 -r 44100 -c 1 rps-right.pcm --channels 2 --combine merge output-stereo.wav 

Tip: ladspa_dsp needs it's  fir filter as WAVE file that matched your audio. PulseAudio uses 44.1kHz by default.
Tip: The UMIK-1 can only record at 16 bit
Tip: drc does not understand WAVE files, if you used .wav anywhere, it's wrong.
Tip: You might want to reduce the amount of output taps to say PSOutWindow = 2048 which seems to be the largest amount of taps for 'zero' delay in dsp. Be sure to note that 44100/2048 ~ 21. So it probably has less influence on base sounds (1 correction at 21 Hz) and long distance reflections (15.8m roundtrip ~ 8 meter speaker to wall).
Tip: You can download your miniDSP UMIK-1 calibration file from their site.

Applying the correction

Download the source of dsp:

$ git clone https://github.com/bmc0/dsp.git
$ ./configure

Check that it says "[ladspa_dsp] enabled fir.o (fftw3)". You'll at least need libasound2-dev, ladspa-sdk, libfftw3-dev, libmad0-dev & libsndfile-dev. 

$ make -j4
$ sudo make install

`dsp` and ladspa_dsp are now installed. As a test, use the effect "gain -20.0" (rather quiet playback):

$ dsp -v some.mp3 gain -20.0

Quit by pressing [q]. Say you want this effect system wide; you put "effects_chain=gain -20.0" in ~/.config/ladspa_dsp/config. And then load the ladspa_dsp in PulseAudio.

You will probably want to end up with an effect chain that reads something like: "effects_chain=gain -6.0 fir /home/henk/drc-3.2.1/output-stereo.wav"

The filter needs a little (-6.0 dB) headroom to stop clipping with the default calibration files. If you play an MP3 file using `drc` it will tell you how much over budget it went.

Loading the convolver in PulseAudio 

Along the lines of: System Wide DSP Guide

$ pacmd list-sinks | grep -A1 \* | grep name
name: alsa_output.pci-0000_00_14.2.analog-stereo

This is the 'master' variable, that we will use below.

$ pacmd describe-module module-ladspa-sink 

The command to load ladspa_dsp into Pulseaudio.

$ pacmd load-module module-ladspa-sink sink_name=dsp master=alsa_output.pci-0000_00_14.2.analog-stereo plugin=ladspa_dsp label=ladspa_dsp channels=2

If your ~/.config/ladspa_dsp/config is incorrect `pacmd` will only say "Module load failed."

To debug, run `pulseaudio -k && pulseaudio -vvvv`. It might say something like "dsp: error: failed to initialize effect: ..." when the `pacmd load-module` command is run and your config is broken.

Next we tell PulseAudio to use the room correction filter for all programs that you start until you reboot:

$ pacmd set-default-sink dsp

You can also set the default for all running programs using PulseAudio Volume Control (`pavucontrol`) on the Playback tab.

Tip: You need the channels=2 part if you want the correction to actually be applied to both channels. Try to increase it to 6 if you use 5.1 surround. I don't know the required ordering of the speakers in your reverb effect wav file.

Loading DSP by default

If you want to make this setting to survive reboots, you'll have to set it in ~/.config/pulse/default.pa:

.include /etc/pulse/default.pa

load-module module-ladspa-sink sink_name=dsp master=alsa_output.pci-0000_00_14.2.analog-stereo plugin=ladspa_dsp label=ladspa_dsp channels=2

set-default-sink dsp

zaterdag 10 januari 2015

DVBSky T680C on Mythbuntu 14.04

How to make it work. Download the firmware and driver from: http://www.dvbsky.net/Support_linux.html

The build_dvbc_x64.sh script changes the driver so it only shows supports DVB-C. This makes it DVB-C work in MythTV.
Code:
mkdir dvbsky
cd dvbsky

wget http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz
sudo apt-get install unp && unp dvbsky-firmware.tar.gz
cd dvbsky-firmware
sudo ./copy-firmware.sh
cd ..

wget http://www.dvbsky.net/download/linux/media_build-bst-14-141106.tar.gz
unp media_build-bst-14-141106.tar.gz
cd media_build-bst-14
./build_dvbc_x64.sh
sudo make install 
sudo reboot
Had contact with 'stuartm' on #mythtv irc. He'll look at adding a C vs. T/T2 selector in MythTV 0.28
Some further info: http://ubuntuforums.org/showthread.php?t=2260221

dinsdag 30 december 2014

Broken Technotrend CT-3650

One of my TT CT-3650 is broken. The device still registers /dev/dvb/adapter0, but there's no ca0 (CAM), nor frontend0/frontend1 (DVB-C/T). Connecting to Windows also gives strange errors in the supplied tuner software. Took the board out of the casing, there's no real obvious damage.

I'm replacing them with DVBSky T680C. Technotrend's own replacement CT2-4650 needs kernel 3.18 to function, and I had trouble getting that up and running together with my Nvidia card. Apparently building an ubuntu kernel needs more than 6GB disk space of my system partition. I have not tried building v4l-dvb's media_build.git. Which might work, but I cannot test before ordering the hardware.

Informatie over digitale TV, na de fusie van Ziggo en UPC

Er is een overzicht van de veranderingen bij digitale TV van Ziggo.

Op de informatie pagina op de site van Ziggo zelf kan je je opgeven voor een SMS zodra de veranderingen zijn doorgevoerd.

Wat ik hier van al gemerkt heb is dat een maand of wat terug scannen met Netwerk ID '5555' beter ging dat met '8888'. En dat is nu weer terug gewisseld. Zal wel een test zijn geweest.

Voor mijzelf zou ik eens moeten kijken of m'n CI-niet-plus Sony TV het Netwerk ID 43192 voor regio Alkmaar toevallig beter begrijpt.

zondag 13 mei 2012

Linux 3.3.6

Aangezien m'n systeem nog steeds van tijd tot tijd bleef hangen bij het uitschakelen, nu maar geupdate naar Linux kernel 3.3.6 met deze handleiding: https://wiki.ubuntu.com/KernelTeam/GitKernelBuild

In menuconfig heb ik vooral gekeken of AMD64 wordt gebruikt,  en hier en daar wat 'low latency' zaken ingeschakeld die de interactiviteit kunnen bevorderen.

Na de reboot nvidia's driver geïnstalleerd (even alle 'failsafeX' instanties killen). Het backend gedeelte lijkt prima te werken. Frontend lijkt ook gewoon te draaien.

maandag 30 april 2012

USB bug in M2NPV-VM BIOS 1401

Sinds het in gebruik nemen van de TT CT3650 schakelt m'n backend computer niet altijd écht uit. Alles stopt wel, maar de computer blijft stroom krijgen. En start dan dus ook niet op tijd op, want staat niet uit.

Na wat zoeken kwam ik achter een bug in de BIOS in van m'n moederbord: http://marc.info/?l=linux-kernel&m=122131004618837&w=2

Gedowngrade naar 1201, en nu maar kijken of het weer optreed.

donderdag 26 april 2012

Wat je nodig hebt voor MythTV digitale TV bij Ziggo

Er mailde mij vandaag iemand met de vraag "Zou jij me kunnen vertellen wat ik het beste aan kan schaffen?"

Mijn reply:

Wat je nodig hebt is een grafische kaart die hardwarematig 1080p h.264 en MPEG2 kan weergeven. Om op de CPU video te decoderen heb je een vrij heftig systeem voor nodig, mijn AMD Athlon 64 X2 4000+ kan het nét niet aan op zichzelf. Dat hardwarematig video afspelen is voornamelijk met Nvidia's VDPAU PCI-Express kaarten: http://www.mythtv.org/wiki/VDPAU
 , ATI werkt eigenlijk niet, Intel GMA misschien. Maar er is ook CrystalHD: http://www.mythtv.org/wiki/Broadcom_Crystal_HD

Aan de opname kant: TV kaarten met DVB-C en een CI slot. In dat CI slot een 'Alphacrypt Classic' CAM, of de equivalente 'Panaccess MultiCrypt'. In de CAM dan een Ziggo smartcard. Het is theoretisch ook mogelijk om die Alphacrypt/MultiCrypt te vervangen door een Smargo kaartlezer en een 'softcam'. Die kan terzijnertijd (nu nog niet) vast ook een CI+ Irdeto2 systeem emuleren, dat kan de Alphacrypt niet. Maar de MythTV ontwikkelaars werken dat actief tegen, dus dat wordt dan een beetje houtje-touwtje oplossing waar je niet van af moet blijven want anders gaat het steeds stuk. Tot nu toe werkt m'n Alphacrypt, maar ik heb wel al een Smargo in huis. Ik heb liever dat ik gewoon kan updaten zonder al te veel hoofdbreken hoe ik het ook alweer oploste een half jaar terug.

Op zich heb je vrije keus in TV kaarten, moet wel werken met Linux. De enige USB DVB-C kaart met CI slot die geheel werkt onder Linux is de TT CT-3650. Ik heb die aangeschaft omdat ik ooit hoop m'n systeem fysiek wat kleiner te kunnen schalen. M'n externe frontends zijn al van die kleine Zotac kastjes. De CT-3650 werkt alleen met Linux kernel 3.2, of de meest recente LinuxTV media_build drivers: http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers

De 'Digital Devices Octopus' serie is ook interessant. Dat (mini) PCI-Express kaartje kan 8 apparaten aansturen, dus bijv 4 DVB-C/T tuners, en 4 CI sloten. Maar hoewel de woordvoerder van de fabrikant zegt dat alles werkt onder Linux, zijn er volgens mij alleen drivers voor hun satelliet (DVB-S/S2) ontvanger. Kán inmiddels veranderd zijn.

Daarnaast heeft mythtv-setup problemen met het vinden van alle kanalen. Ziggo heeft z'n eigen aangepaste DVB-C standaard verzonnen (vandaar "Ziggo Gecertificeerd" logos). Ik vul daarom de dtv_multiplex tabel in de database aan met de extra multiplexen die MythTV zelf niet gevonden heeft: http://gathering.tweakers.net/forum/list_messages/1340775/0
 . Daarna nogmaals laten zoeken, dan vind MythTV alle kanalen. Het heeft voorheen wel eens gewerkt, misschien werkt het al weer in MythTV 0.25.

donderdag 12 april 2012

TT CT-3650 en Smargo zijn binnen!

Score: coax pin in een van de CT-3650 breekt gewoon af, kwaliteitje.. Maar wel logisch dat 'ie dan geen goed DVB-T ontvangst had op m'n Windows PC daar ik 'm eerst op testte. Ook met w_scan en mythtv's scanner wilde het niet vlotten.

Nu de andere aangesloten en die w_scan'ed als een tierelier. Naja, wel een langzame. Want zo'n `w_scan -c NL -f c -a 0` duurt toch minstens een half uur.

MythTV slikt de gebrouwen channels.conf natuurlijk niet.

donderdag 29 maart 2012

QAM256 boodschappen lijstje

Door het eerder vermelde probleem met QAM256 kanalen ben ik genoodzaakt (een) andere tuner(s) aan te schaffen. Daarnaast is AlphaCrypt slecht verkrijgbaar. Hier mijn hersenspinsels over de aanpak.

Thuis hebben we drie frontends, en we willen ook nog wel eens meerdere opnamen maken. Dus "optimaal" zouden we iets van 5 tuners moeten hebben. Ik ga niet meteen in het wilde 5 tuners aanschaffen. Maar hier ga ik rekening mee houden met de kabel splitter.

Ziggo geeft je maximaal 3 smartcards op één abonnement, waarvan er 1 al in de TV zit. Dus praktisch gezien kan ik 1-op-1 smartcard-alphacrypt-tuner slechts 2 tuners aansluiten. Dus dan houd je twee smartcards = twee tuners over. Met hergebruik van transports (er zitten meerdere digitale kanalen in 1 transport) moet het dan vaker goed komen dat de andere 2 frontends TV kunnen kijken.

Nu is er ook nog een andere oplossing dan de AlphaCrypt CAM. Het uitlezen van de smartcard met een kaartlezer (Smargo), middels de kaartlezer driver OSCam, en Irdeto II decoderen met sasc-ng, en dat weer terugleiden naar plek waar MythTV de tuners zoekt (kernel patch ?). Helaas is dat allemaal met een zweem van illegaliteit omgeven, de documentatie dus ver te zoeken. Ik hoop dat ik daar iets aan kan veranderen door mijn configuratie te documenteren. Ook lijkt het er op dat MythTV actied het gebruik van softcams tegenwerkt. We gaan het beleven.

Er is nog een kleine kans dat m'n huidige tuner met een voorversterker beter werkt, dus dat ga ik ook zeker proberen. Qua nieuwe tuner heb ik de keus uit een PCI-express of USB2.0 tuner. De PCI-express tuners worden nog niet goed ondersteund onder Linux. Van de USB tuners zijn er twee die QAM256 goed ondersteunen. Makkelijk als je geen keus hebt.

Huidig boodschappenlijstje:
  • CAI versterker [CAI = Centrale Antenne-Inrichtingen]
  • CAI spliter 1 naar 5 (of meer)
  • 2x Technotrend TT-Connect CT-3650 CI (CI werkt met Linux kernel 3.2)
  • Smargo kaartlezer
Dan gaat de bestaande AlphaCrypt en smartcard in een van de CT-3650. Met de andere CT-3650 en de bestaande TT C1500 ga ik proberen de Smargo, OSCam, sasc-ng en mythtv aan elkaar te knopen. Samen 2 1/2 tuner, voor zolang als er nog QAM64 kanalen zijn. Maar mogelijk is mijn "nieuwe" C1500 met een patch ook te gebruiken voor QAM265.

Als dat werkt dan is later aan te schaffen:
  • Nog een AlphaCrypt voor de 3de smartcard in de al gekochte CT-3650, als de softcam niet goed werkt
  • Meer QAM256 DVB-C tuners: Technotrend CT-3650 -of- een Sundtek MediaTV {Pro, Digital Home}. Zie: VDR Wiki: Externe DVB-C Geräte

woensdag 28 maart 2012

"Nederland 3 werkt niet" (dwz. QAM256, Alphacrypt)

Thuis geklaag dat "Nederland 3 niet werkt" op MythTV (en ook BBC 1). Even LiveTV getest, en warempel het werkt niet. In mythtv-setup een kanalen scan gedaan met zoeken naar nieuwe transports en decodeerbaarheid. Als je dat allemaal door laat rammelen dan verwijdert 'ie mooi die zenders (en enkele andere) uit de zenderlijst.

Dus maar in de database gedoken. Het 'networkid' van alle transports maar weer eens op 8888 ingesteld, ipv 500. Na een nieuwe scan zet MythTV de meeste gewoon weer op 500.

Dan maar even gezocht naar updates van "die man die zo over Ziggo moppert, weet die niks?" (ArChie). En inderdaad, een maand terug al ging Ziggo in zijn gebied over op QAM256. Dat heeft hogere bandbreedte, en zou nog wel eens het probleem kunnen zijn.

Nu had ik toentertijd m'n Technotrend C1500 uitgezocht omdat die met alle QAM goed zou werken. Blijk ik een nieuwere hardware versie (met coax tulp-pluggen) te hebben die wél problemen heeft QAM256.

Even gezocht op vervangers van m'n tuner. Bijkomstig nadeel, de AlphaCrypt Classic wordt niet meer gemaakt en is dus slecht verkrijgbaar.

Binnenkort een update over wat ik wil gaan aanschaffen om dit op te lossen.

zondag 6 maart 2011

Sleeping your frontend, for backend power saving

My backend shuts itself down and wakes up on demand. But.. external frontends combined with lazy people, this means the backend remains powered on -doing nothing- every now and then. So I went out to see if I could put the frontends to sleep while also stopping mythfrontend, enabling the backend to start its shutdown sequence. I sleep the machines running the frontends because there may be running browser sessions etc.

How to set it up:

Gnome Power Manager -which is used by Ubuntu- waits until the screensaver says the desktop is idle and then does its own countdown. So the total time until sleep, is the time until the screensaver comes up plus the time you set in Gnome Power Manager. btw, LiveTV automatically disables the screensaver so we have the covered. We won't accidentally stop someone viewing television.

You will need to setup the screensaver and Gnome Power Manager yourself.

Then create a file as root:
$ sudo nano -w /etc/pm/sleep.d/00_quit-mythfrontend


#!/bin/sh
#
# Kill mythfrontend

case "$1" in
hibernate|suspend)
killall mythfrontend.real
killall mythfrontend
sleep 5s
esac

Set it executable:
$ sudo chmod +x /etc/pm/sleep.d/00_quit-mythfrontend


Your frontend will now be stopped before the machine goes to sleep.

Tip: don't name it 99_kill-mythfrontend, then the network will be down before the frontend has finished its exit ceremony.

zondag 27 februari 2011

Looking for another tuner for MythTV

I'm looking for a USB or PCIe DVB-C tuner with CI (CAM) slot. My second PCI slot is covered by the GPU heatsink.

Options I've found:
* NetUP Dual DVB-T/C-CI (PCIe) - This is a "professional" card, I've seen mentioned that it apparently costs over €900.
* Digital Devices DuoFlex C&T (PCIe) - Promising, but only their S2 device appears to be supported under Linux. CI slot only partially.
* Terratec H7 (USB2.0) - Not supported under Linux, or only without the CI slot.

Further question: Can the Alphacrypt Classic decrypt two Irdeto2 transports simultaneously, coming from a dual tuner?

I will probably edit this post a bit when other devices come up.

Installing the Zotac ND22

Spent most of my time installing Windows, first for a BIOS update. Later for an Android firmware update (Sony-Ericsson Xperia X8) that can only run from Windows. Anyways, XP does not support USB of the ND22 during the initial setup, you can possibly get around this by disabling 'Legacy USB support' in the BIOS. Didn't try that, hopped to Vista and that worked. Took about 2 days to install all patches though. Then it took more than 30 minutes for Sony Ericsson to install their USB cable driver, but that's another story..

Installing MythBuntu was a breeze. Setup date/time and account settings, the partitioning scheme and off it went. I didn't start with a MythBuntu backend, so the connection the backend didn't work out from the start. But after copying the appropriate mysql.txt line from another frontend it worked fine. Also updated to nvidia-current just in case, it's in ppa:ubuntu-x-swat/x-updates. Apparently they fixed some VDPAU decoding problems there, which is nice.

It now runs the Ubuntu Netbook desktop and it works pretty sweet. Also installed Flash 10.2 for YouTube support, and Dropbox to sync files to and from the old Mac Mini. Flash crashes a lot though, about every new video you click in firefox gives a crashed plugin..

Getting the Airport Extreme/Express combos to properly sync at a high speed was another story, and involved using my iPhone to look for the place with the strongest signal. I'm still not quite happy with the setup, but it appears to work now with 2 access points on the same SSID.

Well, that's it.

zaterdag 12 februari 2011

Bought some stuff

Spent some money on the previously mentioned projects.


  • Zotac ZBOX HDND22 - with Intel Celeron SU2300

  • Kingston ValueRAM SODIMM DDR3-1066 4GB

  • Airport Extreme - dual band 802.11n & 1gbit ethernet

  • 8 port TP-link 1gbit switch


Total: € 427,84

I've still got a SATA laptop harddrive and ethernet cables in store, so no need to get those. Be sure to note that the SU2300 ZBOX takes DDR3 SODIMM, while the Atom ZBOXs take DDR2.

Next project after installation will be an additional tuner for the MythTV backend.

donderdag 10 februari 2011

XBMC - on Apple TV 2

Was informed that a jailbroken Apple TV 2 can run XBMC with MythBox add on. So I tried it on my MacBook first, wasn't quite charmed, for example recording playback didn't work without mounting over NFS/SMB/AFS. It also lists only the most recent 10 recordings, Tried it my iPhone 4 next, and couldn't type on the tiny on screen keyboard drawn by XBMC/iOS.

Ah, well at least it was a neat idea.

Found one contender & other options

The Zotac ZBOX HD-ID11. It's cheap, small, has Nvidia ION2, basically a 9400M with improved VDPAU decoding (no unplayable video dimension gaps).

But I'm really not enamored with the Atom. On it's own the Atom barely enough to play h.264 at 360p. So you are basically counting on that Adobe gets and keeps its VDPAU support working in Flash, Youtube will not move WebM, and to a lesser extent that MythTV will not drop h.264 VDPAU support (they've already dropped some MPEG2 decoders).

Also, the ZBOX's are noisy. Measured about 50dBA closeby, when playing 1080p.

Another option would be to build a full blown >3GHz PC plus a low profile fanless Nvidia GPU with VDPAU 'featureset C', these come in at about €70. But since a PCI-E slot is perpendicular to the motherboard, and an ATX power supply is about as big as a Mac Mini all in itself, this will need a lot more space for the computer. And then it may not even be silent.

Choices, choices..

Edit: Discussed the options, and the slightly faster ZBOX with SU2300 is more appropriate than a lot bigger & more expensive PC.

donderdag 3 februari 2011

MythFrontend for (much) less than €550

Proposed to replace the elderly Mac Mini G4 1.25GHz which I tried to use a a frontend -but doesn't quite cope with that- with a new Nvidia based intel Mac Mini (Late/Early 2009 & Mid 2010), summa €550 second hand, €660 new. Was shot down as 'too expensive'.

So I'm now looking for a PC (Linux, maybe Windows) in about the same space as a Mac Mini, for (much) less than €550.

Specs:
* Hardware decoding: Nvidia VDPAU
* -or- Mini PCI Express for Crystal HD
* Ethernet (to Airport Express) -or- 802.11n
* Silent (less than ?? dBA)
* Small
* 512+ MB RAM
* Any harddrive

At the moment I have no idea where to get a CrystalHD in The Netherlands. Probably source it on eBay from elsewhere.

Edit: Found an Early 2009 Mac Mini for €425. Might be a possibility, still looking further.

vrijdag 17 september 2010

Cardsharing: Deel I - Het begin is er.. nog niet

Helaas is de term cardsharing wat ongelukkig. Ik deel de kaart met niemand behalve mezelf, en de gegevens gaan de machine niet af. Het delen van een TV abonnement met bijv. de buurt is strafbaar.

Laatst via eBay een OmniKey 1021 aangeschaft. Ik zal hier aangeven hoe ik deze aan de praat heb gekregen onder Ubuntu 10.04.

Op een commandoprompt voer in:
sudo apt-get install opensc pcscd libccid
sudo nano /etc/opensc/opensc.conf

Voeg dan de volgende regels in op de plekken waar ze genoemd worden. Je kan zoeken met ctrl+w.
reader_drivers = pcsc, ctapi;
try_emulation_first = yes;
lock_login = false;

Toets dan ctrl+o om op te slaan, en ctrl+x om nano af te sluiten.

Op de commandopromt dan weer:
opensc-tool --list-readers

Je ziet dan uitvoer zoals dit als alles klopt:
Readers known about:
Nr. Driver Name
0 pcsc OmniKey CardMan 1021 00 00


`pcscd` is nogal kletserig in de logs, doe het volgende om dat te stoppen:
sudo nano /etc/init.d/pcscd

Zoek daar naar het volgende:
# if you need to pass arguments to pcscd you should edit the file
# /etc/default/pcscd and add a line
# DAEMON_ARGS="--your-option"

En voeg daarna in:
DAEMON_ARGS="--error"

Dan weer ctrl+o, ctrl+x. En op de commando prompt:
sudo /etc/init.d/pcscd restart

`pcscd` zal dan alleen nog opstart foutmeldingen in de logs schrijven.

Ik krijg nu met `tail /var/log/messages` de volgende foutmelding te zien: "EHStatusHandlerThread() Error powering up card:". Klinkt niet goed. Ik laat wel weten wat er uit komt.

Edit: Kennelijk heb je voor een Ziggo smartcard een Smargo of een Smartmouse Phoenix kaart lezer nodig.

Einde oefening.

woensdag 8 september 2010

CI+ = CI min

Er werd mij in een commentaar gevraagd eens uit te leggen wat CI+ nu eigenlijk is. Als je het Duits machtig bent is deze video over HD+ interessant. HD+ is een techniek met dezelfde doelstellingen als CI+, en heeft volgens mij technisch zelfs veel overeenkomsten.

Met CI+ kan een zender aangeven hoe lang je een opname kan bewaren, welke apparaten en CI+ CAMs gebruikt mogen worden voor het ontvangen, en of je bijvoorbeeld verplicht een PIN code moet invoeren (zeg.. voor sex films), en SMS verificatie aanvragen via de telefoon. De in de HD+ video genoemde mogelijkheid om het vooruitspoelen tijdens reclames tegen te gaan heb ik niet kunnen vinden in de specificatie, maar misschien zie ik iets over het hoofd. Het is natuurlijk aan de ontvanger hardware om dit na te leven, maar enkele zaken kunnen ook afgedwongen worden door middel van verandering van de versleuteling.

Dan eerst het slechte nieuws: software recorders zoals MythTV of VDR gaan nooit écht CI+ ondersteunen. In zoverre dat ze niet door de technische keuring heen gaan komen (CI+ logo keuring). Verder lijkt er momenteel ook geen CI+ implementatie te zijn voor PCs, wat logisch is want een kaart in je systeem kan natuurlijk nooit garanderen dat een programma zich aan de CI+ regels houdt.

Het (voorlopig) goede nieuws is dat Ziggo zegt alleen op verzoek van de zenderaanbieder de CI+ digitale restricties in te gaan schakelen. Je kan bijvoorbeeld verwachten dat de 'foebel' kanalen in de toekomst niet meer via Irdeto2 maar enkel met Ziggo's CI+ CAM kunnen worden bekeken.

Zodra CI+ echt gebruikt gaat worden om het kijken tegen te gaan, zal iemand wel een 'minder legale' soft-cam oplossing maken die CI+ emuleert voor de smartcard. Maar dat kan dus wel betekenen dat we als MythTV gebruikers een tijdje (enkele) zenders niet kunnen bekijken en opnemen.

DVB-C scanner van MythTV 0.23 werkt met Ziggo!

Hoewel ik dit al best een tijd draaiend heb kan ik melden dat de kanalen scanner van MythTV 0.23 nu eindelijk ook goed werkt met de brakke kapotte NIT-tabellen van Ziggo. Wel moet je er voor zorgen dat enkel de DVB-C transports van je eigen Ziggo regio (bijv. Network ID 5555) in de database staan.

Verder was de update naar Mythbuntu 10.04 Lucid Lynx erg soepel.

Linkjes naar database inhoud:
dtv_multiplex inhoud
dtv_multiplex.sql