Hi All
The thing I’m trying to do is stream audio to my phone with very low latency 500ms is to slow im hoping for something <50ms.
So after some research, I have decided to try TX. I get the error
pi@raspberrypi:~ $ tx -h 127.0.0.1
trx © Copyright 2014 Mark Hills <[markxwax.org](mailt: markxwax.org)>
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
snd_pcm_open: Invalid argument
Any help would be greatly appreciated.
Thanks
Jon
Here is how I got it up to this stage.
I started with I read.
lb.raspberrypi.org/forums/viewtopic.php?t=185507
- Make sure you compile against this implementation / version of ortp
========================================================
I did this.
- I changed the opus encoder / decoder to int16 from float - due to my audio devices was simple
16 bit cheep stuf.
changes to tx.c rx.c and device.c
==================================
I didn’t do this because I have the pisound
I download tx for here
www.pogo.org.uk/~mark/trx/releases/trx-0.3.tar.gz
tar -xvf trx-0.3.tar.gz
sudo apt-get install libasound2-dev
sudo apt-cache search opus
sudo apt-get install libopus-dev
sudo make install
sudo install -d /usr/local/bin
sudo install rx tx /usr/local/bin
There is a small error in the doco
I think
pcm.!default { type plug slave.pcm { type dmix ipc_key 2867 slave { pcm “hw:Loopback,0,0” rate 48000 format S16_LE channels 2 period_size 1024 buffer_size 8192 } }
should be
pcm.!default { type plug slave.pcm { type dmix ipc_key 2867 slave { pcm “hw:Loopback,0,0” rate 48000 format S16_LE channels 2 period_size 1024 buffer_size 8192 } }}
pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# modprobe snd-aloop
pi@raspberrypi:~ $ aplay -vv test.wav
Playing WAVE ‘test.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Plug PCM: Direct Stream Mixing PCM
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 8192
period_size : 1024
period_time : 21333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 8192
stop_threshold : 8192
silence_threshold: 0
silence_size : 0
boundary : 1073741824
Hardware PCM card 2 ‘Loopback’ device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 8192
period_size : 1024
period_time : 21333
tstamp_mode : ENABLE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 1
stop_threshold : 1073741824
silence_threshold: 0
silence_size : 1073741824
boundary : 1073741824
appl_ptr : 0
hw_ptr : 0
######### + | 21%
#+ | 00%
pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: pisound [pisound], device 0: PS-06A5GMK snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
pi@raspberrypi:~ $ cat .asoundrc
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
pcm.!default {
type plug
slave.pcm {
type dmix
ipc_key 2867
slave {
pcm “hw:Loopback,0,0”
rate 48000
format S16_LE
channels 2
period_size 1024
buffer_size 8192
}
}
}
pcm.hubcap {
type plug
slave {
pcm “hw:Loopback,1,0”
rate 48000
format S16_LE
}
}
pi@raspberrypi:~ $ tx -h 192.168.43.246
trx © Copyright 2014 Mark Hills <[markxwax.org](mailt: markxwax.org)>
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
snd_pcm_open: Invalid argument
pi@raspberrypi:~ $ ping 192.168.43.246
PING 192.168.43.246 (192.168.43.246) 56(84) bytes of data.
64 bytes from 192.168.43.246: icmp_seq=1 ttl=64 time=7.04 ms
64 bytes from 192.168.43.246: icmp_seq=2 ttl=64 time=5.85 ms
pi@raspberrypi:~ $ tx -h 127.0.0.1
trx © Copyright 2014 Mark Hills <[markxwax.org](mailt: markxwax.org)>
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
snd_pcm_open: Invalid argument