티스토리 뷰

Raspberry pi를 가지고 놀다 bluetooth 장비는 있으나 연결된 headset을 이용할 수 없었다.

어찌어찌해서 alsa-pulseaudio에 bluetooth headset을 연결하는 것까지 성공하였으나, 그 다음이 막혀 한동안 고생했다.


$ pactl list .... 생략 ... Card #5 Name: bluez_card.00_02_5B_00_FF_CE Driver: module-bluez5-device.c Owner Module: 29 Properties: device.description = "VISVI J2" device.string = "00:02:5B:00:FF:CE" device.api = "bluez" device.class = "sound" device.bus = "bluetooth" device.form_factor = "headset" bluez.path = "/org/bluez/hci0/dev_00_02_5B_00_FF_CE" bluez.class = "0x240404" bluez.alias = "VISVI J2" device.icon_name = "audio-headset-bluetooth" device.intended_roles = "phone" Profiles: a2dp: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes) off: Off (sinks: 0, sources: 0, priority: 0, available: yes) Active Profile: a2dp Ports: headset-output: Headset (priority: 0, latency offset: 0 usec) Part of profile(s): a2dp headset-input: Headset (priority: 0, latency offset: 0 usec, not available)

이렇게 나오는 것은 device 5번으로 잡혔다는 것이고, 여기에 paplay를 통해 wav, raw 등을 밀어 넣을 수 있다. 하지만, mp3는 paplay로는 안된다. 


mpg123 을 통해 stdout 으로 mpeg 파일을 raw로 변환하여 출력하는 것을 넘겨주면 된다.


$ mpg123 -s "blah.mp3" | paplay -d 5 --raw --passthrough


paplay에는 --raw 형식을 stdin (--passthrough)으로부터 입력받는 옵션이 있으며, mpg123에는 stdout으로 출력하는 옵션이 있다. (-s)


저렇게 하는 방법외에도 있을 것 같으나, (mpg123이 pulseaudio에 직접보내는 그런 아름다운 방법) 왜 잘 안될까.

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함