Pine64 使用问题汇总

2018-07-30 19 0

使用MacOS在SD上刻录系统

  1. df -lh
  2. diskutil list
  3. diskutil unmount /dev/disk3s1
  4. diskutil /dev/disk3
  5. dd bs=1M if=xenial-pine64-bspkernel-20161218-1.img of=/dev/disk3
  6. diskutil unmount /dev/disk3
  7. diskutil eject /dev/disk3

首次连接

将Pine64用网线连接到路由器上,如果没有路由器,也可以用网线连接到你的Mac上,然后在 设置->共享->互联网共享,将WIFI网络共享到以太网,并启动共享。然后在设置->网络中查看以太网地址,如果已分配,说明Pine64和Mac已连接上,但是这个IP并不是Pine64的IP,可以使用命令arp -a来查看联网设备的IP地址。

耳机无声音

使用root用户执行以下命令:

  1. apt-get update
  2. apt-get install alsa-base alsa-utils pulseaudio mplayer
  3. cat <<EOF >/etc/modules-load.d/pine64-audiojack.conf
  4. sunxi_codec
  5. sunxi_i2s
  6. sunxi_sndcodec
  7. EOF
  8. wget https://raw.githubusercontent.com/longsleep/build-pine64-image/master/blobs/asound.state -O /var/lib/alsa/asound.state
  9. usermod -a -G audio ubuntu
  10. reboot

重启后使用命令alsamixer调整音量,使用aplay -l来查看设备(https://blog.csdn.net/davidzwb/article/details/51516783)。

使用mplayer播放时指定设备

  1. mplayer -ao alsa:device=hw=1.0 some_audio_or_vide_file.mp4

参考:https://forum.pine64.org/showthread.php?tid=1228&highlight=alsa

开启蓝牙

首先,安装必要的软件

  1. sudo apt-get install build-essential bluetooth bluez blueman

安装驱动

  1. git clone https://github.com/lwfinger/rtl8723bs_bt.git
  2. cd rtl8723bs_bt
  3. make && sudo make install

启动蓝牙

  1. ./rtk_hciattach -n -s 115200 /dev/ttyS1 rtk_h5 > /tmp/hciattach.txt 2>&1 &
  2. /bin/sleep 5
  3. /usr/sbin/rfkill unblock 3
  4. /usr/bin/bluetoothctl
  5. pairable on
  6. power on
  7. quit

查看设备

  1. rfkill list
  2. rfkill unblock all

结果如下

  1. 0: sunxi-bt: Bluetooth
  2. Soft blocked: no
  3. Hard blocked: no
  4. 1: phy0: Wireless LAN
  5. Soft blocked: no
  6. Hard blocked: no
  7. 2: phy1: Wireless LAN
  8. Soft blocked: no
  9. Hard blocked: no
  10. 3: hci0: Bluetooth
  11. Soft blocked: no
  12. Hard blocked: no

启动并查看蓝牙:

  1. hciconfig hci0 up
  2. hcitool dev

要使用蓝牙作为音频,先启动pulseaudio

  1. pulseaudio -k
  2. pulseaudio --start

重启蓝牙服务

  1. systemctl restart bluetooth

蓝牙控制命令

  1. bluetoothctl
  2. list
  3. power on
  4. scan on
  5. agent on
  6. pair 10:48:B1:E5:2F:1C
  7. trust 10:48:B1:E5:2F:1C
  8. connect 10:48:B1:E5:2F:1C

如果connect无法连接,也可以尝试使用

  1. rfcomm bind hci0 10:48:B1:E5:2F:1C
  2. hcitool cc 10:48:B1:E5:2F:1C

配置默认音频输出设备

  1. pacmd list-sinks

单声音配置

  1. pacmd set-default-sink 1

参考
https://blog.csdn.net/pengrui18/article/details/53747562
https://forum.pine64.org/showthread.php?tid=2248

安装python3.7

  1. apt-get install zlibc zlib1g-dev libffi-dev libcurl4-openssl-dev libssl-dev openssl openssl-dev sqlite3 libsqlite3-dev -y
  2. wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
  3. tar xf Python-3.7.0.tgz && cd Python3.7.0
  4. ./configure --enable-optimizations --with-ensurepip=install --enable-shared --disable-ipv6 && make -j4 && make install