Question about AudioRoutingManager - Windows Phone 8 Q&A, Help & Troubleshooting

How to call a method SetAudioEndPoint from the class AudioRoutingManager?
I'm doing all the instructions with " msdn.microsoft.com/en-us/library/windowsphone/develop/jj207046(v=vs.105).aspx ". But when I try to call SetAudioEndPoint exception occurs "Eccess denied". What to do?
P.S. VoIP classes I do not use. ID_CAP_VOIP I added. Maybe it's because there is no active VoIP call?

Depends on the value of the enumeration you've chosen.

You can read more?
I try this:
Code:
LPCWSTR renderId = GetDefaultAudioRenderId(AudioDeviceRole::Communications);
HRESULT hr = E_FAIL;
hr = ActivateAudioInterface(renderId, __uuidof(IAudioClient2), (void**)&m_pDefaultRenderDevice);
hr = m_pDefaultRenderDevice->GetMixFormat(&m_waveFormatEx);
AudioClientProperties properties = {};
properties.cbSize = sizeof AudioClientProperties;
properties.eCategory = AudioCategory_Other;
hr = m_pDefaultRenderDevice->SetClientProperties(&properties);
WAVEFORMATEX temp;
MyFillPcmFormat(temp, 2, 44100, 16); // stereo, 44100 Hz, 16 bit
*m_waveFormatEx = temp;
m_sourceFrameSizeInBytes = (m_waveFormatEx->wBitsPerSample / 8) * m_waveFormatEx->nChannels;
hr = m_pDefaultRenderDevice->Initialize(AUDCLNT_SHAREMODE_SHARED, 0x88000000, 1000 * 10000, 0, m_waveFormatEx, NULL);
hr = m_pDefaultRenderDevice->GetService(__uuidof(IAudioRenderClient), (void**)&m_pRenderClient);
hr = m_pDefaultRenderDevice->Start();
The sound is played. But if I try to change SetAudioEndPoint an error occurs.
What's wrong?

Topic can be closed. I understood. Thank you all!

Please include an explanation of how you solved the problem so others who encounter it can find the fix!
You can then close the topic yourself if you want to, since you are the thread owner.

Related

Diamond reboots after a replication with sqlce

Hello to all,
we have a hard time with a replication project. A call to
SqlCeReplication.Dispose() reboots the device 100% reproducable. We can reproduce the behaviour with a project that contains nothing but the standard replication call.
SqlCeReplication repl = new SqlCeReplication();
try
{
repl.ConnectionManager = true;
repl.InternetUrl = @"our url";
repl.Publisher = @"our publisher";
repl.PublisherDatabase = @"our db";
repl.PublisherSecurityMode =
SecurityType.DBAuthentication;
repl.PublisherLogin = @"loginname";
repl.PublisherPassword = @"password";
repl.Publication = @"publKFPMobileMHD_LFD";
repl.Subscriber = @"LFDabo";
repl.HostName = "SW0031";
repl.SubscriberConnectionString =
@"Data Source=""" +
DatabasePath +
@""";Max Database Size=128;Password=our password;Default Lock Escalation =100";
repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();
repl.Dispose();
The error only occurs on slow connections (GPRS or Edge) and when the size of the database created with this call is above 500 Kb or so. Its not reproducible in HSDPA or when I use the desktop connection in emulator.
The repl.Synchronize() works perfectly. The replication is finished and correct, there are no errors in the webserver log, in SQLCESALOG or on the publisher.
There is no excepion raised at any point, just reboot.
If I omit the call to Dispose(), the reboot is delayed until I close the app or until I restart the app after closing. Obviously this is when the garbage collection calls dispose.
To me it looks more than a problem with the communication stack than with replication itself, but I may be wrong. I would be very thankful for any suggestions or tips for further debugging.
We use SQL CE 3.5 Components on device, webserver and database, since we ran into the "reconciler failed" problem describe in a other thread here when using SQL CE 3.5 SP1. The pda is a T-Mobile MDA Compact IV (GER-Rom). With other PDAs we didnĀ“t get this error.
Perhaps someone can help me.
Best regards,
Rainer

Class 0 Text message App?

Hello,
Do you guys know if there is an app that allows to send class 0 sms aka flash SMS?
There is only 1 app on the market that does it but it FC all the time.
On T-Mobile in the UK you can do this by just starting a regular SMS with two exclamation marks. I'm not sure if this would work on other networks or in other countries but try sending...
Code:
!!Test Message
as an SMS to yourself and see what happens.
I juste tried your trick but it doesn't work here (Orange FR).
According to the 3GPP TS 23.038 spec:
Code:
General Data Coding indication
Bits 5..0 indicate the following:
Bit 5, if set to 0, indicates the text is uncompressed
Bit 5, if set to 1, indicates the text is compressed using the compression algorithm defined in 3GPP TS 23.042 [13]
Bit 4, if set to 0, indicates that bits 1 to 0 are reserved and have no message class meaning
Bit 4, if set to 1, indicates that bits 1 to 0 have a message class meaning::
Bit 1 Bit 0 Message Class
0 0 Class 0
0 1 Class 1 Default meaning: ME-specific.
1 0 Class 2 (U)SIM specific message
1 1 Class 3 Default meaning: TE specific (see 3GPP TS 27.005 [8])
Is it possible to modify thoses parameters in Android?
bump !bump !
Such applications exist for Symbian and Winmobile.
Unfortunately not for android.
I wish I had the skills to create such an app
HushSMS for WinMo
SysSMS for symbian
also looking for a app for sending Ping SMS too (or Type 0)
Flash sms
or
Advanced SMS Sender can do that on android
Flash sms it best

Bluetooth Amazon FireTV Stick Remote

I have made some progress in finding out whats wrong but no idea how to fix it.
After installing evtest I get the following:
Code:
OpenELEC:~ # cat /proc/bus/input/devices
I: Bus=0005 Vendor=1949 Product=0404 Version=011b
N: Name="Amazon Fire TV Remote"
P: Phys=00:1a:7d:da:71:13
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:1949:0404.0001/input/input0
U: Uniq=a0:02:dc:e0:f9:d7
H: Handlers=kbd event0
B: PROP=0
B: EV=10001b
B: KEY=10000 1110 40000800 1681 0 0 0
B: ABS=100 0
B: MSC=10
Code:
OpenELEC:~ # evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x1949 product 0x404 version 0x11b
Input device name: "Amazon Fire TV Remote"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 96 (KEY_KPENTER)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Event code 139 (KEY_MENU)
Event code 158 (KEY_BACK)
Event code 164 (KEY_PLAYPAUSE)
Event code 168 (KEY_REWIND)
Event code 172 (KEY_HOMEPAGE)
Event code 208 (KEY_FASTFORWARD)
Event type 3 (EV_ABS)
Event code 40 (ABS_MISC)
Value 0
Min 0
Max 255
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Property type 20 (EV_REP)
Property code 0 (REP_DELAY)
Value 1000
Property code 1 (REP_PERIOD)
Value 33
Testing ... (interrupt to exit)
***********************************************
This device is grabbed by another process.
No events are available to evtest while the
other grab is active.
In most cases, this is caused by an X driver,
try VT-switching and re-run evtest again.
***********************************************
So something is capturing the input and not letting it go through. Any idea how to fix this?
Just an update. Connected a Bluetooth keyboard and that worked fine and gave the same evtest output saying something else was grabbing the input which would mean that's not the problem with the Amazon remote.
Again, any help is welcomed!
This has been bugging me for the last day or two as well; and to be honest - still is.
The below will work but just seems "wrong" to have to use eventlircd for this...
/storage/.config/eventlircd.d/aftvsremote.evmap
(copy /etc/eventlircd.d to /storage/.config/eventlircd.d)
Code:
KEY_KPENTER = KEY_OK
KEY_UP = KEY_UP
KEY_LEFT = KEY_LEFT
KEY_RIGHT = KEY_RIGHT
KEY_DOWN = KEY_DOWN
KEY_MENU = KEY_EPG
KEY_BACK = KEY_EXIT
KEY_PLAYPAUSE = KEY_PLAY
KEY_REWIND = KEY_REWIND
KEY_HOMEPAGE = KEY_MEDIA
KEY_FASTFORWARD = KEY_FASTFORWARD
/storage/.config/autostart.sh
Bind mount because I'm too lazy to rebuild the openelec squashfs image
Code:
mount --bind /storage/.config/eventlircd.d/ /etc/eventlircd.d/
/storage/.config/udev.rules.d/99-eventlircd.rules
Code:
SUBSYSTEMS=="bluetooth", GOTO="begin-bluetooth"
GOTO="end-bluetooth"
LABEL="begin-bluetooth"
ATTRS{name}=="Amazon Fire TV Remote", \
ENV{eventlircd_enable}="true", \
ENV{eventlircd_evmap}="aftvsremote.evmap"
LABEL="end-bluetooth"
Thank you so much!!! I got a chance to enter the code today and it works perfectly! I had to repair after the initial reboot but it keeps pairing after that for all other reboots. I hope they put this into openelec from here on out.
Again thanks!

MMAL error, failed to enable port

HI, I have this issue of not being able to connect to my Rpi camera, which is for home security use.
I think the problem may be that more than one process is trying to connect to the camera at the same time, but:
1. How can I find out which processes may be trying to connect?
2. How can I disable /delete those processes?
This is my alarm.py code. I think it's from this site: https://circuitdigest.com/microcontroller-projects/raspberry-pi-iot-intruder-alert-system
Code:
#!/usr/bin/env python3
import RPi.GPIO as gpio
import picamera
import time
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
from email.mime.image import MIMEImage
fromaddr = "email_address" # change the email address accordingly
toaddr = "to_another_email_address"
mail = MIMEMultipart()
mail['From'] = fromaddr
mail['To'] = toaddr
mail['Subject'] = "Attachment"
body = "Please find the attachment"
led=17
pir=18
HIGH=1
LOW=0
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(led, gpio.OUT) # initialize GPIO Pin as outputs
gpio.setup(pir, gpio.IN) # initialize GPIO Pin as input
data=""
def sendMail(data):
mail.attach(MIMEText(body, 'plain'))
print data
dat='%s.jpg'%data
print dat
attachment = open(dat, 'rb')
image=MIMEImage(attachment.read())
attachment.close()
mail.attach(image)
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(fromaddr, "make_password")
text = mail.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
def capture_image():
data= time.strftime("%d_%b_%Y|%H:%M:%S")
camera.start_preview()
time.sleep(5)
print data
camera.capture('%s.jpg'%data)
camera.stop_preview()
time.sleep(1)
sendMail(data)
gpio.output(led , 0)
camera = picamera.PiCamera()
camera.rotation=0
camera.awb_mode= 'auto'
camera.brightness=55
while 1:
if gpio.input(pir)==1:
gpio.output(led, HIGH)
capture_image()
while(gpio.input(pir)==1):
time.sleep(1)
else:
gpio.output(led, LOW)
time.sleep(0.01)
Thanks!

Trying to save a hex stream string as separate numerical values

Hi,
I am designing a BLE scanner that is required to receive and display the advertised packets of data (as well as other functions). So far this has been successful and the hex stream is being displayed using the following function:
// Device scan callback.
private ScanCallback leScanCallback = new ScanCallback() {
@override
public void onScanResult(int callbackType, ScanResult result) {
// gets data from the BLE scan for broadcasting packets
ScanRecord Scanned = result.getScanRecord();
String address = btAdapter.getAddress();
//Gets advertised packets in a byte array
byte[] packetData = Scanned.getBytes();
//conversion to a hex stream from the byte array
for (byte hex : packetData) {
x.append(String.format("%02X", hex));
}
However, i have been asked to represent the hex stream as separate numerical values for each byte using ASCI! I attempted this with just the byte array, but the outcome of the byte array was not the 62 bit hex stream I was expecting. but instead 8 random symbols.
I have also tried the parseint() function in many different ways. Each of which compiles successfully, But proceeds to crash my app when i try to start a scan!
Any help on how best to achieve my requirements would be much appreciated.

Categories

Resources