サウンドを再生すると2回目以後、右と左の音声がランダムに入れ替わる不具合はドライバの問題だった。再生を止めるときにLRCK(WS) クロックの状態を無視してDMA転送を止めるため、LRCK(WS)がLowで終わってしまうと次回の再生時にL/Rがひっくり返ってしまう。対策として転送終了時に S3C2410_IISCON_IISEN を 0 にして IIS コントローラをリセットするようにしたところ、毎回 LRCK(WS) は Highで終了するようになった。
SAMSUNG S3C2410: alsa player left and right channel swap bug. DMA stops randomly if LRCKis Low or High. if LRCK is low when DMA transmitting stops. Left and Right channel will swap (Bug) on next sound playing. to disable S3C2410_IISCON_IISEN when s3c24xx_snd_txctrl(0), LRCK will be High.
--- linux-2.6.30.4.orig/sound/soc/s3c24xx/s3c24xx-i2s.c 2009-07-03 08:41:20.000000000 +0900 +++ linux-2.6.30.4/sound/soc/s3c24xx/s3c24xx-i2s.c 2011-05-10 21:53:32.000000000 +0900 @@ -106,20 +106,21 @@ * seem to happen when the DMA stops. According to the * Samsung supplied kernel, this should allow the DMA * engine and FIFOs to reset. If this isn't allowed, the * DMA engine will simply freeze randomly. */ iisfcon &= ~S3C2410_IISFCON_TXENABLE; iisfcon &= ~S3C2410_IISFCON_TXDMA; iiscon |= S3C2410_IISCON_TXIDLE; iiscon &= ~S3C2410_IISCON_TXDMAEN; + iiscon &= ~S3C2410_IISCON_IISEN; // 2011-05-10 EBIHARA iismod &= ~S3C2410_IISMOD_TXMODE; writel(iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); writel(iisfcon, s3c24xx_i2s.regs + S3C2410_IISFCON); writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); } DBG("w: IISCON: %lx IISMOD: %lx IISFCON: %lx\n", iiscon, iismod, iisfcon); }keyword: s3c2410, s3c24xx, mini2440, alsa, left, right, channel, swap
# groups id: cannot find name for group ID 4294967258 # touch a # ls -l -rw-r--r-- 1 root 4294967258 0 May 23 17:49 a4294967258 かなり怪しい。4294967258 => 0xFFFFFFDA => -38(十進数)
#define ENOSYS 38 /* Function not implemented *//bin/login がこのエラー番号(-ENOSYS)をそのまま gid にしてやしないか?
make menuconfig General setup ---> [*] Enable 16-bit UID system calls ↑を有効にする
Priority: required 61 Priority: important 58 Priority: standard 71 Priority: optional 18462 Priority: extra 3612 (干渉してしまう可能性があるもの)
準備 (debian lenny) # apt-get install usbutils libusb-dev
# lsusb -v 略して表示 Bus 007 Device 011: ID 0409:0059 NEC Corp. HighSpeed Hub Per-port power switching ← 電源制御あり Per-port overcurrent protection TT think time 16 FS bits Port indicators Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0503 highspeed power enable connect Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub No power switching (usb 1.0) ← 電源制御機能なしということで Bus 007 Device 011 のハブは Per-port power switching と Per-port overcurrent protection が使えそうです。
$ gcc -O2 -lusb hub-ctl.c -o hub-ctl
$ su (rootユーザで) # ./hub-ctl -b 7 -d 11 -P 4 -p 1 # 電源ON # ./hub-ctl -b 7 -d 11 -P 4 -p 0 # 電源OFF バス デバイス ポート先ほど Bus 007 Device 011 , Port 1-4 を確認したので -b 7 -d 11 となるようです。
# lsusb -v Bus 002 Device 001: ID 1d6b:0002 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 1 wHubCharacteristic 0x0011 Per-port power switching ← 電源制御あり同じく hub-ctl.c で5VのON/OFFがコントロール出来ました。
インストール # apt-get install screen 使い方 CTRL+A | 画面縦分割 CTRL+A Tab 画面移動 CTRL+A C シェル起動 CTRL+A X 画面削除詳しい使い方はぐぐってください。