Firefly开源社区

12
发表新贴
打印 上一主题 下一主题

[懇請開示] 想開啟 USB Gadget Drivers (Audio Gadget)

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350

[懇請開示] 想開啟 USB Gadget Drivers (Audio Gadget)

发表于 2016-5-20 09:36:23      浏览:28952 | 回复:15        打印      只看该作者   [复制链接] 楼主
請教大神:

  應如何開啟並測試. 感謝大神

回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-20 10:54:44        只看该作者  沙发
目前 make menuconfig -> search gadget -> (1) -> 選 Audio Gadget -> Save & Exit

  x x         <*>   USB Gadget Drivers (Audio Gadget)  --->                                   x x
  x x                 Audio Gadget                                                            x x
  x x         [ ]       UAC 1.0 (Legacy)                                                      x x

重新build kernel 放上板子上跑, 結果如下
root@firefly:~# cat /proc/asound/cards
0 [UAC2Gadget     ]: UAC2_Gadget - UAC2_Gadget
                      UAC2_Gadget 0
1 [RKES8323       ]: RK_ES8323 - RK_ES8323
                      RK_ES8323
2 [RKHDMISPDIF    ]: RK-HDMI-SPDIF - RK-HDMI-SPDIF
                      RK-HDMI-SPDIF

但連接 rk3288(otg) <-> Win7 並沒有USB偵測出現新的音效裝置


懇求大神開示 Orz
回复

使用道具 举报

950

积分

95

威望

72

贡献

超级版主

Rank: 8Rank: 8

积分
950
发表于 2016-5-20 10:56:47        只看该作者  板凳
没有做过,帮顶~
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-20 14:39:47        只看该作者  地板
另外, dmesg 常可見
[14196.871991] init: ttyS2 main process (4184) terminated with status 1
[14196.872410] init: ttyS2 main process ended, respawning
[14206.764955] init: ttyS2 main process (4187) terminated with status 1
[14206.765366] init: ttyS2 main process ended, respawning
[14216.652770] init: ttyS2 main process (4189) terminated with status 1
[14216.653227] init: ttyS2 main process ended, respawning
[14226.538692] init: ttyS2 main process (4191) terminated with status 1
[14226.539144] init: ttyS2 main process ended, respawning
[14236.425308] init: ttyS2 main process (4193) terminated with status 1
[14236.425719] init: ttyS2 main process ended, respawning
[14246.314763] init: ttyS2 main process (4195) terminated with status 1
[14246.315161] init: ttyS2 main process ended, respawning
[14256.211485] init: ttyS2 main process (4197) terminated with status 1
[14256.211921] init: ttyS2 main process ended, respawning
[14266.097866] init: ttyS2 main process (4199) terminated with status 1
[14266.099003] init: ttyS2 main process ended, respawning
[14275.988973] init: ttyS2 main process (4201) terminated with status 1
[14275.989393] init: ttyS2 main process ended, respawning
[14285.876824] init: ttyS2 main process (4203) terminated with status 1
[14285.877256] init: ttyS2 main process ended, respawning
[14295.783400] init: ttyS2 main process (4205) terminated with status 1
[14295.783924] init: ttyS2 main process ended, respawning
[14305.683830] init: ttyS2 main process (4207) terminated with status 1
[14305.684240] init: ttyS2 main process ended, respawning
[14315.570145] init: ttyS2 main process (4209) terminated with status 1
[14315.570551] init: ttyS2 main process ended, respawning
[14325.460627] init: ttyS2 main process (4211) terminated with status 1
[14325.461079] init: ttyS2 main process ended, respawning
[14335.348002] init: ttyS2 main process (4213) terminated with status 1
[14335.348415] init: ttyS2 main process ended, respawning
[14345.236314] init: ttyS2 main process (4215) terminated with status 1
[14345.236750] init: ttyS2 main process ended, respawning
[14355.127797] init: ttyS2 main process (4217) terminated with status 1
[14355.128189] init: ttyS2 main process ended, respawning
[14365.017737] init: ttyS2 main process (4219) terminated with status 1
[14365.018150] init: ttyS2 main process ended, respawning
[14374.906715] init: ttyS2 main process (4221) terminated with status 1
[14374.907147] init: ttyS2 main process ended, respawning
[14384.798319] init: ttyS2 main process (4223) terminated with status 1
[14384.798720] init: ttyS2 main process ended, respawning
[14394.685626] init: ttyS2 main process (4225) terminated with status 1
[14394.686063] init: ttyS2 main process ended, respawning
[14404.574125] init: ttyS2 main process (4227) terminated with status 1
[14404.574516] init: ttyS2 main process ended, respawning
[14414.461412] init: ttyS2 main process (4229) terminated with status 1
[14414.461844] init: ttyS2 main process ended, respawning
[14424.354397] init: ttyS2 main process (4231) terminated with status 1
[14424.355845] init: ttyS2 main process ended, respawning
[14434.256767] init: ttyS2 main process (4233) terminated with status 1
[14434.257204] init: ttyS2 main process ended, respawning
想問這有事嗎 @@?
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-20 18:04:00        只看该作者  5#
繼續 @@"
衝了許久的浪, 上岸一會, 小歇片刻
============{以上廢話}============

echo 1 > /sys/bus/platform/drivers/usb20_otg/dwc_otg_conn_en
之後,
M$ 系統提示有新的 USB 硬體接入, 但是 {音效,視訊及遊戲控制器} 驅動裝置[ Source/Sink ] 顯示為  (!)驚嘆號
應該是對應到 ./drivers/usb/gadget/f_uac2.c:      [STR_ASSOC].s = "Source/Sink",

dmesg 顯示:
在 afunc_set_alt 裡面 印出了 snd_uac2 snd_uac2.0: free_ep:946 Error!

懇請大神 釋疑
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-23 10:36:05        只看该作者  6#
既然接 Windows 系統驅動顯示是(!)驚嘆號, 就改接 Linux 系統試看看:


dmesg顯示
[432450.249412] usb 2-1.6: USB disconnect, device number 5
[432461.964368] usb 2-1.6: new high-speed USB device number 6 using ehci-pci
[432462.058621] usb 2-1.6: New USB device found, idVendor=1d6b, idProduct=0101
[432462.058626] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[432462.058629] usb 2-1.6: Product: Linux USB Audio Gadget
[432462.058631] usb 2-1.6: Manufacturer: Linux 3.10.0 with dwc_otg_pcd
[432462.130287] retire_capture_urb: 4548 callbacks suppressed


root@atuser123:~# cat /proc/asound/cards
0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7130000 irq 47
1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7080000 irq 17
2 [Gadget         ]: USB-Audio - Linux USB Audio Gadget
                      Linux 3.10.0 with dwc_otg_pcd Linux USB Audio Gadget at usb-0000:00:1d.0-1.6, h


在 rk3288 上面執行:
arecord -D plughw:2,0 /root/test.wav -v
然後, 在 Linux 上面執行:
aplay   -D plughw:2,0   /root/Media-Convert_test3_PCM_Stereo_VBR_16SS_11025Hz.wav -v


把檔案放到windows上來播放聽看看, 好像有點東西了~~


有大神知道這個嗎??
retire_capture_urb: 4931 callbacks suppressed
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-25 09:21:56        只看该作者  7#
本帖最后由 woody.lee 于 2016-5-25 09:25 编辑

昨天搞了一天沒弄出甚麼東西, 真是讓人沮喪 Orz

請大神指點迷津, 目前狀態:


RK3288     <->   Ubuntu      Result
arecord               aplay          OK
aplay                  arecord       Fail


RK3288     <->   Win7         (!)Source/Sink
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-25 17:22:15        只看该作者  8#
改成 insmod 方式作驗證

dmesg 訊息如下

[  146.166042] WARN::dwc_otg_pcd_ep_stop_transfer:1762: dwc_otg_pcd_ep_stop_transfer: timeout diepctl.snak
[  146.166042]
[  146.818142] init: ttyS2 main process (1323) terminated with status 1
[  146.818424] init: ttyS2 main process ended, respawning
[  147.082139] rockchip_i2c ff650000.i2c: Addr[0x0040] wait event timeout, state: 1, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[  147.084193] rockchip_i2c ff650000.i2c: I2C_CON: start bit is set
[  147.279043] rockchip_i2c ff650000.i2c: Addr[0x0040] wait event timeout, state: 1, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[  147.281085] rockchip_i2c ff650000.i2c: I2C_CON: start bit is set
[  147.282099] ###################WARNING:set voltage is error!voltage set is 950000 mv -110
[  147.282125] DVFS ERR:        dvfs_regulator_set_voltage_readback: now read back to check voltage
[  147.475932] rockchip_i2c ff650000.i2c: Addr[0x0040] wait event timeout, state: 1, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[  147.477978] rockchip_i2c ff650000.i2c: I2C_CON: start bit is set
[  147.478992] DVFS ERR:        dvfs_regulator_set_voltage_readback: set ERROR AND NOT effected, volt=937500
[  147.479078] DVFS ERR:        dvfs_scale_volt_direct: vd_arm set voltage up err ret = -110, Vnew = 950000(was 900000)mV
[  147.672821] rockchip_i2c ff650000.i2c: Addr[0x0040] wait event timeout, state: 1, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[  147.674863] rockchip_i2c ff650000.i2c: I2C_CON: start bit is set
[  147.675879] DVFS WARNING:    dvfs_reset_volt:vd(vd_arm) try to reload volt = 937500
[  147.873313] WARN::dwc_otg_pcd_ep_stop_transfer:1786: dwc_otg_pcd_ep_stop_transfer: timeout diepctl.epdis
[  147.873313]
[  156.706129] init: ttyS2 main process (1327) terminated with status 1
[  156.706421] init: ttyS2 main process ended, respawning
[  166.581110] init: ttyS2 main process (1330) terminated with status 1
[  166.581498] init: ttyS2 main process ended, respawning
[  176.469193] init: ttyS2 main process (1334) terminated with status 1
[  176.469487] init: ttyS2 main process ended, respawning
[  186.335126] init: ttyS2 main process (1336) terminated with status 1
[  186.335413] init: ttyS2 main process ended, respawning


懇請大神度化有緣人~~
回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-26 16:10:35        只看该作者  9#
老感覺挫折像海浪般襲來, 這浪也太大了唄!
更新一下進度:
insmod後, rmmod 就會出現在 dmesg裏
[   67.803881] ------------[ cut here ]------------
[   67.803999] WARNING: at drivers/base/core.c:228 device_release+0x7c/0x90()
[   67.804499] Device 'snd_uac2.0' does not have a release() function, it is broken and must be fixed.
[   67.815224] Modules linked in: g_audio(-) mali_kbase libcomposite
[   67.815336] CPU: 2 PID: 1201 Comm: rmmod Not tainted 3.10.0 #38
[   67.815443] [<c0013e04>] (unwind_backtrace+0x0/0xe0) from [<c0011720>] (show_stack+0x10/0x14)
[   67.815520] [<c0011720>] (show_stack+0x10/0x14) from [<c002aa40>] (warn_slowpath_common+0x4c/0x68)
[   67.815590] [<c002aa40>] (warn_slowpath_common+0x4c/0x68) from [<c002aadc>] (warn_slowpath_fmt+0x2c/0x3c)
[   67.815659] [<c002aadc>] (warn_slowpath_fmt+0x2c/0x3c) from [<c02e8ca8>] (device_release+0x7c/0x90)
[   67.815728] [<c02e8ca8>] (device_release+0x7c/0x90) from [<c0264c6c>] (kobject_release+0x68/0x7c)
[   67.815808] [<c0264c6c>] (kobject_release+0x68/0x7c) from [<bf077a94>] (afunc_unbind+0x44/0xa4 [g_audio])
[   67.815917] [<bf077a94>] (afunc_unbind+0x44/0xa4 [g_audio]) from [<bf000d78>] (remove_config+0x6c/0xe4 [libcomposite])
[   67.816032] [<bf000d78>] (remove_config+0x6c/0xe4 [libcomposite]) from [<bf002b9c>] (__composite_unbind+0x40/0xa0 [libcomposite])
[   67.816132] [<bf002b9c>] (__composite_unbind+0x40/0xa0 [libcomposite]) from [<c0492398>] (usb_gadget_remove_driver+0x68/0x9c)
[   67.817035] [<c0492398>] (usb_gadget_remove_driver+0x68/0x9c) from [<c0492408>] (usb_gadget_unregister_driver+0x3c/0x78)
[   67.817117] [<c0492408>] (usb_gadget_unregister_driver+0x3c/0x78) from [<c007e0e0>] (SyS_delete_module+0x18c/0x1fc)
[   67.817191] [<c007e0e0>] (SyS_delete_module+0x18c/0x1fc) from [<c000da00>] (ret_fast_syscall+0x0/0x30)
[   67.817233] ---[ end trace 7e1c631e2a90cd3b ]---

回复

使用道具 举报

350

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
350
发表于 2016-5-27 08:54:48        只看该作者  10#
更新下進度:
1. RK3288下 arecord 可以錄到 從 OTG port 進來的聲音
2. RK3288下 aplay 會有下列訊息:
root@firefly:/home/firefly/Downloads# aplay   -D plughw:2,0  -f S16_LE -r192000 64K_S16_LE_Mono.wav
Playing WAVE '64K_S16_LE_Mono.wav' : Signed 16 bit Little Endian, Rate 64000 Hz, Mono
underrun!!! (at least 1051.375 ms long)
underrun!!! (at least 4.734 ms long)


根據網路上查到的資料
來源引用: http://blog.csdn.net/azloong/article/details/6277457
overrun(录制时,数据都满了,还没被alsa驱动读走)和underrun(需要数据来播放,alsa驱动却不写入数据)


到底問題在哪呢 @@?
回复

使用道具 举报

返回列表
12
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表