Outils pour utilisateurs

Outils du site


issue123:labolinux

Ceci est une ancienne révision du document !


Would it even be possible? That was what I wondered as I tried unsuccessfully to get : • a good quality player • with a screen so I could choose the songs • equipped with a graphic equalizer along with many more essential options… • and, of course, an infra-red remote control that would give me all the comfort of a real home player.

I then thought of using an EeePc which I would equip with an infrared remote control.

My EeePc is powered by Linux Mint 18-Xfce.

This latest version, in Gtk3, is very responsive; that being said, however, the computer is still a netbook with limited performance, except when it comes to playing my musical collection, in .mp3. There, it excels with no problems at all.

The indicator-cpufrq package allows you to reduce the noise of your fan:

sudo apt-get install indicator-cpufreq

You run it with “indicator-cpufreq” which will appear in the dashboard, and you click on it to go from Turbo to economical mode. The minimum is 800 MHz in energy-saving mode.

For my audio player, I chose Audacious that is easily installed with:

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt-get update

sudo apt-get install audacious

You can uninstall it and remove the PPA from your sources list with:

sudo apt-get remove audacious

sudo add-apt-repository –remove ppa:nilarimogard/webupd8

As we'll see later, Audacious will work with an infrared remote control, which is why I chose to use it. We now have to connect the EeePC to the amplifier of my stereo system.

The amplifier has a 3,5 mm jack socket on the front, and/or one or more RCA input sockets behind, so there are two possible cables that can be connected to the headphone output socket of the EeePC.

With that, you now have a new source of music connected to your stereo system.

Next, in order to have a real home music system, you've got to add an infrared remote control.

This equipment, which doesn't cost much and can easily be found on the Internet, has two parts : • a normal remote control, like that of a “Media Center” • and the associated infrared receiver to be plugged into a USB port.

To be sure that they are recognized by the EeePC, you must install the ir-keytable package, either with Synaptic or with the following command in a Terminal:

sudo apt-get install ir-keytable

Next, you plug the infrared receiver into a USB port and you ask your system questions:

sudo ir-keytable

will let you know:

1) the type of receiver plugged into the USB port and its protocol. Top right is what I learned with that command.

In other words, my receiver is “rc0” and the accepted and available protocols are “NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ other, with Enabled protocols: RC-6 LIRC”. So the receiver is well and truly recognized and ready to work.

Of course, everyone will get a different result, depending on the type of receiver that he or she uses.

2) Does the system recognize the remote control's orders?

sudo ir-keytable -t –sysdev rc0

Yes, (shown above) the remote control is recognized. (I pressed Ctrl and C together to stop the test.)

The command:

sudo ir-keytable -t –sysdev rc0

lists (in a terminal) the scancode that is associated with each key on the remote control, when pressed. Now you can list and copy/paste the scancodes into a personalized configuration file. Every key on the remote generates a scancode, but it's very probable that none generates a keycode (a keyboard shortcut). This problem can be solved by telling your system how the scancode (for example 0x1f32) is matched to a keycode (for example KEY_UP). In order to do so, you have to create your own file that tells you which scancode is generated by each of the keys on the remote.

3) Create your own configuration file, named “personal_ir”, containing all the scancodes shown in the terminal.

Here, for example (shown above), is mine. The list of commands depends on the number of keys you have pressed as per your own needs.

4) Move the “personal_ir” file into /lib/udev/rc_keymaps/ so it will be connected with the infrared receiver each time your system is booted, then type the following command :

sudo ir-keytable -c -w /lib/udev/rc_keymaps/ir_perso –sysdev rc0

Read telecommande table Old keytable cleared Wrote 12 keycode(s) to driver Protocols changed to RC-6

5) Edit the “rc.local” file, which is in /etc/, as shown top right.

Your system is now configured to recognize, and work with, the infrared remote control.

Reboot and try it out: note that you can increase (or lower) the volume of your computer with the remote control, thus proving that the two are well and truly connected.

6) Finally, you need to configure Audacious so that you can control it from the couch:

Open Audacious and go into the menu “Output”, then to “Audio Settings”, then “Plugins”. Click on “Universal Shortcuts,” then on “settings” below left. Choose an action, then click inside the box to the right called “key associations”.

(for example PLAY = XF86AudioPlay) and press the “Play” key on your remote.

Repeat for all the actions that you want to define, then click on the “Define” button below right to save them for good. Only those actions that have already been saved in the “rc.local” file will have any effect!

All you need to do now is lie back and take advantage of your new home music player!

issue123/labolinux.1501318209.txt.gz · Dernière modification : 2017/07/29 10:50 de d52fr