/[packages]/cauldron/mkchromecast/current/SOURCES/README.mageia
ViewVC logotype

Contents of /cauldron/mkchromecast/current/SOURCES/README.mageia

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1963106 - (show annotations) (download)
Mon Jun 26 07:19:41 2023 UTC (11 months ago) by rapsys
File size: 5690 byte(s)
Import mkchromecast version 0.3.8.1

1 Mkchromecast for Mageia
2 ----------------------
3
4 Using this program
5 ==================
6
7 In order to cast you have to install either mkchromecast-pulseaudio, or install
8 mkchromecast-alsa to pull the needed additional dependencies. ALSA users will
9 need to create a .asoundrc file, a Loopback virtual device, and build the
10 hw:X,Y devices. Pulseaudio users don't need any additional configuration.
11
12 The user interaction from console works as follows:
13
14 1. Execute mkchromecast as a local user.
15 2. After startup, the program will detect your google cast devices in your
16 LAN that you can select to cast.
17 3. A new sink called Mkchromecast is created that need to be selected in
18 pavucontrol to cast audio (for Pulseaudio users only).
19 4. If you stop Mkchromecast, the audio will be back sent to the default
20 playback device.
21
22
23 ALSA users
24 ==========
25
26 You need to install mkchromecast-alsa to pull the needed dependencies.
27
28 Mkchromecast can cast to google cast without the need of pulseaudio. One
29 advantage I have seen, is that delay is maximum 4 seconds. For that, you have
30 to use the ffmpeg or avconv backends together with the mkhcromecast's
31 `--alsa-device` flag. You also need to install mkchromecast-alsa to pull the
32 needed dependencies.
33
34 Example:
35
36 mkchromecast.py --encoder-backend ffmpeg --alsa-device hw:2,1
37
38
39 However, unlike Pulseaudio users, some previous configuration is mandatory. We
40 will try to figure out how to build the hw:X1,Y1 alsa device needed to complete
41 a .asoundrc configuration file, and the virtual alsa device hw:X2,Y2 needed by
42 the --alsa-device flag in Mkchromecast. It seems that always Y1 has to be
43 0 while Y2 is 1.
44
45 How to determine hw:X1,Y1
46 -------------------------
47
48 First, check what are the cards available in your system in /proc/asound/cards.
49 Below an example:
50
51 ```
52 % cat /proc/asound/cards
53 0 [PCH ]: HDA-Intel - HDA Intel PCH
54 HDA Intel PCH at 0xc1814000 irq 57
55 1 [HDMI ]: HDA-Intel - HDA Intel HDMI
56 HDA Intel HDMI at 0xc1810000 irq 61
57 ```
58
59 In the case above, the principal card is 0 [PCH]: HDA-Intel - HDA Intel PCH for
60 which the index X1 is 0. Normally, our needed alsa sound card (hw:X1,Y1) can be
61 built as hw:0,0. We will need it in the next step.
62
63 The ~/.asoundrc file
64 --------------------
65
66 Second, we need to create the ~/.asoundrc shown below. Note that this file may
67 not exist. You will need to change hw:X1,Y1 accordingly (in the case shown in
68 this document is hw:0,0):
69
70 ```
71 pcm.!default {
72 type asym
73 playback.pcm "LoopAndReal"
74 #capture.pcm "looprec"
75 capture.pcm "hw:X1,Y1"
76 }
77
78 pcm.looprec {
79 type hw
80 card "Loopback"
81 device 1
82 subdevice 0
83 }
84
85
86 pcm.LoopAndReal {
87 type plug
88 slave.pcm mdev
89 route_policy "duplicate"
90 }
91
92
93 pcm.mdev {
94 type multi
95 slaves.a.pcm pcm.MixReale
96 slaves.a.channels 2
97 slaves.b.pcm pcm.MixLoopback
98 slaves.b.channels 2
99 bindings.0.slave a
100 bindings.0.channel 0
101 bindings.1.slave a
102 bindings.1.channel 1
103 bindings.2.slave b
104 bindings.2.channel 0
105 bindings.3.slave b
106 bindings.3.channel 1
107 }
108
109 pcm.MixReale {
110 type dmix
111 ipc_key 1024
112 slave {
113 pcm "hw:X1,Y1"
114 rate 48000
115 #rate 44100
116 periods 128
117 period_time 0
118 period_size 1024 # must be power of 2
119 buffer_size 8192
120 }
121 }
122
123 pcm.MixLoopback {
124 type dmix
125 ipc_key 1025
126 slave {
127 pcm "hw:Loopback,0,0"
128 rate 48000
129 #rate 44100
130 periods 128
131 period_time 0
132 period_size 1024 # must be power of 2
133 buffer_size 8192
134 }
135 }
136
137 ```
138
139 Test that this is working. For that, open any audio file to see if it is
140 playing correctly.
141
142 How to determine hw:X2,Y2 and the Loopback device
143 -------------------------------------------------
144
145 We now need to load the snd-aloop module:
146
147 ```
148 sudo modprobe snd-aloop
149 ```
150
151 This will create a new virtual device called Loopback that we above referenced
152 as hw:X2,Y2 and we will pass it to the --alsa-device flag of Mkchromecast:
153
154
155 ```
156 % cat /proc/asound/cards
157
158 0 [PCH ]: HDA-Intel - HDA Intel PCH
159 HDA Intel PCH at 0xc1814000 irq 57
160 1 [HDMI ]: HDA-Intel - HDA Intel HDMI
161 HDA Intel HDMI at 0xc1810000 irq 61
162 2 [Loopback ]: Loopback - Loopback
163 Loopback 1
164 ```
165
166 As it can be seen, Loopback has an index X2 equals 2. This device is then
167 hw:2,1. This won't survive reboot. If you want to make this permanent, add
168 snd-aloop to /etc/modules.
169
170 Now we can execute Mkchromecast passing all desired parameters:
171
172 ```
173 mkchromecast.py --encoder-backend ffmpeg --alsa-device hw:2,1 -c aac --volume
174 ```
175
176 Happy Casting!
177
178
179 Supported encoders
180 ==================
181
182 +---------+------------------------------+------------+
183 | Encoder | Description | Identifier |
184 +---------+------------------------------+------------+
185 | lame | MPEG Audio Layer III | mp3 |
186 | oggenc | Ogg Vorbis | ogg |
187 | flac | Free Lossless Audio Codec | flac |
188 | sox | Waveform Audio File Format | wav |
189 | faac | Advanced Audio Coding | aac |
190 | opus | Opus Interactive Audio Codec | opus |
191 +---------+------------------------------+------------+
192
193 Note: faac is not added as dependency to the Mageia package, but you can
194 install it if you would like to use such encoder.
195
196 -- Muammar El Khatib <muammar@debian.org> Fri, 18 Sep 2016 15:47:56 +0200

  ViewVC Help
Powered by ViewVC 1.1.30