Outils pour utilisateurs

Outils du site


issue123:labolinux

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.

Comment adapter un EeePC pour en faire un lecteur de salon, maillon d’une chaîne Hi-Fi ?

C’est la question que je me suis posée, devant mes difficultés à obtenir : - un lecteur de bonne qualité ; - muni d’un écran pour sélectionner les chansons ; - capable de créer une ou plusieurs listes de lectures ; - doté d’un égaliseur graphique et encore plein d’autres options incontournables … ; - et bien sûr, avec une télécommande infrarouge, afin d’avoir le confort d’un lecteur de salon !

Je vous propose d’utiliser un EeePC et d’y associer une télécommande infrarouge.

Mon EeePC fonctionne sous Linux Mint 18–Xfce.

Cette nouvelle mouture, en Gtk3, est très réactive ; malgré tout l'ordinateur reste un PC portable aux performances limitées, sauf en ce qui concerne la lecture de ma bibliothèque musicale, au format .mp3, où il remplit pleinement son rôle, sans difficultés.

Le paquet indicator-cpufreq permet de réduire le bruit de son ventirad : sudo apt-get install indicator-cpufreq Son lanceur est « indicator-cpufreq » qui sera visible sur le tableau de bord.

On clique dessus pour passer du mode turbo au mode économique, il souffle à minima à 800 Mhz, en mode économie d’énergie.

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.

J’ai choisi l’application Audacious comme lecteur audio, que l’on peut installer facilement :

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt-get update

sudo apt-get install audacious

Pour le désinstaller et supprimer le dépôt :

sudo apt-get remove audacious

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

Il faut maintenant relier l’EeePC à l’amplificateur audio de la chaîne Hi-Fi.

L’amplificateur possède soit une prise jack 3,5 mm en façade et/ou des entrées Chinch sur sa face arrière. On a donc le choix entre deux câbles possibles, à brancher sur la sortie casque de l’EeePC.

Nous verrons plus loin qu’Audacious fonctionnera avec une télécommande infrarouge, ce qui explique ce choix d’application !

Voilà, vous possédez désormais une nouvelle source musicale reliée à votre chaîne Hi-Fi.

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.

Il faut maintenant y adjoindre une télécommande infrarouge pour obtenir un véritable lecteur de salon.

Ce petit équipement, peu cher, qu’on trouve facilement sur Internet, comporte deux éléments : - une télécommande classique, du genre « Média-center », - et son récepteur infrarouge associé qu’on branchera sur un port USB.

Pour savoir s’ils sont bien reconnus par l'EeePC, il faut installer le paquet ir-keytable, soit avec Synaptic, soit dans un terminal :

sudo apt-get install ir-keytable

Ensuite on branche le récepteur infrarouge sur un port USB, et on interroge son système :

sudo ir-keytable

vous indiquera :

Le type de récepteur branché en USB et son protocole. En haut à droite vous trouverez ce que j'ai appris avec cette commande.

Donc mon récepteur est le « rc0 » aux protocoles « NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ other, avec les protocoles activés : RC-6 LIRC ». Le récepteur est donc reconnu et fonctionnel !

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.

Bien entendu chacun aura une réponse différente, en fonction du type de récepteur utilisé.

2) Les ordres de la télécommande sont-ils reconnus ?

sudo ir-keytable -t –sysdev rc0

Oui (voir ci-dessus), elle est reconnue. (J'ai appuyé sur Ctrl+C pour arrêter le test.)

La commande :

sudo ir-keytable -t –sysdev rc0

permet de visualiser dans le terminal, à chaque pression sur une touche de la télécommande, le scancode qui y est associé. Cela va permettre de lister les scancodes et de les copier/coller dans un fichier de configuration personnalisé. Chaque touche génère un scancode, mais il est très probable que toutes les touches ne génèrent pas un keycode (un raccourci clavier). Il faut donc y remédier en indiquant à son système l’association à faire entre le scancode (par ex. 0x1f32) et le keycode (par ex. KEY_UP). Pour ce faire, il faut créer son propre fichier permettant de connaître le scancode généré par chacune des touches de sa télécommande.

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.

3-Créez votre propre fichier de configuration, nommé « ir_perso », qui contiendra tous les scancodes affichés dans le terminal.

Pour exemple (ci-dessus), voici le mien. La liste des commandes dépendra du nombre de touches sur lesquelles vous aurez appuyé, selon vos besoins.

4) Déplacez le fichier « ir_perso » dans « /lib/udev/rc_keymaps/ » afin qu'il soit associé au récepteur infrarouge à chaque démarrage du système, puis tapez la commande suivante :

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

Read telecommande table (Lire la table de la télécommande). Old keytable cleared (vieille keytable est effacée). Wrote 12 keycode(s) to driver (12 raccourcis clavier sont écrits vers le pilote). Protocols changed to RC-6 (Protocoles changé pour RC-6).

5-Editer le fichier « rc.local » qui est dans /etc/ et le modifier comme montré en haut à droite.

Votre système est désormais paramétré pour reconnaître, et accepter de fonctionner avec, votre télécommande infrarouge.

Redémarrez et faites-en l'essai : vous pouvez augmenter (ou diminuer) le niveau sonore de votre ordinateur en utilisant votre télécommande, ce qui vous prouve que l’appariement est réussi.

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!

6) Enfin, il faut configurer Audacious pour pouvoir le commander depuis votre canapé :

Ouvrez Audacious et allez dans le Menu « Sortie », puis « Paramètres audio », puis « Greffons ». Cliquez sur « Raccourcis universels », puis sur « paramètres » en bas à gauche. Choisissez une action, puis cliquez dans le champ de droite « association de touches ».

par exemple LIRE = XF86AudioPlay et appuyez sur la touche « Play » de votre télécommande.

Répétez l'opération pour toutes les actions que vous voulez définir puis cliquez sur le bouton « Définir » en bas à droite, pour les enregistrer définitivement. Seules les actions déjà enregistrées dans le fichier « rc.local » auront un effet…

Et maintenant, il ne vous reste plus qu’à profiter confortablement de votre nouveau lecteur de salon, télécommande en main.

issue123/labolinux.txt · Dernière modification : 2017/08/03 14:23 de andre_domenech