Author: Giachi

[SOLVED] audio i2s with OpenElec

[Copy link]

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-2 15:59:46 | Show all floors
this is a screenshot from ssh connection: before I used comand dmesg (the last 3 rows are about my comands modprobe)

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-2 16:17:27 | Show all floors
jernej replied at 2016-6-2 02:49
hm... are you sure that your fex changes are taken into account? After every fex change, you have to ...

"loaded modules can be checked with "lsmod" and correct script.bin settings with for example "read_fex pcm0 daudio_used""

I mounted microSD on my pc, but inside i can dind only this files:
  1. giachi@X451MA:/media/giachi/2BA2-A99A$ dir
  2. boot.scr    KERNEL    opilite.fex  opipc_armbian.fex  opiplus.fex
  3. bpim2p.fex  opi2.fex  opione.fex   opipc.fex              SYSTEM
Copy code
where is script.bin?
So the opipc.fex file in this directory is not a text file, but a bin file

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-2 16:32:29 | Show all floors
I installed in my pc sunxi-tools, then i convert the binary file opipc.fex found in the microSD with the comand bin2fex: this file has inside this:

  1. .....
  2. [hdmi_cec]
  3. hdmi_cec_used = 1
  4. hdmi_cec_pin = port:PA21<0><0><default><default>

  5. .....


  6. [mmc0_para]
  7. sdc_used = 1
  8. sdc_detmode = 3
  9. sdc_buswidth = 4
  10. sdc_clk = port:PF02<2><1><2><default>
  11. sdc_cmd = port:PF03<2><1><2><default>
  12. sdc_d0 = port:PF01<2><1><2><default>
  13. sdc_d1 = port:PF00<2><1><2><default>
  14. sdc_d2 = port:PF05<2><1><2><default>
  15. sdc_d3 = port:PF04<2><1><2><default>
  16. sdc_det = port:PF06<0><1><2><default>
  17. sdc_use_wp = 0
  18. sdc_wp =
  19. sdc_isio = 0
  20. sdc_regulator = "none"
  21. sdc_power_supply = "none"

  22. [mmc1_para]
  23. sdc_used = 0
  24. sdc_detmode = 4
  25. sdc_buswidth = 4
  26. sdc_clk = port:PG00<2><1><3><default>
  27. sdc_cmd = port:PG01<2><1><3><default>
  28. sdc_d0 = port:PG02<2><1><3><default>
  29. sdc_d1 = port:PG03<2><1><3><default>
  30. sdc_d2 = port:PG04<2><1><3><default>
  31. sdc_d3 = port:PG05<2><1><3><default>
  32. sdc_det =
  33. sdc_use_wp = 0
  34. sdc_wp =
  35. sdc_isio = 1
  36. sdc_regulator = "none"
  37. sdc_power_supply = "none"
  38. sdc_2xmode = 1
  39. sdc_ddrmode = 1

  40. [mmc2_para]
  41. sdc_used = 0
  42. sdc_detmode = 3
  43. sdc_buswidth = 8
  44. sdc_clk = port:PC05<3><1><2><default>
  45. sdc_cmd = port:PC06<3><1><2><default>
  46. sdc_d0 = port:PC08<3><1><2><default>
  47. sdc_d1 = port:PC09<3><1><2><default>
  48. sdc_d2 = port:PC10<3><1><2><default>
  49. sdc_d3 = port:PC11<3><1><2><default>
  50. sdc_d4 = port:PC12<3><1><2><default>
  51. sdc_d5 = port:PC13<3><1><2><default>
  52. sdc_d6 = port:PC14<3><1><2><default>
  53. sdc_d7 = port:PC15<3><1><2><default>
  54. emmc_rst = port:PC16<3><1><2><default>
  55. sdc_det =
  56. sdc_use_wp = 0
  57. sdc_wp =
  58. sdc_isio = 0
  59. sdc_regulator = "none"
  60. sdc_power_supply = "none"
  61. sdc_2xmode = 1
  62. sdc_ddrmode = 1

  63. [smc_para]
  64. smc_used = 0
  65. smc_rst = port:PA09<2><default><default><default>
  66. smc_vppen = port:PA20<3><default><default><default>
  67. smc_vppp = port:PA21<3><default><default><default>
  68. smc_det = port:PA10<2><default><default><default>
  69. smc_vccen = port:PA06<2><default><default><default>
  70. smc_sck = port:PA07<2><default><default><default>
  71. smc_sda = port:PA08<2><default><default><default>

  72. [usbc0]
  73. usb_used = 1
  74. usb_port_type = 2
  75. usb_detect_type = 1
  76. usb_id_gpio = port:PG12<0><1><default><default>
  77. usb_det_vbus_gpio = port:PG12<0><1><default><default>
  78. usb_drv_vbus_gpio = port:PL02<1><0><default><0>
  79. usb_host_init_state = 1
  80. usb_restrict_gpio =
  81. usb_restric_flag = 0
  82. usb_restric_voltage = 3550000
  83. usb_restric_capacity = 5
  84. usb_regulator_io = "nocare"
  85. usb_regulator_vol = 0
  86. usb_not_suspend = 0

  87. [usbc1]
  88. usb_used = 1
  89. usb_drv_vbus_gpio =
  90. usb_restrict_gpio =
  91. usb_host_init_state = 1
  92. usb_restric_flag = 0
  93. usb_regulator_io = "nocare"
  94. usb_regulator_vol = 0
  95. usb_not_suspend = 0

  96. [usbc2]
  97. usb_used = 1
  98. usb_drv_vbus_gpio =
  99. usb_restrict_gpio =
  100. usb_host_init_state = 1
  101. usb_restric_flag = 0
  102. usb_regulator_io = "nocare"
  103. usb_regulator_vol = 0
  104. usb_not_suspend = 0

  105. [usbc3]
  106. usb_used = 1
  107. usb_drv_vbus_gpio =
  108. usb_restrict_gpio =
  109. usb_host_init_state = 1
  110. usb_restric_flag = 0
  111. usb_regulator_io = "nocare"
  112. usb_regulator_vol = 0
  113. usb_not_suspend = 0

  114. [usb_feature]
  115. vendor_id = 6353
  116. mass_storage_id = 1
  117. adb_id = 2
  118. manufacturer_name = "USB Developer"
  119. product_name = "Android"
  120. serial_number = "20080411"

  121. [msc_feature]
  122. vendor_name = "USB 2.0"
  123. product_name = "USB Flash Driver"
  124. release = 100
  125. luns = 3

  126. [serial_feature]
  127. serial_unique = 0

  128. [module_para]
  129. module_num = 0
  130. module_power0 = "vcc-wifi-33"
  131. module_power0_vol = 0
  132. module_power1 =
  133. module_power1_vol =
  134. module_power2 =
  135. module_power2_vol =
  136. module_power3 =
  137. module_power3_vol =
  138. chip_en =
  139. lpo_use_apclk =

  140. [wifi_para]
  141. wifi_used = 0
  142. wifi_sdc_id = 1
  143. wifi_usbc_id = 2
  144. wifi_usbc_type = 1
  145. wl_reg_on = port:PL07<1><default><default><0>
  146. wl_host_wake = port:PG10<0><default><default><0>
  147. wl_host_wake_invert = 0

  148. [bt_para]
  149. bt_used = 0
  150. bt_uart_id = 1
  151. bt_rst_n =
  152. bt_wake =
  153. bt_host_wake =
  154. bt_host_wake_invert = 0

  155. [pcm0]
  156. daudio_used = 0
  157. daudio_master = 4
  158. daudio_select = 1
  159. audio_format = 1
  160. signal_inversion = 1
  161. mclk_fs = 128
  162. sample_resolution = 16
  163. slot_width_select = 32
  164. pcm_lrck_period = 32
  165. pcm_lrckr_period = 1
  166. msb_lsb_first = 0
  167. sign_extend = 0
  168. slot_index = 0
  169. slot_width = 32
  170. frame_width = 0
  171. tx_data_mode = 0
  172. rx_data_mode = 0
  173. i2s_mclk = port:PA18<2><1><default><default>
  174. i2s_bclk = port:PA19<2><1><default><default>
  175. i2s_dout0 = port:PA20<2><1><default><default>
  176. i2s_din = port:PA21<2><1><default><default>

  177. [pcm1]
  178. daudio_used = 0
  179. daudio_master = 4
  180. daudio_select = 1
  181. audio_format = 1
  182. signal_inversion = 1
  183. mclk_fs = 128
  184. sample_resolution = 16
  185. slot_width_select = 32
  186. pcm_lrck_period = 32
  187. pcm_lrckr_period = 1
  188. msb_lsb_first = 0
  189. sign_extend = 0
  190. slot_index = 0
  191. slot_width = 32
  192. frame_width = 0
  193. tx_data_mode = 0
  194. rx_data_mode = 0
  195. i2s_mclk = port:PG10<2><1><default><default>
  196. i2s_bclk = port:PG11<2><1><default><default>
  197. i2s_dout0 = port:PG12<2><1><default><default>
  198. i2s_din = port:PG13<2><1><default><default>

  199. [audio0]
  200. audio_used = 1
  201. lineout_vol = 31
  202. cap_vol = 5
  203. audio_hp_ldo = "none"
  204. adcagc_used = 0
  205. adcdrc_used = 0
  206. dacdrc_used = 0
  207. adchpf_used = 0
  208. dachpf_used = 0
  209. audio_pa_ctrl = port:PA16<1><default><default><0>

  210. [spdif0]
  211. spdif_used = 0
  212. spdif_dout = port:PA17<2><1><default><default>

  213. [audiohub]
  214. hub_used = 1
  215. codec_used = 1
  216. spdif_used = 0
  217. hdmi_used = 1

  218. [s_cir0]
  219. ir_used = 1
  220. ir_rx = port:PL11<2><1><default><default>
  221. ir_power_key_code0 = 87
  222. ir_addr_code0 = 40704
  223. ir_power_key_code1 = 26
  224. ir_addr_code1 = 64260
  225. ir_power_key_code2 = 20
  226. ir_addr_code2 = 32640
  227. ir_power_key_code3 = 21
  228. ir_addr_code3 = 32640
  229. ir_power_key_code4 = 11
  230. ir_addr_code4 = 63240
  231. ir_power_key_code5 = 3
  232. ir_addr_code5 = 239
  233. ir_power_key_code6 = 159
  234. ir_addr_code6 = 19635
  235. ir_power_key_code7 = 10
  236. ir_addr_code7 = 30536
  237. ir_power_key_code8 = 69
  238. ir_addr_code8 = 48386
  239. ir_power_key_code9 = 77
  240. ir_addr_code9 = 56865
  241. ir_power_key_code10 = 24
  242. ir_addr_code10 = 65025
  243. ir_power_key_code11 = 87
  244. ir_addr_code11 = 65280
  245. ir_power_key_code12 = 77
  246. ir_addr_code12 = 65344

  247. [cir]
  248. ir_used = 1
  249. ir_tx = port:PH07<2><default><default><default>

  250. [dvfs_table]
  251. pmuic_type = 2
  252. pmu_gpio0 = port:PL06<1><1><2><1>
  253. pmu_level0 = 11300
  254. pmu_level1 = 1100
  255. extremity_freq = 1296000000
  256. max_freq = 1200000000
  257. min_freq = 480000000
  258. LV_count = 7
  259. LV1_freq = 1296000000
  260. LV1_volt = 1320
  261. LV2_freq = 1200000000
  262. LV2_volt = 1240
  263. LV3_freq = 1104000000
  264. LV3_volt = 1180
  265. LV4_freq = 1008000000
  266. LV4_volt = 1140
  267. LV5_freq = 960000000
  268. LV5_volt = 1080
  269. LV6_freq = 816000000
  270. LV6_volt = 1020
  271. LV7_freq = 480000000
  272. LV7_volt = 980

  273. [gpu_dvfs_table]
  274. G_LV_count = 3
  275. G_LV0_freq = 312000000
  276. G_LV0_volt = 1200000
  277. G_LV1_freq = 384000000
  278. G_LV1_volt = 1200000
  279. G_LV2_freq = 456000000
  280. G_LV2_volt = 1200000

  281. [Vdevice]
  282. Vdevice_used = 0
  283. Vdevice_0 = port:PH10<5><1><2><default>
  284. Vdevice_1 = port:PH11<5><1><2><default>

  285. [s_uart0]
  286. s_uart_used = 0
  287. s_uart_tx = port:PL02<2><default><default><default>
  288. s_uart_rx = port:PL03<2><default><default><default>

  289. [s_rsb0]
  290. s_rsb_used = 1
  291. s_rsb_sck = port:PL00<2><1><2><default>
  292. s_rsb_sda = port:PL01<2><1><2><default>

  293. [s_jtag0]
  294. s_jtag_used = 0
  295. s_jtag_tms = port:PL04<2><1><2><default>
  296. s_jtag_tck = port:PL05<2><1><2><default>
  297. s_jtag_tdo = port:PL06<2><1><2><default>
  298. s_jtag_tdi = port:PL07<2><1><2><default>

  299. [s_powchk]
  300. s_powchk_used = -2147483648
  301. s_power_reg = 0
  302. s_system_power = 50

  303. [sim0]
  304. scr_used = 0
  305. scr_vccen = port:PA06<2><default><default><default>
  306. scr_slk = port:PA07<2><default><default><default>
  307. scr_sda = port:PA08<2><default><default><default>
  308. scr_rst = port:PA09<2><default><default><default>
  309. scr_det = port:PA10<2><default><default><default>

  310. [ts0]
  311. tsc_used = 0
  312. tsc_clk = port:PE00<3><default><default><default>
  313. tsc_err = port:PE01<3><default><default><default>
  314. tsc_sync = port:PE02<3><default><default><default>
  315. tsc_dvld = port:PE03<3><default><default><default>
  316. tsc_d0 = port:PE04<3><default><default><default>
  317. tsc_d1 = port:PE05<3><default><default><default>
  318. tsc_d2 = port:PE06<3><default><default><default>
  319. tsc_d3 = port:PE07<3><default><default><default>
  320. tsc_d4 = port:PE08<3><default><default><default>
  321. tsc_d5 = port:PE09<3><default><default><default>
  322. tsc_d6 = port:PE10<3><default><default><default>
  323. tsc_d7 = port:PE11<3><default><default><default>

  324. [gpio_power_key]
  325. key_used = 1
  326. key_io = port:PL03<6><default><default><0>

  327. [key_para]
  328. key_used = 0
  329. key_cnt = 5
  330. key1_vol = 222
  331. key2_vol = 444
  332. key3_vol = 666
  333. key4_vol = 857
  334. key5_vol = 2000

  335. [d7s_para]
  336. d7s_used = 0
  337. din_gpio = port:PD00<1><default><default><1>
  338. clk_gpio = port:PD01<1><default><default><1>
  339. stb_gpio = port:PD02<1><default><default><1>

  340. [mali_para]
  341. mali_used = 1
  342. mali_clkdiv = 1
  343. mali_extreme_freq = 600
  344. mali_extreme_vol = 1400

  345. [w1_para]
  346. w1_used = 1
  347. gpio = 20
Copy code
like the original setup without my changes

4

threads

1118

posts

9497

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9497
Published in 2016-6-2 23:53:53 | Show all floors
I'm not sure if I understand you correctly. You are saying that you are using your own builds from latest git sources, right? Then you are not using clean SD card. If you did, then there would be only one fex file, named script.bin. There was also one problem with update file, which didn't update fex file correctly. But it is solved. So to be completely sure that you are using latest source, please do
  1. git pull
Copy code
and then rebuild the image. If you want, you can also edit projects/H3/linux/linux.arm.conf and change lines 2050 and 2051 to be:
  1. CONFIG_SND_SUNXI_SOC_DAUDIO0_INTERFACE=y
  2. CONFIG_SND_SUNXI_SOC_DAUDIO0_PUBLIC_MACHINE=y
Copy code
That way you will have I2S drivers built in and you won't have to do any modprobing.

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-3 02:51:18 | Show all floors
thanks.
For be sure i delated all OpenELEC-OPi2 folder, then:

1) Download the project with
  1. git clone -b openelec-7.0 --depth 1 https://github.com/jernejsk/OpenELEC-OPi2
Copy code


2)  went inside the new folder:
  1. cd OpenELEC-OPi2
Copy code


3) run
  1. git pull
Copy code

it replied
  1. Already up-to-date
Copy code


4) changed the file OpenELEC-OPi2/projects/H3/sys_config/opipc.fex

  1. [hdmi_cec]
  2. hdmi_cec_used = 0
Copy code

  1. [pcm0]
  2. daudio_used = 1
Copy code

  1. [w1_para]
  2. w1_used = 0
Copy code


5) changed in OpenELEC-OPi2/projects/H3/linux/linux.arm.conf

  1. CONFIG_SND_SUNXI_SOC_DAUDIO0_INTERFACE=y
  2. CONFIG_SND_SUNXI_SOC_DAUDIO0_PUBLIC_MACHINE=y
Copy code


6) comiple with
  1. PROJECT=H3 SYSTEM=opipc ARCH=arm make image
Copy code


now i am waiting because is necessary a lot of time for the download  of the need software for compile;
tomorow i will try the new image.
For now thanks

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-6 02:59:01 | Show all floors
Hi, i resolved. The problem was the sequence I loaded the module, but I understood only today.

- I wrote on microSD the last image (OpenElec 2 June 2016),
- indide microSD I converted with bin2fex script.bin to fex file
- i changed
[pcm0]
daudio_used = 1


;i2s_din = portA21<2><1><default><default>    (PA21 is used: hdmi_cec_pin = port:PA21<0><0><default><default>)

[w1_para]
w1_used = 0



- then i convert fex file to a new script.bin
- I run micrSD on Orange PI PC, then i connected with Putty
- i load some audio modules with the sequence showed in the next pic (now is possible to see "CARD 1 snddaudio"):


- i changed audio setup on openelec

Thanks for your help!

This thread contains more resources

You need to Log in to download or view,No account?    Register

x

4

threads

1118

posts

9497

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9497
Published in 2016-6-6 03:17:22 | Show all floors
Glad to hear it.

0

threads

24

posts

472

credits

Intermediate member

Rank: 3Rank: 3

credits
472
Published in 2016-6-6 04:39:45 | Show all floors
Then you just have to modify the file script.bin only, or you have to recompile everything from 0.

Good work of the two.

4

threads

53

posts

2975

credits

Gold member

Rank: 6Rank: 6

credits
2975
 Author| Published in 2016-6-6 05:41:28 | Show all floors
Today I only change the file script.bin frome the last build image
Last daus i trought to recompile OpenElec with the change in the file  OpenELEC-OPi2/projects/H3/linux/linux.arm.con
CONFIG_SND_SUNXI_SOC_DAUDIO0_INTERFACE=y
CONFIG_SND_SUNXI_SOC_DAUDIO0_PUBLIC_MACHINE=y
but my images never run; probabily because i used the  parameter
[hdmi_cec]
hdmi_cec_used = 0
(the green led switched on, but i didn0t see nothin on the screen.

Now i must understand how to autoload snddaudio modules, but i think is easy

4

threads

1118

posts

9497

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9497
Published in 2016-6-6 05:53:49 | Show all floors
Just make an autostart.sh script http://wiki.openelec.tv/index.php/Autostart.sh
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list